Topic
  • 4 replies
  • Latest Post - ‏2012-06-04T04:56:35Z by SystemAdmin
pebl
pebl
3 Posts

Pinned topic Purify ends my program prematurely

‏2010-05-31T19:10:43Z |
Hi,

I am using Visual Studio 2008 to compile a small program, that listen for incoming tcp connections, and then does something. It usually works and I can debug it, etc.

I am trying to find a bug, which looks like something is flipping random bits in memory. This could also just be bad hardware memory etc. So for starters I just need a yes/no if it is my fault. If yes I probably need to a lot more info, as it not trivial to compile or debug. (java code translated to c and then linked with a gc, a nightmare to debug).

I am trying to use
Rational Purify version 7.0.1.0 (Evaluation) Build: 11118
just to get that yes/no, but then my programs ends prematurely.

This is all I get:

[I] Starting Purify'd C:\buildroot3\build\mpo\win32_i386_ansi\Debug\mpo.exe at 31-05-2010 20:44:15
[I] Starting main
[I] EXH: Handled exception in throwExn {1 occurrence}
[I] EXH: Handled exception in throwExn {1 occurrence}
[I] Exiting with code 0 (0x00000000)
[I] Program terminated at 31-05-2010 20:44:23
I have read (and followed) the advise from

http://www-01.ibm.com/support/docview.wss?rs=995&context=SSSHAZ&dc=DB560&dc=DB520&uid=swg21265414&loc=en_US&cs=UTF-8&lang=en&rss=ct995rational

When running with purify under debug in visual I am getting the following output, which I do not see without purify:


SXS: RtlpQueryFilesInAssemblyInformationActivationContextDetailedInformation() received invalid sub-instance index 3 out of 4 Assemblies in the Acitvation Context First-chance exception at 0x3f041f4a in mpo$Purify_C_buildroot3_build_mpo_win32__i386__ansi_Debug.exe: 0xC0000005: Access violation reading location 0x6d4d3000.   ...   SXS: RtlpQueryFilesInAssemblyInformationActivationContextDetailedInformation() received invalid sub-instance index 3 out of 4 Assemblies in the Acitvation Context 
'mpo$Purify_C_buildroot3_build_mpo_win32__i386__ansi_Debug.exe': Loaded 
'C:\Program Files (x86)\IBM\RationalPurifyPlus\PurifyPlus\cache\WinHttp$Purify_C_WINDOWS_WinSxS_x86__Microsoft_@Windows_@WinHTTP__6595b64144ccf1df__5_@1_@3790_@4584__x-ww__FE3453F4.dll', Symbols loaded (source information stripped). SXS: RtlpQueryFilesInAssemblyInformationActivationContextDetailedInformation() received invalid sub-instance index 3 out of 4 Assemblies in the Acitvation Context SXS: RtlpQueryFilesInAssemblyInformationActivationContextDetailedInformation() received invalid sub-instance index 3 out of 4 Assemblies in the Acitvation Context 
'mpo$Purify_C_buildroot3_build_mpo_win32__i386__ansi_Debug.exe': Loaded 
'C:\Program Files (x86)\IBM\RationalPurifyPlus\PurifyPlus\cache\dssenh$Purify_C_WINDOWS_system32.dll', Symbols loaded (source information stripped). SXS: RtlpQueryFilesInAssemblyInformationActivationContextDetailedInformation() received invalid sub-instance index 3 out of 4 Assemblies in the Acitvation Context   ...   The program 
'[6088] mpo$Purify_C_buildroot3_build_mpo_win32__i386__ansi_Debug.exe: Native' has exited with code 0 (0x0).


I assume it is not because I am using the evaluation version. What should I do/try next?

Peter
Updated on 2012-06-04T04:56:35Z at 2012-06-04T04:56:35Z by SystemAdmin
  • pebl
    pebl
    3 Posts

    Re: Purify ends my program prematurely

    ‏2010-06-10T15:00:56Z  
    Answering myself for other interested readers:

    I think its a Purify bug. Purify runs my program under
    a different working directory than visual studio. Nor
    does the standalone program works, it also runs my program
    with same (strange) working directory, ignoring the setting
    of "working directory".

    At the very start my program is trying to load an systray icon
    in working directory which failed.

    Peter
  • pebl
    pebl
    3 Posts

    Re: Purify ends my program prematurely

    ‏2010-06-26T00:42:15Z  
    • pebl
    • ‏2010-06-10T15:00:56Z
    Answering myself for other interested readers:

    I think its a Purify bug. Purify runs my program under
    a different working directory than visual studio. Nor
    does the standalone program works, it also runs my program
    with same (strange) working directory, ignoring the setting
    of "working directory".

    At the very start my program is trying to load an systray icon
    in working directory which failed.

    Peter
    I had some time to figure out what went wrong when using purify.
    Following code fails:

    
    
    
    char[] buf = 
    
    new 
    
    char[30]; 
    
    for(;;) 
    { 
    
    int got = GetModuleFileNameW(modulehandle, buf); 
    
    if( got < buf.length ) 
    
    return 
    
    new String(buf,0,got); buf = 
    
    new 
    
    char[2*buf.length]; 
    }
    


    The code retrieves the module path by trying with larger and larger buffer.
    When the path is larger than 30, purify returns 29, not 30, and a truncated
    path is returned.
  • SystemAdmin
    SystemAdmin
    2948 Posts

    Re: Purify ends my program prematurely

    ‏2012-06-01T09:39:28Z  
    I had the same problem. In my case, the cause was that the executable was located on a mapped device (one that was created with the subst command) when it was instrumented. I moved the .exe to a real physical device and did the instrumentation there. This solved the problem. I could even move it back to its original location after instrumentation.
  • SystemAdmin
    SystemAdmin
    2948 Posts

    Re: Purify ends my program prematurely

    ‏2012-06-04T04:56:35Z  
    • pebl
    • ‏2010-06-10T15:00:56Z
    Answering myself for other interested readers:

    I think its a Purify bug. Purify runs my program under
    a different working directory than visual studio. Nor
    does the standalone program works, it also runs my program
    with same (strange) working directory, ignoring the setting
    of "working directory".

    At the very start my program is trying to load an systray icon
    in working directory which failed.

    Peter
    Hi Peter,

    Thanks to let us know these. You may open a PMR using your IBM support ID, then we may fix this in next release or fix pack.

    Regards,
    Gary