[chuck-users] figuring out what causes a crash

Spencer Salazar ssalazar at CS.Princeton.EDU
Sat Dec 2 19:47:51 EST 2006

Hi Atte,
First off, I think the fact that chuck code can crash chuck is  
chuck's fault, not yours :)

Probably the best thing to find out what is causing a crash is a  
debugger.  Running chuck in a debugger (such as gdb, the popular GNU  
debugger) will generally cause it to freeze execution at the exact  
moment of the crash, letting you poke around the running program and  
investigate why the crash is occurring.  Sometimes a simple backtrace  
from gdb is enough to determine what is causing a crash and even  
suggest a fix, but there is more sophisticated functionality for  
debugging more subtle bugs.

For maximum debugging power, you may wish to compile a chuck  
executable with extra debug information and no compiler  
optimization.  Setting CHUCK_DEBUG=1 in your shell and doing a clean  
recompile is one way to produce such an executable.  (This typically  
causes a noticeable reduction in chuck performance though, so you  
might want to keep a non-debug executable around for when performance  

Ive heard that Valgrind is a very good alternative to GDB but I have  
no experience with it; that may be something to try also.

In any case, please feel free to post bug reports/stack traces/bug  
producing code to the list or to send it to the chuck team.


On Dec 2, 2006, at 12:02 AM, Atte André Jensen wrote:

> Hi
> While playing with my setup tonight chuck crashed (seg fault) on me a
> couple of times, and I'm very interested in finding out why.  
> Instead of
> crawling through my 18000+ lines of chuck code I'd like chuck to be a
> little more outspoken when it crashes. Now it just gives me the line
> where I call chuck from a bash startup script. I tried the verbose
> setting, and although I haven't made it crash yet, I don't really need
> all the debugging info when running, so I suspect I'm looking for
> something slightly different.
> Is there anything I can do (a hack in the source, a switch I should  
> try,
> any suggestions) to investigate a bit further?
> BTW: I'm pretty sure it's my code and not chuck that's to blame,
> although one must never say never:-)
> -- 
> peace, love & harmony
> Atte
> http://www.atte.dk      | quintet:      http://www.anagrammer.dk
>                          | compositions: http://www.atte.dk/ 
> compositions
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users

More information about the chuck-users mailing list