Topic
3 replies Latest Post - ‏2012-09-21T17:49:19Z by SystemAdmin
ErikZoltan
ErikZoltan
2 Posts
ACCEPTED ANSWER

Pinned topic Can't Understand HelloWorld core dump in Purify 7.0.1 for Solaris

‏2012-09-18T17:18:54Z |
I entered the following simple program which is a slight modification of one I found in the Getting Started documentation. (That one also crashes.) I got a core dump in Purify Plus and I am wondering if anyone has thoughts about how to proceed.



// Purify Plus Example of a Memory Leak   #include <stdio.h> #include <malloc.h> #include <string.h>   

static 

char *helloWorld = 
"Hello, World";   

int main() 
{ 

char *mystr = malloc(strlen(helloWorld));   strncpy(mystr, helloWorld, 12); printf(
"%s\n", mystr); 
}


Here is the output from Purify when I try to run the program.


****  Purify instrumented /export/home/czhwr7/pure/a.out (pid 19548 at Tue Sep 18 13:13:04 2012) * Purify 7.0.1 091008 Solaris SPARC (32-bit) (C) Copyright IBM Corporation. 1992, 2009 All Rights Reserved. * For contact information type: 
"purify -help" * For Purify Viewer output, set the DISPLAY environment variable. * License successfully checked out.   ****  Purify instrumented /export/home/czhwr7/pure/a.out (pid 19548)  **** COR: Fatal core dump: * This is occurring 

while in: _p1413static   [rtlib.o] _pure_so_register [rtlib.o] libc_init      [libc.so.1] rt_thr_init    [] setup          [] _setup         [] _rt_boot       [] * Received signal 11 (SIGSEGV - Segmentation Fault) * Faulting address = 0x0 * Signal mask: (SIGSEGV) * Pending signals:   No dynamic memory is in use.  No leaks are possible.   ****  Purify instrumented /export/home/czhwr7/pure/a.out (pid 19548)  **** Thread Summary : 1 thread(s) in existence * Thread 0 [main thread] Stack Limit : (0xff400000 0xffc00000), size = 0x800000   ****  Purify instrumented /export/home/czhwr7/pure/a.out (pid 19548)  **** * Program terminated. * 1 access error, 1 total occurrence. * Basic memory usage (including Purify overhead): 420568 code 119992 data/bss 0 heap (peak use) 9664 stack * Shared library memory usage (including Purify overhead): (0xff350000 - 0xff3503f4) 1012 /opt/IBM/releases/purify.sol.7.0.1/lib32/libpure_solaris2_init.so.1 (shared code) (0xff3603f4 - 0xff360500) 268 /opt/IBM/releases/purify.sol.7.0.1/lib32/libpure_solaris2_init.so.1 (

private data) (0xff100000 - 0xff2c2198) 1843608 /opt/IBM/releases/purify.sol.7.0.1/cache/sx-mits-ap10/lib/libc.so.1_pure_p3_c0_110082040_510_32 (shared code) (0xff2d4000 - 0xff2de68c) 42636 /opt/IBM/releases/purify.sol.7.0.1/cache/sx-mits-ap10/lib/libc.so.1_pure_p3_c0_110082040_510_32 (

private data) (0xff330000 - 0xff330814) 2068 /opt/IBM/releases/purify.sol.7.0.1/cache/sx-mits-ap10/lib/libdl.so.1_pure_p3_c0_110082040_510_32 (shared code) (0xff342000 - 0xff342104) 260 /opt/IBM/releases/purify.sol.7.0.1/cache/sx-mits-ap10/lib/libdl.so.1_pure_p3_c0_110082040_510_32 (

private data) (0xff2f0000 - 0xff2f6308) 25352 /opt/IBM/releases/purify.sol.7.0.1/lib32/libinternal_stubs.so.1 (shared code) (0xff306308 - 0xff30654d) 581 /opt/IBM/releases/purify.sol.7.0.1/lib32/libinternal_stubs.so.1 (

private data) (0xfe900000 - 0xfea62870) 1452144 /opt/IBM/releases/purify.sol.7.0.1/cache/sx-mits-ap10/lib/libm.so.2_pure_p3_c0_110082040_510_32 (shared code) (0xfea72870 - 0xfea77600) 19856 /opt/IBM/releases/purify.sol.7.0.1/cache/sx-mits-ap10/lib/libm.so.2_pure_p3_c0_110082040_510_32 (

private data) * Memory mapped usage: 24576 mmap
'd at 0xfeb00000   Segmentation Fault (core dumped)


I am starting to think it may be a configuration issue rather than a problem in the program.
Updated on 2012-09-21T17:49:19Z at 2012-09-21T17:49:19Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    2948 Posts
    ACCEPTED ANSWER

    Re: Can't Understand HelloWorld core dump in Purify 7.0.1 for Solaris

    ‏2012-09-18T17:29:59Z  in response to ErikZoltan
    Hi Erik,

    It's most likely a configuration issue. What version of Solaris are
    you using? (SPARC or x64?) What compiler version are you using?
    Note that Purify 7.0.1 dates back to about 2009 and only supports the
    following Solaris versions and compilers:

    Solaris 10 base through 5/09
    Solaris 9 base through 9/05
    Solaris 8 base through 2/04

    Sun C/C++ 5.3 through 5.10
    GNU gcc/g++ 4.0 through 4.4
    GNU gcc/g++ 3.0 through 3.4

    Regards,
    Don
    • ErikZoltan
      ErikZoltan
      2 Posts
      ACCEPTED ANSWER

      Re: Can't Understand HelloWorld core dump in Purify 7.0.1 for Solaris

      ‏2012-09-18T21:20:17Z  in response to SystemAdmin
      Thanks for replying. Here is some information that answers your questions.

      
      $ uname -a SunOS sx-mits-ap10 5.10 Generic_147440-12 sun4u sparc SUNW,SPARC-Enterprise   $ cc -V cc: Sun C 5.10 SunOS_sparc 2009/06/03 usage: cc [ options] files.  Use 
      'cc -flags' 
      
      for details   $ purify -version Version 7.0.1 091008 Solaris SPARC   $ cc -g hello_world.c   $ purify cc -g hello_world.c Purify 7.0.1 091008 Solaris SPARC (32-bit) (C) Copyright IBM Corporation. 1992, 2009 All Rights Reserved. Instrumenting: hello_world.o  Linking   $
      
      • SystemAdmin
        SystemAdmin
        2948 Posts
        ACCEPTED ANSWER

        Re: Can't Understand HelloWorld core dump in Purify 7.0.1 for Solaris

        ‏2012-09-21T17:49:19Z  in response to ErikZoltan
        Hi Erik,

        Hmmm, well it certainly looks like you're running Purify in a
        supported environment. Here are a few other things to try:

        1. Upgrade to PurifyPlus 7.0.1.0 iFix 002. This is a newer
        version of PurifyPlus.
        http://www-01.ibm.com/support/docview.wss?uid=swg21315781

        2. Clear out your PurifyPlus cache directory to force every-
        thing to be rebuilt from scratch. (You could also use the
        -force-rebuild option to accomplish the same thing.)

        3. Contact Tech Support at 1-800-IBM-SERV to get technical
        assistance. Be sure to have your IBM Customer Number or
        ICN handy when you call.

        Best regards,
        Don