Use "frame 5" to inspect what is going on in game_ended().hgm wrote:(gdb) where
#0 0xf7767430 in __kernel_vsyscall ()
#1 0xf7673e33 in waitpid () from /lib32/libc.so.6
#2 0xf7610b83 in ?? () from /lib32/libc.so.6
#3 0x0804936e in segv_handler (sig=11) at ficsmain.c:177
#4 <signal handler called>
#5 0xf7574bf3 in game_ended (g=4, winner=128, why=0) at gameproc.c:349
#6 0xf7576ef0 in process_move (p=7, command=0xffa9c6d7 "b2d2")
at gameproc.c:783
#7 0xf756092a in process_prompt (command=0xffa9c6d7 "b2d2", p=<optimized out>)
at command.c:733
#8 process_input (fd=15, com_string=0xffa9c6d7 "b2d2") at command.c:818
#9 0xf75845f8 in select_loop () at network.c:605
#10 0x080491d2 in main_event_loop () at ficsmain.c:90
#11 main (argc=3, argv=0xffa9cc44) at ficsmain.c:232
(gdb)
[/code]
So it seems the ICS is crashing in game_ended(4, BLACK, 0).
Now what? How can I find out what statement in this routine caused the crash? I have no experience in using gdb.
Help request for debugging ICS
Moderators: hgm, Rebel, chrisw
-
- Posts: 5563
- Joined: Tue Feb 28, 2012 11:56 pm
Re: Help request for debugging ICS
-
- Posts: 5563
- Joined: Tue Feb 28, 2012 11:56 pm
Re: Help request for debugging ICS
Any chance you upgraded the compiler?hgm wrote:After many months of flawless running, the ICS on which I organize the monthly blitz tournaments suddenly became crash prone in October, and now typically crashes within the hour. Nothing was changed, neither in the ICS nor in the OS of the VPS it is running on.
-
- Posts: 27796
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Help request for debugging ICS
Not unless the provider of the VPS upgraded it. But I don't think they do such things. I never upgraded anything, as previous experiences had learned that after upgrading the OS or compiling tools I usually would not be able to compile the ICS code anymore. All repositories for this Linux version were dead anyway, so there was not much to upgrade (until Tony Soares dug up a new repository for me, above). And even if the compiler would have been upgraded, I had no reason to recompile the ICS before the crashing mania suddenly set in.
But the code section printed in gdb above seams dead wrong. 'gl' is supposed the player number of the bughouse partner, where -1 means 'invalid' (i.e. not bughouse). So it seems the if statement should actually have been "if(gl != -1)", to indicate bughouse (as the comment suggests it must).
I have no clue how code this faulty could have ever worked...
I have started a new tourney now, with the test reversed. If it doesn't crash now, I have good hopes that we solved the cause.
But the code section printed in gdb above seams dead wrong. 'gl' is supposed the player number of the bughouse partner, where -1 means 'invalid' (i.e. not bughouse). So it seems the if statement should actually have been "if(gl != -1)", to indicate bughouse (as the comment suggests it must).
I have no clue how code this faulty could have ever worked...
I have started a new tourney now, with the test reversed. If it doesn't crash now, I have good hopes that we solved the cause.
-
- Posts: 27796
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Help request for debugging ICS
The "frame 5" indeed fingers the same line:
Not sure what this "dwarf expression" stuff is supposed to mean. It did not have any trouble telling the values of the arguments 'g' and 'why' of game_ended in the stack trace.
Anyway, the test tourney is still running, and started its 5th round (with 12 participants).
Code: Select all
(gdb) frame 5
#5 0xf7574bf3 in game_ended (
g=<error reading variable: Unhandled dwarf expression opcode 0x0>,
flags2=<optimized out>,
why=<error reading variable: Unhandled dwarf expression opcode 0x0>)
at gameproc.c:349
349 if (((player_globals.parray[game_globals.garray[gl].white].b_stats.rating <= pp->availmax) && (player_globals.parray[game_globals.garray[gl].white].b_stats.rating >= pp->availmin)) || (!pp->availmax)) {
(gdb) p gl
$2 = -1
(gdb) p g
Unhandled dwarf expression opcode 0x0
Anyway, the test tourney is still running, and started its 5th round (with 12 participants).
-
- Posts: 27796
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Help request for debugging ICS
Six rounds completed without crashing. I am really getting my hopes up that this fixes it.
Everyone is invited for a bigger test tourney tonight 9:00 pm Amsterdam time (3:00 pm Boston time)!
Everyone is invited for a bigger test tourney tonight 9:00 pm Amsterdam time (3:00 pm Boston time)!
-
- Posts: 3547
- Joined: Thu Jun 07, 2012 11:02 pm
Re: Help request for debugging ICS
I'll log an engine on that you can include.hgm wrote: Everyone is invited for a bigger test tourney tonight 9:00 pm Amsterdam time (3:00 pm Boston time)!
-
- Posts: 4366
- Joined: Fri Mar 10, 2006 5:23 am
- Location: http://www.arasanchess.org
Re: Help request for debugging ICS
Still might be a good idea to run it through valgrind, as Volker suggested. I am pretty sure the original authors didn't do this and there may be other suspect code it can help find.
--Jon
--Jon
-
- Posts: 570
- Joined: Mon Jul 20, 2015 5:06 pm
Re: Help request for debugging ICS
Is there a build for Valgrind executables available?jdart wrote:Still might be a good idea to run it through valgrind, as Volker suggested. I am pretty sure the original authors didn't do this and there may be other suspect code it can help find.
--Jon
-
- Posts: 5563
- Joined: Tue Feb 28, 2012 11:56 pm
Re: Help request for debugging ICS
Perhaps debugging information that your gdb cannot handle. Just compile with -g.hgm wrote:The "frame 5" indeed fingers the same line:Not sure what this "dwarf expression" stuff is supposed to mean.Code: Select all
(gdb) frame 5 #5 0xf7574bf3 in game_ended ( g=<error reading variable: Unhandled dwarf expression opcode 0x0>, flags2=<optimized out>, why=<error reading variable: Unhandled dwarf expression opcode 0x0>) at gameproc.c:349 349 if (((player_globals.parray[game_globals.garray[gl].white].b_stats.rating <= pp->availmax) && (player_globals.parray[game_globals.garray[gl].white].b_stats.rating >= pp->availmin)) || (!pp->availmax)) { (gdb) p gl $2 = -1 (gdb) p g Unhandled dwarf expression opcode 0x0
-
- Posts: 27796
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Help request for debugging ICS
It was compiled with -g .