• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
polyfrag

Linux server process crashing after ~8 hours

9 posts in this topic

I have a server program I made on my linux server that runs for 8 hours and then crashes overnight. I need it to run constantly.

 

How do I find out what is causing the crash?

 

It's keeping an ODBC MySQL connection open and checks for UDP packets on port 19023 using recvfrom.

0

Share this post


Link to post
Share on other sites
What SiCrane said. If it does not leave a core dump, learn how to run it so it does. You can also run your server from gdb, or attach gdb to the running program before it crashes.

Besides that, check if the process is growing in size, which would mean you have a memory leak of some sort.
2

Share this post


Link to post
Share on other sites

Like the others said your best bet is to get a core dump file for the application.  You can then step through the core dumb with gdb to find where your crash is happening.  Since it is a 8hr run odds are you have a memory leak somewhere as if it was a null pointer being accessed it would probably crash much much sooner.  Read the man pages for core as it will explain how you use it if you are not getting actual core dumps.  The general gist of coredumps is you can set a dumpfile and start your daemon and when it crashes it will write the report to that file.  Sadly it is really the only way on linux to solve the problem besides invoking the daemon attached to GDB.

 

There is actually another option besides the above but I don't know how useful it will be for this situation.  The command is called strace.

 

You can run strace -o /path/to/output.txt /path/to/daemon

 

The command will log everything that application does including the crash.  It would give you reason for the crash but not the exact execution point of the crash.

1

Share this post


Link to post
Share on other sites
Since it crashes over time, it does indeed sound like a slow memory leak.

My suggestion is to compile everything with '-g' (in GCC) to add debugging symbols.

Then run it in "valgrind --tool=memcheck" (Which you should really do before the output leaves the development machine anyway).

This should then tell you all allocations that are not subsequently deallocated so you should be able to pinpoint the issue pretty easily. Edited by Karsten_
1

Share this post


Link to post
Share on other sites

It just crashed with valgrind and it didn't say there were any memory leaks.

 

It seems it crashes whenever my open SSH session gets closed by me closing the laptop or leaving it on until it goes to sleep.

 

I thought I had turned on core dump following these instructions

 

http://www.cyberciti.biz/tips/linux-core-dumps.html

 

but I don't see anything in /tmp.

So to run it under gdb I type in
 

gdb myProgram
run


But since I'm doing this remotely from an SSH shell I need it to fork the process and output to a file. How do I do that? I need it to continue running after I end the SSH session.

I can't just do

 

 

gdb myProgram &


because I need to type in "run" to gdb.

Edited by polyfrag
0

Share this post


Link to post
Share on other sites

Oh, that's it. whenever I close the SSH session it crashes.

 

I thought it was enough to add "&" to fork the process.

 

How do I get it to continue running after I quit SSH?

0

Share this post


Link to post
Share on other sites

Even though you found a solution, you might want to look into either tmux or [gnu]screen. They are basically terminal multiplexers that allow you to keep your session alive when you disconnect and then you can reattach to your previous session again by typing e.g "tmux attach".

Very handy, especially if you develop the software itself on a remote server.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0