1 2 Previous Next 20 Replies Latest reply: Mar 8, 2011 8:44 AM by 842476 Go to original post RSS
      • 15. Re: Problem at using showleaks (dbx) on multithreaded process
        842476
        Hi all,
        I'm sorry, I couldn't answer before.

        I send the stack trace as you requested:

        # /opt/SUNWspro/bin/dbx
        For information about new features see `help changes'
        To remove this message, put `dbxenv suppress_startup_message 7.5' in your .dbxrc
        (dbx) debug pmtHttpServer
        Reading pmtHttpServer
        Reading ld.so.1
        Reading libmtmalloc.so.1
        Reading libpthread.so.1
        Reading libthread_db.so.1
        Reading libproc.so.1
        Reading librt.so.1
        Reading libxml2.so.2
        Reading libz.so.1
        Reading libm.so.1
        Reading libcommonLibraries.so
        Reading libdbCommon.so
        Reading libdbConfiguration.so
        Reading libdbTerceros.so
        Reading libdbSession.so
        Reading libfmrdb_mt.so
        Reading libnsl.so.1
        Reading libsocket.so.1
        Reading libCstd.so.1
        Reading libCrun.so.1
        Reading libthread.so.1
        Reading libc.so.1
        Reading libdl.so.1
        Reading librtld_db.so.1
        Reading libelf.so.1
        Reading libaio.so.1
        Reading libmd5.so.1
        Reading libmp.so.2
        Reading libc_psr.so.1
        (dbx) list http_msg.c:849
        849 DEPURA0("Entering in HTTP_msg_decode");
        (dbx) list
        850 DEPURA2("In Buffer Buff(%s) len(%d)",inPtrBuff,inBuffLen);
        851
        852 DEPURA0("MALLOC SIN FREE");
        853 p=malloc(5);
        854
        855 /*----------*/
        856
        857 while(!end)
        858 {
        (dbx) stop at http_msg.c:857
        (2) stop at "http_msg.c":857
        (dbx) check -leaks
        leaks checking - ON
        (dbx) check -memuse
        memuse checking - ON
        (dbx) run
        Running: pmtHttpServer
        (process id 11860)
        Reading rtcapihook.so
        Reading rtcaudit.so
        Reading libmapmalloc.so.1
        Reading libgen.so.1
        Reading rtcboot.so
        Reading librtc.so
        RTC: Enabling Error Checking...
        RTC: Running program...
        t@11 (l@11) stopped in HTTP_msg_decode at line 857 in file "http_msg.c"
        857 while(!end)
        (dbx) where
        current thread: t@11
        =>[1] HTTP_msg_decode(inPtrMsg = 0x100a73f28, inPtrBuff = 0x100a620b8 "POST /soap/SOAPSMS HTTP/1.1^M\nContent-Type: text/xml;^M\nHost: 172.24.46.32:41025^M\nContent-Length: 1286^M\nConnection: Keep-Alive^M\n^M\n<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">^M\n<soap-env:Header>^M\n<vodh:VODHeader xmlns:vodh="http://www.vodafone.com/soap/header/">^M\n<vodh:commandId>ServiceDelivery</vodh:commandId>^M\n<vodh:authentication>^M\n<vodh:username>VF-SUSCRIP</vodh:username>^M\n<vodh:password>VODAFONE</vodh:password>^M\n</vodh:authentication>^M\n<vodh:service>^M\n<vodh:serviceID>0000" ..., inBuffLen = 1414, outPtrLen = 0xffffffff49dfbde0), line 857 in "http_msg.c"
        [2] HTTP_chn_read_cb(inFd = 12, inPtrChn = 0x100a61f20), line 1376 in "http_chn.c"
        [3] amta_handle_threads(inPtrThr = 0x1004801f0), line 1136 in "amta.c"
        (dbx) showleaks
        Checking for memory leaks...

        Actual leaks report (actual leaks: 0 total size: 0 bytes)



        Possible leaks report (possible leaks: 0 total size: 0 bytes)


        (dbx) showmemuse
        Checking for memory use...

        Blocks in use report (blocks in use: 0 total size: 0 bytes)


        (dbx)

        I inform that LD_PRELOAD is not use.
        In order to link without libmtmalloc I should change 26 files. I'll try as soon as I have enough time.
        Thank you for your attention
        • 16. Re: Problem at using showleaks (dbx) on multithreaded process
          842476
          Hi,
          I linked the file where the malloc is called without libmtlibrary, and I got the same result.
          • 17. Re: Problem at using showleaks (dbx) on multithreaded process
            janitor
            To track down which malloc is used, one can set a breakpoint in malloc and check the stack trace. In your example, please try the following steps:

            1) stop at http_msg.c:853
            2) run
            3) stop in malloc # selete all if a menu pops up
            4) cont
            5) whereis -a $pc # breakpoint in malloc
            6) where

            You can also check how many malloc methods are available using the dbx command "whereis malloc" in http_msg.c line 853.
            • 18. Re: Problem at using showleaks (dbx) on multithreaded process
              842476
              Hi Janitor,
              I don't know if these llines can help. I can't see any futher information

              (dbx) list http_msg.c:853
              853 p=malloc(5);
              (dbx) stop at http_msg.c:853
              (2) stop at "http_msg.c":853
              (dbx) check -leaks
              leaks checking - ON
              (dbx) run
              Running: pmtHttpServer
              (process id 27038)
              Reading rtcapihook.so
              Reading rtcaudit.so
              Reading libmapmalloc.so.1
              Reading libgen.so.1
              Reading rtcboot.so
              Reading librtc.so
              RTC: Enabling Error Checking...
              RTC: Running program...
              t@10 (l@10) stopped in HTTP_msg_decode at line 853 in file "http_msg.c"
              853 p=malloc(5);
              (dbx) cont
              t@7 (l@7) stopped in HTTP_msg_decode at line 853 in file "http_msg.c"
              853 p=malloc(5);
              (dbx) whereis -a $pc
              in `pmtHttpServer`http_msg.c`HTTP_msg_decode at "http_msg.c":853
              (dbx) where
              current thread: t@7
              =>[1] HTTP_msg_decode(inPtrMsg = 0x100b03f28, inPtrBuff = 0x100af20b8 "POST /soap/SOAPSMS HTTP/1.1^M\nContent-Type: text/xml;^M\nHost: 172.24.46.32:41025^M\nContent-Length: 1286^M\nConnection: Keep-Alive^M\n^M\n<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">^M\n<soap-env:Header>^M\n<vodh:VODHeader xmlns:vodh="http://www.vodafone.com/soap/header/">^M\n<vodh:commandId>ServiceDelivery</vodh:commandId>^M\n<vodh:authentication>^M\n<vodh:username>VF-SUSCRIP</vodh:username>^M\n<vodh:password>VODAFONE</vodh:password>^M\n</vodh:authentication>^M\n<vodh:service>^M\n<vodh:serviceID>0000" ..., inBuffLen = 1414, outPtrLen = 0xffffffff4a5fbde0), line 853 in "http_msg.c"
              [2] HTTP_chn_read_cb(inFd = 21, inPtrChn = 0x100af1f20), line 1376 in "http_chn.c"
              [3] amta_handle_threads(inPtrThr = 0x100480110), line 1136 in "amta.c"
              (dbx) whereis malloc
              function: `libmtmalloc.so.1`malloc
              function: `libc.so.1`malloc
              (dbx) step to malloc
              t@5 (l@5) stopped in malloc at 0xffffffff69100ab0
              0xffffffff69100ab0: malloc : save %sp, -176, %sp
              Current function is HTTP_msg_decode
              853 p=malloc(5);
              (dbx) step
              dbx: warning: stepping up to a function with srcline info
              t@5 (l@5) stopped in HTTP_msg_decode at line 857 in file "http_msg.c"
              857 while(!end)

              Thanks for your attention
              • 19. Re: Problem at using showleaks (dbx) on multithreaded process
                janitor
                Two issues.

                1) Need to set a breakpoing in malloc after hitting breakpoint at 853. Use
                "where is $pc" only when inside the malloc function.
                RTC: Running program...
                t@10 (l@10) stopped in HTTP_msg_decode at line 853 in file "http_msg.c"
                853 p=malloc(5);
                !!! Need to set a breakpoint in malloc here (e.g. stop in malloc)
                (dbx) cont
                t@7 (l@7) stopped in HTTP_msg_decode at line 853 in file "http_msg.c"
                853 p=malloc(5);
                (dbx) whereis -a $pc

                2) Looks like libmtmalloc.so is still be used:
                (dbx) whereis malloc
                function: `libmtmalloc.so.1`malloc
                function: `libc.so.1`malloc
                Try to search for "-lmtmalloc" may help.
                • 20. Re: Problem at using showleaks (dbx) on multithreaded process
                  842476
                  Hi Janitor,
                  I finally got the leak information.
                  The point was, as you advised me but I missed (I noticed it when you pointed at the second issue). that I still linked with -lmtmalloc library.
                  Thank you for your help and sorry for the inconvenience caused.
                  Ignacio
                  1 2 Previous Next