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

Gammon Forum

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

[Folder]  Entire forum
-> [Folder]  Programming
. -> [Folder]  General
. . -> [Subject]  Core dumps
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Core dumps

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


Posted by Zeno   USA  (2,871 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (21,321 posts)  [Biography] 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
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] 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
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] 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
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (21,321 posts)  [Biography] 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
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] 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
[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.


5,116 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]