[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  Programming
. -> [Folder]  General
. . -> [Subject]  Gdb didn't catch segfault?

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Gdb didn't catch segfault?
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  3  

Posted by Samson   USA  (683 posts)  [Biography] bio
Date Tue 04 Apr 2006 09:16 AM (UTC)  quote  ]
Message
Definitely looks like time for "old school" debugging. Lots of log messages sprinkled about. Start general. Log message at the beginning of game_loop, in between the descriptor input and the descriptor output, beginning and end of the update_handler, and the end of game_loop. Then when it just up and dies, if you haven't killed the thing with 3 days worth of log spam, you can begin to narrow down the search with log messages in more specific parts. Pain in the ass, but some bugs just demand this kind of attention.

SmaugMuds.org: http://www.smaugmuds.org - The Smaug MUDs Community Center

"The past was erased, the erasure was forgotten, the lie became truth." -- George Orwell, 1984
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Tue 04 Apr 2006 12:35 AM (UTC)  quote  ]
Message
Let me know if this fixes anything. I have to admit that I'm stumped on this one...

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Fri 31 Mar 2006 09:08 PM (UTC)  quote  ]
Message
GNU gdb 6.3


I guess 6.4 is the newest version. Maybe I'll upgrade...

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Fri 31 Mar 2006 05:16 PM (UTC)  quote  ]
Message
You know, this might just be a bug in gdb... have you tried upgrading to the latest version?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Fri 31 Mar 2006 10:37 AM (UTC)  quote  ]

Amended on Fri 31 Mar 2006 10:38 AM (UTC) by Zeno

Message
*grunt*

(gdb) run
Starting program: /home/zeno/chub/src/chub
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 26217)]
[New Thread 32769 (LWP 26219)]
[New Thread 16386 (LWP 26220)]
[Thread 16386 (LWP 26220) exited]
Cannot find user-level thread for LWP 26217: generic error
(gdb)


Between "exited" line and "Cannot find user-level" line is 3 days; 27th to 31st.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Thu 30 Mar 2006 12:49 AM (UTC)  quote  ]
Message
Oh, right, I forgot that this was on your local machine, not a public server. So there shouldn't be a memory quota... sorry. :-)

Still, it's worth running this through Valgrind, if you can.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Thu 30 Mar 2006 12:46 AM (UTC)  quote  ]
Message
The memory quota? I have this installed on my local machine. Is there really a memory quota included, or is it normally set by the admin? Because I haven't set it.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Thu 30 Mar 2006 12:44 AM (UTC)  quote  ]
Message
Maybe you have a memory leak that after 3 days is causing it to overflow the memory quota. Have you tried running Valgrind on it?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Thu 30 Mar 2006 12:06 AM (UTC)  quote  ]
Message
The %MEM is... 74.3. Cough. I should have looked at that earlier.

What I now plan to do is restart from the start. I have a lot more knowledge then I did when I started, and I could also work Lua into it.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Thu 30 Mar 2006 12:01 AM (UTC)  quote  ]
Message
It's weird that it's happening so regularly after 3 days. Any chance of an overflow somewhere on a timer?

As for hostnames: it's possible that the feature doesn't quite work. Or that you have to type 'users' to see the hostnames, because it's in the process of resolving them. But the point of the feature is to prevent the entire MUD from hanging if the DNS lookup hangs. Generally that happens if the DNS resolver is having issues.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Wed 29 Mar 2006 02:30 AM (UTC)  quote  ]
Message
I can't find anything related to the crash besides for being ~3 days running and then it crashes.

Weird... hostnames? I've never seen that feature in SocketMUD. It just displays the IP as far as I've.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Wed 29 Mar 2006 01:30 AM (UTC)  quote  ]
Message
OK, it looks like you create a thread called "thread_lookup"; I imagine you are using that to do the DNS lookups so that the whole MUD doesn't hang if the DNS is slow? That's something I've been meaning to do for a while.

Anyhow, have you observed any correlation at all between someone connecting and the MUD crashing a short time later?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Wed 29 Mar 2006 12:11 AM (UTC)  quote  ]
Message
socket.c:  pthread_attr_t       attr;
socket.c:  pthread_t            thread_lookup;
socket.c:  pthread_attr_init(&attr);
socket.c:  pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
socket.c:      pthread_create(&thread_lookup, &attr, &lookup_address, (void*) lData);
socket.c:  pthread_exit(0);


L_FLAGS = -lz -lpthread -lcrypt

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Tue 28 Mar 2006 07:04 AM (UTC)  quote  ]
Message
Nick's right about the local variables being smashed. Valgrind would help you with that.

As for pthread, it should be easy to find out where you're using it... just grep for 'pthread'. (And I actually meant what you're linking with at link time i.e. what -l flags you send to g++ at link phase.)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Tue 28 Mar 2006 05:50 AM (UTC)  quote  ]
Message
A crash that does not produce helpful information can often be caused by a badly corrupted stack. If the stack itself is wiped out, then doing a backtrace can be a problem.

Wiping the stack isn't that hard, overwriting a local variable can easily do it (that is, memset or strcpy into more space than was allocated).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


8,781 views.

This is page 1, subject is 3 pages long: 1 2  3  [Next page]

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]