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.
Entire forum
➜ Programming
➜ General
➜ Core dumps
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Thu 24 Feb 2011 06:05 PM (UTC) Amended on Thu 24 Feb 2011 06:08 PM (UTC) by Zeno
|
Message
| I'm trying to remember how to get cores to dump.
I have C code which gets compiled and run like a MUD, but it's threaded (which makes gdb difficult).
I'm not getting any cores being dumped.
ulimit:
core file size (blocks, -c) 16384
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 7168
virtual memory (kbytes, -v) unlimited
Makefile uses -D_REENTRANT -g -o execname -pthread -lm on obj files and -D_REENTRANT -c -g on source files
Or maybe my program isn't seg faulting. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) Bio
Forum Administrator |
Date
| Reply #1 on Thu 24 Feb 2011 08:47 PM (UTC) |
Message
| You're not sure if it's segfaulting? Is there no message?
How do threads stop gdb anyway? A quick Google seems to indicate it may be able to handle that.
Maybe your program is looping rather than seg faulting. Anyway, can you do a "ps" and see if it is running or not? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #2 on Thu 24 Feb 2011 08:53 PM (UTC) |
Message
| I was getting reports that a players instance of the game crashed, so I was assuming it was segfaults.
The issue with threads is that I don't know which thread to attach to in gdb. Nor do I know what's causing the crash.
So I'm hoping to have core dumps. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #3 on Fri 25 Feb 2011 02:15 PM (UTC) |
Message
| It's pretty easy to test if your environment is set up for core dumps: just write a program that should dump a core, like assert(0) or a null pointer deref or something. |
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 #4 on Sat 26 Feb 2011 03:16 AM (UTC) |
Message
| Environment is setup for cores dumping it seems.
Guess I need to figure out what this 11+ year old code is doing. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) Bio
Forum Administrator |
Date
| Reply #5 on Sat 26 Feb 2011 06:13 AM (UTC) |
Message
| People use the word "crash" in strange ways. I would get more details. For example, it might be looping. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #6 on Sun 27 Feb 2011 08:27 PM (UTC) |
Message
| Well I have this cron that runs:
#!/bin/bash
ps x > /tmp/ps.txt
grep "phantasia/bin/phantasia" /tmp/ps.txt > /dev/null
rc=$?
now=`date`
if [ $rc != "0" ]
then
nohup "phantasia/bin/phantasia" &
echo "$now - started phantasia server" >> ~/game.log
else
count=`grep "phantasia/bin/phantasia" /tmp/ps.txt | wc -l`
let count="$count - 2"
echo "$now - $count game(s) running" >> ~/game.log
# vmstat 10 3 >> game.log
# echo >> game.log
fi
rm /tmp/ps.txt
exit 0
Quote: Sun Feb 27 07:45:01 EST 2011 - 1 game(s) running
Sun Feb 27 08:00:01 EST 2011 - started phantasia server
Sun Feb 27 08:15:01 EST 2011 - started phantasia server
Sun Feb 27 08:30:01 EST 2011 - 1 game(s) running
So it is dying, I just have to figure out in what way. |
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.
20,692 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top