Crashes to crashes

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Henk
Posts: 7220
Joined: Mon May 27, 2013 10:31 am

Crashes to crashes

Post by Henk »

Skipper crashed two times in last three days. Unfortunately it is difficult to reproduce for I already played a few tournaments and no crash happened.

Any (quick) methods to fix this ?

[I decided to test perft first. For instance compute Kiwipete(5). But no crash of course.]
Henk
Posts: 7220
Joined: Mon May 27, 2013 10:31 am

Re: Crashes to crashes

Post by Henk »

Ok, I already have found some statements that should go wrong. So probably might be solved but it wil take another week to find out if bug is gone.
abulmo
Posts: 151
Joined: Thu Nov 12, 2009 6:31 pm

Re: Crashes to crashes

Post by abulmo »

Henk wrote:Any (quick) methods to fix this ?
Use a debugger.
Richard
User avatar
hgm
Posts: 27815
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Crashes to crashes

Post by hgm »

Henk wrote:Skipper crashed two times in last three days. Unfortunately it is difficult to reproduce for I already played a few tournaments and no crash happened.

Any (quick) methods to fix this ?

[I decided to test perft first. For instance compute Kiwipete(5). But no crash of course.]
Clear the hash table before every move. Then the search should be completely reproducible. So you just wait for a crash, and then debug on the position where the crash happened.
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: Crashes to crashes

Post by Michael Sherwin »

abulmo wrote:
Henk wrote:Any (quick) methods to fix this ?
Use a debugger.
I have MSVS 2005 and in debug mode RomiChess crashes. In fully optimised release mode it runs just fine! lol
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through
Daniel Anulliero
Posts: 759
Joined: Fri Jan 04, 2013 4:55 pm
Location: Nice

Re: Crashes to crashes

Post by Daniel Anulliero »

Henk wrote:Skipper crashed two times in last three days. Unfortunately it is difficult to reproduce for I already played a few tournaments and no crash happened.

Any (quick) methods to fix this ?

[I decided to test perft first. For instance compute Kiwipete(5). But no crash of course.]
Crashes to crashes ...
Mmm sure is a tribute to David Bowie ..😢
abulmo
Posts: 151
Joined: Thu Nov 12, 2009 6:31 pm

Re: Crashes to crashes

Post by abulmo »

Michael Sherwin wrote:I have MSVS 2005 and in debug mode RomiChess crashes.
Then you can fix the problem...
Michael Sherwin wrote:In fully optimised release mode it runs just fine! lol
More likely, it runs just accidentally.

It is more problematic when it is the other way around, the program runs fine in debug mode, but crashes in release mode.

Personally, I develop mostly under Linux, only rarely using a debug mode, but just keeping some debugging information into the fully optimized version of my software. I set my environment up so that it produces a core file when a crash happens. So when, a rare crash occurs, I feed up the debugger with the core file, and can get an idea of the cause of the crash.
Richard
flok

Re: Crashes to crashes

Post by flok »

Henk wrote:Skipper crashed two times in last three days. Unfortunately it is difficult to reproduce for I already played a few tournaments and no crash happened.

Any (quick) methods to fix this ?

[I decided to test perft first. For instance compute Kiwipete(5). But no crash of course.]
Simple: look in the log of svn/git at what revision things worked fine and then do a bisect (yes you can also bisect with svn) until you'll find the bug.
Or just look at the diffs, then it is most of the time rather obvious which change introduced the bug.
Dann Corbit
Posts: 12542
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Crashes to crashes

Post by Dann Corbit »

On windows (assuming the Microsoft compiler), you can create a crash dump easily enough.

Then, you load the crash dump in your debugger and it will take you right to the offending line.

_set_abort_behavior() is useful if you recognize the problem yourself via abort {e.g. malloc() failure}.

For everything else, install a structured exception handler.
Then install a minidump handler like this:
https://msdn.microsoft.com/en-us/library/ms680360.aspx

If you catch it in the crash, then you can also make them this way:
https://support.microsoft.com/en-us/kb/931673
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Crashes to crashes

Post by bob »

hgm wrote:
Henk wrote:Skipper crashed two times in last three days. Unfortunately it is difficult to reproduce for I already played a few tournaments and no crash happened.

Any (quick) methods to fix this ?

[I decided to test perft first. For instance compute Kiwipete(5). But no crash of course.]
Clear the hash table before every move. Then the search should be completely reproducible. So you just wait for a crash, and then debug on the position where the crash happened.
That's not always good enough. History counters. Killer moves. Counter moves. etc all have an effect on move ordering, and hence GHI type problems.. Not to mention different moves will get reduced differently depending on where they appear in the move list.