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
➜ Programming
➜ General
➜ Gdb didn't catch segfault?
|
Gdb didn't catch segfault?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2 3
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #15 on Tue 28 Mar 2006 02:06 AM (UTC) |
| Message
| It looks like when you continue, a new thread is launched that wasn't there before, and it didn't stop the old one. Can't figure out why that would be, though.
What libraries are you linking with? Any idea what shared libraries it's loading on startup? |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #16 on Tue 28 Mar 2006 02:55 AM (UTC) |
| Message
| What includes?
mud.h:#include <zlib.h>
mud.h:#include <pthread.h>
mud.h:#include <arpa/telnet.h>
mud.h:#include "random.h"
interpret.c:#include <sys/types.h>
interpret.c:#include <stdio.h>
interpret.c:#include <string.h>
interpret.c:#include <ctype.h>
interpret.c:#include <time.h>
interpret.c:#include <stdarg.h>
I think there's some more. pthread makes me wonder though. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #17 on Tue 28 Mar 2006 05:50 AM (UTC) |
| 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 | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #18 on Tue 28 Mar 2006 07:04 AM (UTC) |
| 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 | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #19 on Wed 29 Mar 2006 12:11 AM (UTC) |
| 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 | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #20 on Wed 29 Mar 2006 01:30 AM (UTC) |
| 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 | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #21 on Wed 29 Mar 2006 02:30 AM (UTC) |
| 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 | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #22 on Thu 30 Mar 2006 12:01 AM (UTC) |
| 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 | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #23 on Thu 30 Mar 2006 12:06 AM (UTC) |
| 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 | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #24 on Thu 30 Mar 2006 12:44 AM (UTC) |
| 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 | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #25 on Thu 30 Mar 2006 12:46 AM (UTC) |
| 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 | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #26 on Thu 30 Mar 2006 12:49 AM (UTC) |
| 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 | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #27 on Fri 31 Mar 2006 10:37 AM (UTC) 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 | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #28 on Fri 31 Mar 2006 05:16 PM (UTC) |
| 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 | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #29 on Fri 31 Mar 2006 09:08 PM (UTC) |
| Message
|
I guess 6.4 is the newest version. Maybe I'll upgrade... |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | | 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.
100,750 views.
This is page 2, subject is 3 pages long:
1
2 3
It is now over 60 days since the last post. This thread is closed.
Refresh page
top