Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ Running the server ➜ Valgrind - Questions

Valgrind - Questions

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Ithildin   USA  (262 posts)  Bio
Date Sat 04 Jun 2005 11:03 PM (UTC)
Message
Ok, I ran Valgrind but I'm not sure if I'm doing it right or not. I got these messages and I don't know if they are good or bad. Sorry, this is my first time running the program. Not sure how to use it much.


$ valgrind --tool=memcheck --leak-check=yes --show-reachable=yes -v envy
==18134== Memcheck, a memory error detector for x86-linux.
==18134== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al.
==18134== Using valgrind-2.2.0, a program supervision framework for x86-linux.
==18134== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.
==18134== Valgrind library directory: /usr/lib/valgrind
==18134== Command line
==18134==    envy
==18134== Startup, with flags:
==18134==    --tool=memcheck
==18134==    --leak-check=yes
==18134==    --show-reachable=yes
==18134==    -v
==18134== Contents of /proc/version:
==18134==   Linux version 2.6.11-1.27_FC3 (bhcompile@porky.build.redhat.com) (gcc version 3.4.3 20050227 (Red Hat 3.4.3-22)) #1 Tue May 17 20:27:37 EDT 2005
==18134== Reading syms from /home/adminmud/prod/Envy20/src/envy (0x8048000)
==18134== Reading syms from /lib/ld-2.3.5.so (0x1B8E4000)
==18134==    object doesn't have any debug info
==18134== Reading syms from /usr/lib/valgrind/stage2 (0xB0000000)
==18134== Reading syms from /lib/ld-2.3.5.so (0xB1000000)
==18134==    object doesn't have any debug info
==18134== Reading syms from /usr/lib/valgrind/vgskin_memcheck.so (0xB7BA4000)
==18134== Reading syms from /lib/tls/libc-2.3.5.so (0xB7DCE000)
==18134==    object doesn't have any debug info
==18134== Reading syms from /lib/libdl-2.3.5.so (0xB7EF8000)
==18134==    object doesn't have any debug info
==18134== Reading suppressions file: /usr/lib/valgrind/default.supp
==18134== REDIRECT soname:libc.so.6(__GI___errno_location) to soname:libpthread.so.0(__errno_location)
==18134== REDIRECT soname:libc.so.6(__errno_location) to soname:libpthread.so.0(__errno_location)
==18134== REDIRECT soname:libc.so.6(__GI___h_errno_location) to soname:libpthread.so.0(__h_errno_location)
==18134== REDIRECT soname:libc.so.6(__h_errno_location) to soname:libpthread.so.0(__h_errno_location)
==18134== REDIRECT soname:libc.so.6(__GI___res_state) to soname:libpthread.so.0(__res_state)
==18134== REDIRECT soname:libc.so.6(__res_state) to soname:libpthread.so.0(__res_state)
==18134== REDIRECT soname:libc.so.6(stpcpy) to *vgpreload_memcheck.so*(stpcpy)
==18134== REDIRECT soname:libc.so.6(strnlen) to *vgpreload_memcheck.so*(strnlen)
==18134== REDIRECT soname:ld-linux.so.2(stpcpy) to *vgpreload_memcheck.so*(stpcpy)
==18134== REDIRECT soname:ld-linux.so.2(strchr) to *vgpreload_memcheck.so*(strchr)
==18134==
==18134== Reading syms from /usr/lib/valgrind/vg_inject.so (0x1B8FD000)
==18134== Reading syms from /usr/lib/valgrind/vgpreload_memcheck.so (0x1B900000)
==18134== TRANSLATE: 0x1B8F5F60 redirected to 0x1B90320C
==18134== Reading syms from /lib/libcrypt-2.3.5.so (0x612C000)
==18134==    object doesn't have any debug info
==18134== Reading syms from /lib/tls/libc-2.3.5.so (0x9CB000)
==18134==    object doesn't have any debug info
==18134== TRANSLATE: 0x1B8E47A0 redirected to 0x52BFF040
==18134== TRANSLATE: 0xA2EE80 redirected to 0x1B903A04
==18134== TRANSLATE: 0xA2CDB0 redirected to 0x1B903F30
==18134== TRANSLATE: 0xA33D20 redirected to 0x1B9033DC
==18134== TRANSLATE: 0xA2EBA0 redirected to 0x1B904380

==18134==
==18134== Process terminating with default action of signal 2 (SIGINT)
==18134==    at 0xA24C31: _IO_getc (in /lib/tls/libc-2.3.5.so)
==18134==    by 0x80713E1: fread_string (db.c:2927)
==18134==    by 0x806E735: load_mobiles (db.c:824)
==18134==    by 0x806E04F: boot_db (db.c:496)
==18134==
==18134== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 13 from 1)
--18134--
--18134-- supp:   13 dl_relocate_object/dl_main
==18134== malloc/free: in use at exit: 10788799 bytes in 17 blocks.
==18134== malloc/free: 35 allocs, 18 frees, 10795135 bytes allocated.
==18134==
==18134== searching for pointers to 17 not-freed blocks.
==18134== checked 13512940 bytes.
==18134==
==18134== 15 bytes in 1 blocks are still reachable in loss record 1 of 6
==18134==    at 0x1B903A90: malloc (vg_replace_malloc.c:131)
==18134==    by 0xA339EF: strdup (in /lib/tls/libc-2.3.5.so)
==18134==    by 0xA46991: tzset_internal (in /lib/tls/libc-2.3.5.so)
==18134==    by 0xA47619: __tz_convert (in /lib/tls/libc-2.3.5.so)
==18134==
==18134==
==18134== 60 bytes in 5 blocks are still reachable in loss record 2 of 6
==18134==    at 0x1B903A90: malloc (vg_replace_malloc.c:131)
==18134==    by 0xA46849: __tzstring (in /lib/tls/libc-2.3.5.so)
==18134==    by 0xA47EED: __tzfile_read (in /lib/tls/libc-2.3.5.so)
==18134==    by 0xA469AE: tzset_internal (in /lib/tls/libc-2.3.5.so)
==18134==
==18134==
==18134== 1056 bytes in 3 blocks are still reachable in loss record 3 of 6
==18134==    at 0x1B903A90: malloc (vg_replace_malloc.c:131)
==18134==    by 0xA1DC4E: __fopen_internal (in /lib/tls/libc-2.3.5.so)
==18134==    by 0xA1DD0C: _IO_fopen@@GLIBC_2.1 (in /lib/tls/libc-2.3.5.so)
==18134==    by 0x80678FD: main (comm.c:464)
==18134==
==18134==
==18134== 1236 bytes in 1 blocks are still reachable in loss record 4 of 6
==18134==    at 0x1B903A90: malloc (vg_replace_malloc.c:131)
==18134==    by 0xA47ADB: __tzfile_read (in /lib/tls/libc-2.3.5.so)
==18134==    by 0xA469AE: tzset_internal (in /lib/tls/libc-2.3.5.so)
==18134==    by 0xA47619: __tz_convert (in /lib/tls/libc-2.3.5.so)
==18134==


Next post

Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #1 on Sat 04 Jun 2005 11:03 PM (UTC)
Message

==18134==
==18134== 786432 bytes in 6 blocks are still reachable in loss record 5 of 6
==18134==    at 0x1B90440D: calloc (vg_replace_malloc.c:176)
==18134==    by 0x8071777: alloc_perm (db.c:3162)
==18134==    by 0x806E585: load_helps (db.c:732)
==18134==    by 0x806DFF9: boot_db (db.c:492)
==18134==
==18134==
==18134== 10000000 bytes in 1 blocks are still reachable in loss record 6 of 6
==18134==    at 0x1B90440D: calloc (vg_replace_malloc.c:176)
==18134==    by 0x806DCF8: boot_db (db.c:372)
==18134==    by 0x80679FD: main (comm.c:516)
==18134==
==18134== LEAK SUMMARY:
==18134==    definitely lost: 0 bytes in 0 blocks.
==18134==    possibly lost:   0 bytes in 0 blocks.
==18134==    still reachable: 10788799 bytes in 17 blocks.
==18134==         suppressed: 0 bytes in 0 blocks.
--18134--     TT/TC: 0 tc sectors discarded.
--18134--            3462 tt_fast misses.
--18134-- translate: new     3222 (54449 -> 728471; ratio 133:10)
--18134--            discard 2 (59 -> 840; ratio 142:10).
--18134-- chainings: 2545 chainings, 3 unchainings.
--18134--  dispatch: 25200000 jumps (bb entries); of them 4687189 (18%) unchained.
--18134--            931/4574 major/minor sched events.
--18134-- reg-alloc: 625 t-req-spill, 133916+5154 orig+spill uis,
--18134--            17137 total-reg-rank
--18134--    sanity: 930 cheap, 38 expensive checks.
--18134--    ccalls: 12355 C calls, 56% saves+restores avoided (41210 bytes)
--18134--            16618 args, avg 0.88 setup instrs each (3954 bytes)
--18134--            0% clear the stack (36891 bytes)
--18134--            4727 retvals, 30% of reg-reg movs avoided (2760 bytes)


So there it is. I noticed a few things in there, but not sure how bad it is.
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #2 on Sun 05 Jun 2005 12:36 AM (UTC)
Message
by 0x806E735: load_mobiles (db.c:824)


If you happen to know which area file it was loading, and what is on line 824 of your db.c, this would help. It looks to me like the program exited. Unless you interrupted it yourself.
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #3 on Sun 05 Jun 2005 01:14 AM (UTC)

Amended on Sun 05 Jun 2005 01:20 AM (UTC) by Ithildin

Message
Yea, it stopped right before it. I hit ctrl-c and it then everything else came up. the line in db.c is:


      fBootDb = FALSE;
      if (get_mob_index (vnum))
        {
          bug ("Load_mobiles: vnum %d duplicated.", vnum);
          exit (1);
        }
      fBootDb = TRUE;

      pMobIndex = alloc_perm (sizeof (*pMobIndex));
      pMobIndex->vnum = vnum;
      pMobIndex->area = area_last;      /* OLC */
      pMobIndex->player_name = fread_string (fp);
      pMobIndex->short_descr = fread_string (fp);
      pMobIndex->long_descr = fread_string (fp); <---------Here is 824
      pMobIndex->description = fread_string (fp);

      pMobIndex->long_descr[0] = UPPER (pMobIndex->long_descr[0]);
      pMobIndex->description[0] = UPPER (pMobIndex->description[0]);

      pMobIndex->act = fread_number (fp) | ACT_IS_NPC;


How do you i find out what area it's reading at that time? and if the valgrind stops, should I just wait it out to see what ahppens?
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #4 on Sun 05 Jun 2005 05:22 AM (UTC)
Message
You'd have to put in some kind of log_string call to let you know as each area is loaded. From your output, it doesn't appear as though Envy does this.

When you stopped execution, how long had it been stuck? Valgrind can sometimes slow things to a crawl and seem like it got stuck.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


19,552 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.