Crashes, most often when starting or finishing levels?

Found a bug in R'n'D? Report it here!

Moderators: Zomis, Flumminator

BryanFRitt
Posts: 77
Joined: Mon Nov 13, 2017 4:16 pm

Crashes, most often when starting or finishing levels?

Post by BryanFRitt » Tue Dec 17, 2019 9:01 pm

I'm often get crashes when playing Rocks and Diamonds. Most of the times it seams to be when finishing or starting a level?

rocksndiamonds --debug
crashes with
free(): double free detected in tcache 2
Aborted
OR
Segmentation fault
OR
corrupted double-linked list
Aborted
rocksndiamonds-4.1.3.0 compiled with

Code: Select all

make --debug
on KDE+Compiz Debian Stable

User avatar
Holger
Site Admin
Posts: 3268
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Crashes, most often when starting or finishing levels?

Post by Holger » Thu Dec 19, 2019 7:53 am

That's very strange -- I did not encounter such problems for a very long time (and if I did in the past, it was usually easy to debug and fix).

Some questions:

As you compiled the game by yourself using debug options, did you ever run it inside "gdb" to be able to get a stack trace dump when it crashes? Just type "bt" (for "backtrace") when it crashes inside gdb to get that stack trace.

Then, do you also get these crashes when using the pre-compiled binary from the tar.gz package?

Maybe there's indeed some hidden bug in the program that does not show up on my Linux system for whatever reason. (My Ubuntu system is a little bit outdated, so maybe more recent distributions have better error detection when it comes to memory handling.)

But I'm really surprised about this, as I regularly run R'n'D inside Valgrind to detect such memory problems... :-o

BryanFRitt
Posts: 77
Joined: Mon Nov 13, 2017 4:16 pm

Re: Crashes, most often when starting or finishing levels?

Post by BryanFRitt » Thu Dec 19, 2019 7:05 pm

I tried running `rocksndiamonds --debug` from gdb this time it froze after playing for a while. ALT+F4, and `kill -15 XXXXX`* didn't end the process, but `kill -9 XXXXX`* ended it.

* from CTRL+ALT+F2 terminal, CTRL+ALT+F7 to get back, XXXXX represents the PID of the rocksndiamonds process
[ops ... didn't do `bt` after crash/freeze, the first few are copy/paste of part of what was shown on screen.]
in playing the game...
Thread 1 "rocksndiamonds" received signal SIGSEGV, Segmentation fault.
deleteNodeFromList (node_first=0x55556a11d0e8, key=0x0,
destructor_function=0x5555557046a7 <FreeSnapshotBuffer>) at misc.c:2073
2073 if (strEqual((*node_first)->key, key))
and it froze again going back to main menu...
Thread 1 "rocksndiamonds" received signal SIGSEGV, Segmentation fault.
0x00005555556fda1a in FreeGadget (gi=0x55555fdae5a0) at gadgets.c:1334
1334 while (gi_previous != NULL && gi_previous->next != gi)
and it froze again going back to main menu...
munmap_chunk(): invalid pointer

Thread 1 "rocksndiamonds" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
this time when starting a level...
double free or corruption (out)

Thread 1 "rocksndiamonds" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
A `bt` after it frooze after going back to main menu...
Thread 1 "rocksndiamonds" received signal SIGSEGV, Segmentation fault.
0x00005555556fda1a in FreeGadget (gi=0x55555fdadb20) at gadgets.c:1334
1334 while (gi_previous != NULL && gi_previous->next != gi)
(gdb) bt
#0 0x00005555556fda1a in FreeGadget (gi=0x55555fdadb20) at gadgets.c:1334
#1 0x00005555556bc70d in FreeLevelEditorGadgets () at editor.c:7186
#2 0x000055555563848a in FreeGadgets () at init.c:155
#3 0x00005555556384b4 in InitGadgets () at init.c:167
#4 0x000055555565d311 in ChangeViewportPropertiesIfNeeded () at tools.c:9696
#5 0x0000555555682f44 in InitGame () at game.c:3374
#6 0x00005555556a6ea7 in StartGameActions (init_network_game=0,
record_tape=1, random_seed=0) at game.c:11330
#7 0x0000555555662557 in HandleMainMenu (mx=0, my=0, dx=0, dy=0, button=0)
at screens.c:2107
#8 0x0000555555648597 in HandleKey (key=13, key_status=1) at events.c:2272
#9 0x0000555555646b75 in HandleKeyEvent (event=0x7fffffffda10)
at events.c:1445
#10 0x0000555555644a98 in HandleEvents () at events.c:233
#11 0x0000555555644c6e in EventLoop () at events.c:328
#12 0x00005555556381aa in main (argc=2, argv=0x7fffffffdb68) at main.c:7762
Another freeze after going back to the main menu while playing. It went back to the main menu, but I don't think I hit buttons for it to do so... It didn't save this to 'HIGH SCORES' for the level, and the tape was bad on restarting rocksndiamonds
free(): invalid pointer

Thread 1 "rocksndiamonds" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff789e535 in __GI_abort () at abort.c:79
#2 0x00007ffff78f5508 in __libc_message (action=action@entry=do_abort,
fmt=fmt@entry=0x7ffff7a0028d "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3 0x00007ffff78fbc1a in malloc_printerr (str=str@entry=0x7ffff79fe43b "free(): invalid pointer")
at malloc.c:5341
#4 0x00007ffff78fd42c in _int_free (av=<optimized out>, p=<optimized out>,
have_lock=<optimized out>) at malloc.c:4165
#5 0x0000555555712553 in checked_free (ptr=0x55555f9916a0) at misc.c:1275
#6 0x0000555555711550 in setString (old_value=0x555558608050 <tape+16>,
new_value=0x55555c73a4c0 "rnd_martijn_mooij_iii") at misc.c:844
#7 0x00005555556eb9da in TapeErase () at tape.c:530
#8 0x00005555556ebb96 in TapeStartRecording (random_seed=1578851463) at tape.c:584
#9 0x00005555556a6e90 in StartGameActions (init_network_game=0, record_tape=1, random_seed=0)
at game.c:11320
#10 0x0000555555648375 in HandleKey (key=32, key_status=1) at events.c:2201
#11 0x0000555555646b75 in HandleKeyEvent (event=0x7fffffffda10) at events.c:1445
#12 0x0000555555644a98 in HandleEvents () at events.c:233
#13 0x0000555555644c6e in EventLoop () at events.c:328
#14 0x00005555556381aa in main (argc=2, argv=0x7fffffffdb68) at main.c:7762

BryanFRitt
Posts: 77
Joined: Mon Nov 13, 2017 4:16 pm

Re: Crashes, most often when starting or finishing levels?

Post by BryanFRitt » Thu Dec 19, 2019 9:57 pm

On the last one I noticed that the time went from 109 right to 130 when fast forwarding playback where it kills the character. Could this jump be used to determine where the tape gets messed up?

Note: Using 1920x1080 artwork theme for rocksndiamonds on a 3840x2160 display.

BryanFRitt
Posts: 77
Joined: Mon Nov 13, 2017 4:16 pm

Re: Crashes, most often when starting or finishing levels?

Post by BryanFRitt » Fri Dec 20, 2019 2:13 am

Could it be that rocksndiamonds is failing when my cpu clock gets throttled?
`dmesg` shows that cpu thorottled at about the same time that rocksndiamonds froze

Code: Select all

sudo dmesg -T
Package temperature above threshold, cpu clock throttled
double free or corruption (out)

Thread 1 "rocksndiamonds" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff789e535 in __GI_abort () at abort.c:79
#2 0x00007ffff78f5508 in __libc_message (action=action@entry=do_abort,
fmt=fmt@entry=0x7ffff7a0028d "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3 0x00007ffff78fbc1a in malloc_printerr (
str=str@entry=0x7ffff7a01ff8 "double free or corruption (out)")
at malloc.c:5341
#4 0x00007ffff78fd730 in _int_free (av=0x7ffff7a37c40 <main_arena>,
p=0x7ffff7a37ca0 <main_arena+96>, have_lock=<optimized out>)
at malloc.c:4306
#5 0x0000555555712553 in checked_free (ptr=0x7ffff7a37cb0 <main_arena+112>)
at misc.c:1275
#6 0x00005555557046f1 in FreeSnapshotBuffer (bi_raw=0x55555b335780)
at snapshot.c:72
#7 0x0000555555713a0a in deleteNodeFromList (node_first=0x7fffffffd778,
key=0x0, destructor_function=0x5555557046a7 <FreeSnapshotBuffer>)
at misc.c:2084
#8 0x0000555555704726 in FreeSnapshotBuffers (snapshot_buffers=0x55555b33b2b0)
at snapshot.c:79
#9 0x000055555570474a in FreeSnapshot (snapshot_buffers_ptr=0x55555b33afc0)
at snapshot.c:88
#10 0x0000555555713a0a in deleteNodeFromList (
node_first=0x5555575f7678 <snapshot_list>,
--Type <RET> for more, q to quit, c to continue without paging--c
UU", destructor_function=0x555555704732 <FreeSnapshot>) at misc.c:2084
#11 0x000055555570479c in FreeSnapshotList_UpToNode (node=0x0) at snapshot.c:107
#12 0x00005555557047f7 in FreeSnapshotList () at snapshot.c:120
#13 0x00005555556b2ab8 in FreeEngineSnapshotList () at game.c:15271
#14 0x00005555556b30ea in SaveEngineSnapshotToListInitial () at game.c:15418
#15 0x0000555555685528 in InitGame () at game.c:4253
#16 0x00005555556a6ea7 in StartGameActions (init_network_game=0, record_tape=1, random_seed=0) at game.c:11330
#17 0x0000555555662557 in HandleMainMenu (mx=0, my=0, dx=0, dy=0, button=0) at screens.c:2107
#18 0x0000555555648597 in HandleKey (key=13, key_status=1) at events.c:2272
#19 0x0000555555646b75 in HandleKeyEvent (event=0x7fffffffda10) at events.c:1445
#20 0x0000555555644a98 in HandleEvents () at events.c:233
#21 0x0000555555644c6e in EventLoop () at events.c:328
#22 0x00005555556381aa in main (argc=2, argv=0x7fffffffdb68) at main.c:7762

User avatar
Holger
Site Admin
Posts: 3268
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Crashes, most often when starting or finishing levels?

Post by Holger » Fri Dec 20, 2019 7:27 am

May it be possible that you are encountering memory problems here??

Two more questions:

- Do you also get these crashes when using the pre-compiled binary from the tar.gz package?
- Are you able to reproduce these problems on a second system?

I'm really a bit baffled here, as I haven't had such a crash for years during "usual" use of the game, but that doesn't have to mean much, as I probably "use" the game quite differently when compared to the "average user"... :-/

BryanFRitt
Posts: 77
Joined: Mon Nov 13, 2017 4:16 pm

Re: Crashes, most often when starting or finishing levels?

Post by BryanFRitt » Sat Dec 21, 2019 2:38 am

Do you also get these crashes when using the pre-compiled binary from the tar.gz package?
Just tried it, and after awhile of playing it froze like before
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe566d700 (LWP 858)]
[New Thread 0x7fffe4e6c700 (LWP 859)]
[New Thread 0x7fffce706700 (LWP 860)]
corrupted size vs. prev_size in fastbins

Thread 1 "rocksndiamonds" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff70aa535 in __GI_abort () at abort.c:79
#2 0x00007ffff7101508 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff720c28d "%s\n")
at ../sysdeps/posix/libc_fatal.c:181
#3 0x00007ffff7107c1a in malloc_printerr (str=str@entry=0x7ffff720db98 "corrupted size vs. prev_size in fastbins")
at malloc.c:5341
#4 0x00007ffff7107e84 in malloc_consolidate (av=av@entry=0x7ffff7243c40 <main_arena>) at malloc.c:4487
#5 0x00007ffff710aa58 in _int_malloc (av=av@entry=0x7ffff7243c40 <main_arena>, bytes=bytes@entry=4096) at malloc.c:3695
#6 0x00007ffff710c56a in __GI___libc_malloc (bytes=4096) at malloc.c:3057
#7 0x00007ffff70f771c in __GI__IO_file_doallocate (fp=0x3a4b4f0) at filedoalloc.c:101
#8 0x00007ffff7105700 in __GI__IO_doallocbuf (fp=fp@entry=0x3a4b4f0) at libioP.h:839
#9 0x00007ffff7104988 in _IO_new_file_overflow (f=0x3a4b4f0, ch=-1) at fileops.c:752
#10 0x00007ffff7103a8f in _IO_new_file_xsputn (n=2, data=<optimized out>, f=0x3a4b4f0) at libioP.h:839
#11 _IO_new_file_xsputn (f=0x3a4b4f0, data=<optimized out>, n=2) at fileops.c:1204
#12 0x00007ffff70d81fb in _IO_vfprintf_internal (s=s@entry=0x3a4b4f0, format=0x591589 "%s", ap=ap@entry=0x7fffffffd520)
at ../libio/libioP.h:839
#13 0x00007ffff7190536 in ___fprintf_chk (fp=0x3a4b4f0, flag=1, format=<optimized out>) at fprintf_chk.c:35
#14 0x00000000004f79e7 in ?? ()
#15 0x00000000004f5274 in ?? ()
#16 0x000000000046f9bc in ?? ()
#17 0x000000000044bab3 in ?? ()
#18 0x0000000000414508 in ?? ()
#19 0x0000000000404e66 in ?? ()
#20 0x00007ffff70ac09b in __libc_start_main (main=0x404d20, argc=1, argv=0x7fffffffdb68, init=<optimized out>,
fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdb58) at ../csu/libc-start.c:308
#21 0x0000000000404c59 in ?? ()
#22 0x00007fffffffdb58 in ?? ()
#23 0x000000000000001c in ?? ()
#24 0x0000000000000001 in ?? ()
#25 0x00007fffffffdf2c in ?? ()
#26 0x0000000000000000 in ?? ()
May it be possible that you are encountering memory problems here?
I ran the computer's built in memory check, and it didn't find any memory errors.
Are you able to reproduce these problems on a second system?
Just tried this on my old computer which also has Debian 10 stable, and the same version of rocksndiamonds. 4.1.3.0. I don't remember this happening on my old computer, and I couldn't get it to do these errors to show up on my old computer when I tried.
So I guess it's something on my current system that's messed up? It's probably still under warranty, but if I get the same computer model as a replacement, it might end up having the exact same problem.

filbo
Posts: 374
Joined: Fri Jun 20, 2014 10:06 am

Re: Crashes, most often when starting or finishing levels?

Post by filbo » Tue Dec 31, 2019 10:12 am

That really sounds like bad memory, or memory being run faster than it can really handle.

Memory testing is a tricky business. It isn't possible for a memory tester to test every possible access pattern.

If the machine has more than 1 memory stick, try temporarily removing one; test; swap in the other; etc. If it happens with each individual memory stick, return the machine, otherwise get the bad stick replaced.

And if you have any sort of overclocking turned on, turn it off and retest...

BryanFRitt
Posts: 77
Joined: Mon Nov 13, 2017 4:16 pm

Re: Crashes, most often when starting or finishing levels?

Post by BryanFRitt » Tue Dec 31, 2019 11:26 pm

No overclocking ever done on this system. Everything should be at default speed. It's a laptop with "Intel(R) Core(TM) i7-8750H CPU".

filbo
Posts: 374
Joined: Fri Jun 20, 2014 10:06 am

Re: Crashes, most often when starting or finishing levels?

Post by filbo » Wed Jan 01, 2020 2:09 am

Well, see if the BIOS offers some sort of underclocking, see if it's stable that way. And again, if it has >1 memory stick, cycle through them. Otherwise see if you can borrow a compatible memory stick to swap in. If the memory's soldered then return the machine. It's broken.

Your worry that the next one of the same model will have the same problem -- is unwarranted. This is not a normal problem, it's a sick hardware unit (not design).

filbo
Posts: 374
Joined: Fri Jun 20, 2014 10:06 am

Re: Crashes, most often when starting or finishing levels?

Post by filbo » Wed Jan 01, 2020 2:10 am

(I don't mean to offer underclocking as a solution, just a diagnostic. If it's stable underclocked, it proves some hardware stability problem in the system, and you should feel 100% confident returning it under warranty.)

BryanFRitt
Posts: 77
Joined: Mon Nov 13, 2017 4:16 pm

Re: Crashes, most often when starting or finishing levels?

Post by BryanFRitt » Thu Jan 02, 2020 5:04 pm

filbo wrote:
Wed Jan 01, 2020 2:10 am
(I don't mean to offer underclocking as a solution, just a diagnostic. If it's stable underclocked, it proves some hardware stability problem in the system, and you should feel 100% confident returning it under warranty.)
I ran `sudo cpupower frequency-set -u 3000MHz`* and it seams to fix the random in game crashes.[or it was just luck?] However when finishing a level it still crashes.[randomly?]
UPDATE: It just froze when I started a level, and later on near the beginning of a level, so I guess this didn't fix it. :(

*(This sets the maximum [turbo] speed that the CPU can run, and was at 4100MHz for this i7-8750H
`sudo cpupower frequency-info`)

backtrace when finishing level crash...
double free or corruption (out)

Thread 1 "rocksndiamonds" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff789f535 in __GI_abort () at abort.c:79
#2 0x00007ffff78f6508 in __libc_message (action=action@entry=do_abort,
fmt=fmt@entry=0x7ffff7a0128d "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3 0x00007ffff78fcc1a in malloc_printerr (
str=str@entry=0x7ffff7a02ff8 "double free or corruption (out)")
at malloc.c:5341
#4 0x00007ffff78fe730 in _int_free (av=0x7ffff7a38c40 <main_arena>,
p=0x55555c1880c0, have_lock=<optimized out>) at malloc.c:4306
#5 0x0000555555712553 in checked_free (ptr=0x55555c1880d0) at misc.c:1275
#6 0x0000555555711550 in setString (old_value=0x555558608050 <tape+16>,
new_value=0x55555c72daf0 "rnd_martijn_mooij_iii") at misc.c:844
#7 0x00005555556eb9da in TapeErase () at tape.c:530
#8 0x0000555555686934 in GameEnd () at game.c:4773
#9 0x0000555555686832 in GameWon () at game.c:4720
#10 0x00005555556a6fd2 in GameActionsExt () at game.c:11369
#11 0x00005555556a769a in GameActions () at game.c:11623
#12 0x000055555567a3b5 in HandleGameActions () at screens.c:8274
#13 0x0000555555644c8a in EventLoop () at events.c:339
#14 0x00005555556381aa in main (argc=1, argv=0x7fffffffdb88) at main.c:7762
backtrace when starting level crash...
corrupted double-linked list

#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff789f535 in __GI_abort () at abort.c:79
#2 0x00007ffff78f6508 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff7a0128d "%s\n")
at ../sysdeps/posix/libc_fatal.c:181
#3 0x00007ffff78fcc1a in malloc_printerr (str=str@entry=0x7ffff79ff393 "corrupted double-linked list") at malloc.c:5341
#4 0x00007ffff78fce64 in malloc_consolidate (av=av@entry=0x7ffff7a38c40 <main_arena>) at malloc.c:4488
#5 0x00007ffff78fe79a in _int_free (av=0x7ffff7a38c40 <main_arena>, p=0x55557cb42660, have_lock=<optimized out>) at malloc.c:4392
#6 0x0000555555712553 in checked_free (ptr=0x55557d99fba0) at misc.c:1275
#7 0x00005555557046f1 in FreeSnapshotBuffer (bi_raw=0x55555b0564e0) at snapshot.c:72
#8 0x0000555555713a0a in deleteNodeFromList (node_first=0x7fffffffd7d8, key=0x0,
destructor_function=0x5555557046a7 <FreeSnapshotBuffer>) at misc.c:2084
#9 0x0000555555704726 in FreeSnapshotBuffers (snapshot_buffers=0x55555c9130a0) at snapshot.c:79
#10 0x000055555570474a in FreeSnapshot (snapshot_buffers_ptr=0x555583309530) at snapshot.c:88
#11 0x0000555555713a0a in deleteNodeFromList (node_first=0x5555575f7678 <snapshot_list>, key=0x55555ec93eb0 "\200\234\313^UU",
destructor_function=0x555555704732 <FreeSnapshot>) at misc.c:2084
#12 0x000055555570479c in FreeSnapshotList_UpToNode (node=0x0) at snapshot.c:107
#13 0x00005555557047f7 in FreeSnapshotList () at snapshot.c:120
#14 0x00005555556b2ab8 in FreeEngineSnapshotList () at game.c:15271
#15 0x00005555556b30ea in SaveEngineSnapshotToListInitial () at game.c:15418
#16 0x0000555555685528 in InitGame () at game.c:4253
#17 0x00005555556ec208 in TapeStartGamePlaying () at tape.c:805
#18 0x00005555556ec8ad in TapeQuickLoad () at tape.c:1073
#19 0x00005555556483b2 in HandleKey (key=1073741883, key_status=1) at events.c:2211
#20 0x0000555555646b75 in HandleKeyEvent (event=0x7fffffffda30) at events.c:1445
#21 0x0000555555644a98 in HandleEvents () at events.c:233
#22 0x0000555555644c6e in EventLoop () at events.c:328
#23 0x00005555556381aa in main (argc=1, argv=0x7fffffffdb88) at main.c:7762
another crash when starting a level... after doing `sudo cpupower frequency-set -u 3000MHz` and also having an external fan cooling laptop down...
free(): double free detected in tcache 2

Thread 1 "rocksndiamonds" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff789f535 in __GI_abort () at abort.c:79
#2 0x00007ffff78f6508 in __libc_message (action=action@entry=do_abort,
fmt=fmt@entry=0x7ffff7a0128d "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3 0x00007ffff78fcc1a in malloc_printerr (
str=str@entry=0x7ffff7a02f58 "free(): double free detected in tcache 2")
at malloc.c:5341
#4 0x00007ffff78fe6fd in _int_free (av=0x7ffff7a38c40 <main_arena>,
p=0x555559a271d0, have_lock=<optimized out>) at malloc.c:4193
#5 0x0000555555712553 in checked_free (ptr=0x555559a271e0) at misc.c:1275
#6 0x00005555557046f1 in FreeSnapshotBuffer (bi_raw=0x55556bddde90)
at snapshot.c:72
#7 0x0000555555713a0a in deleteNodeFromList (node_first=0x7fffffffd7d8,
key=0x0, destructor_function=0x5555557046a7 <FreeSnapshotBuffer>)
at misc.c:2084
#8 0x0000555555704726 in FreeSnapshotBuffers (snapshot_buffers=0x555559a33040)
at snapshot.c:79
#9 0x000055555570474a in FreeSnapshot (snapshot_buffers_ptr=0x555559a82c20)
at snapshot.c:88
#10 0x0000555555713a0a in deleteNodeFromList (
node_first=0x5555575f7678 <snapshot_list>,
key=0x555559a13820 "\220=\240YUU",
destructor_function=0x555555704732 <FreeSnapshot>) at misc.c:2084
--Type <RET> for more, q to quit, c to continue without paging--c
#11 0x000055555570479c in FreeSnapshotList_UpToNode (node=0x0) at snapshot.c:107
#12 0x00005555557047f7 in FreeSnapshotList () at snapshot.c:120
#13 0x00005555556b2ab8 in FreeEngineSnapshotList () at game.c:15271
#14 0x00005555556b30ea in SaveEngineSnapshotToListInitial () at game.c:15418
#15 0x0000555555685528 in InitGame () at game.c:4253
#16 0x00005555556ec208 in TapeStartGamePlaying () at tape.c:805
#17 0x00005555556ec8ad in TapeQuickLoad () at tape.c:1073
#18 0x00005555556483b2 in HandleKey (key=1073741883, key_status=1) at events.c:2211
#19 0x0000555555646b75 in HandleKeyEvent (event=0x7fffffffda30) at events.c:1445
#20 0x0000555555644a98 in HandleEvents () at events.c:233
#21 0x0000555555644c6e in EventLoop () at events.c:328
#22 0x00005555556381aa in main (argc=1, argv=0x7fffffffdb88) at main.c:7762

BryanFRitt
Posts: 77
Joined: Mon Nov 13, 2017 4:16 pm

Re: Crashes, most often when starting or finishing levels?

Post by BryanFRitt » Fri Jan 03, 2020 5:42 pm

Here's another backtrace when it went back to the main menu. This time did a `sudo cpupower frequency-set -u 2200MHz`(effectively no 'turbo' boost at all now), and had external fan running to cool laptop down.

I have a feeling these are related to the 'tape' system being bad.
free(): double free detected in tcache 2
Thread 1 "rocksndiamonds" received signal SIGABRT, Aborted.
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff789f535 in __GI_abort () at abort.c:79
#2 0x00007ffff78f6508 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff7a0128d "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3 0x00007ffff78fcc1a in malloc_printerr (str=str@entry=0x7ffff7a02f58 "free(): double free detected in tcache 2") at malloc.c:5341
#4 0x00007ffff78fe6fd in _int_free (av=0x7ffff7a38c40 <main_arena>, p=0x555559a60af0, have_lock=<optimized out>) at malloc.c:4193
#5 0x0000555555712553 in checked_free (ptr=0x555559a60b00) at misc.c:1275
#6 0x0000555555711550 in setString (old_value=0x555558608050 <tape+16>, new_value=0x55555c72d570 "rnd_martijn_mooij_iii") at misc.c:844
#7 0x00005555556eb9da in TapeErase () at tape.c:530
#8 0x00005555556611df in HandleMainMenu_SelectLevel (step=1, direction=-1, selected_level_nr=-1) at screens.c:1922
#9 0x00005555556620a9 in HandleMainMenu (mx=0, my=0, dx=-1, dy=0, button=1) at screens.c:2029
#10 0x0000555555648fa8 in HandleJoystick () at events.c:2559
#11 0x0000555555648123 in HandleKey (key=1073741904, key_status=1) at events.c:2113
#12 0x0000555555646b75 in HandleKeyEvent (event=0x7fffffffda30) at events.c:1445
#13 0x0000555555644a98 in HandleEvents () at events.c:233
#14 0x0000555555644c6e in EventLoop () at events.c:328
#15 0x00005555556381aa in main (argc=1, argv=0x7fffffffdb88) at main.c:7762

BryanFRitt
Posts: 77
Joined: Mon Nov 13, 2017 4:16 pm

Re: Crashes, most often when starting or finishing levels?

Post by BryanFRitt » Fri Jan 03, 2020 9:26 pm

Would adding more backtraces here help? KDE System monitor say CPU is less than 70C. I've read that this CPU can handle up to 100C.
double free or corruption (!prev)

Thread 1 "rocksndiamonds" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff789f535 in __GI_abort () at abort.c:79
#2 0x00007ffff78f6508 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff7a0128d "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3 0x00007ffff78fcc1a in malloc_printerr (str=str@entry=0x7ffff7a03018 "double free or corruption (!prev)") at malloc.c:5341
#4 0x00007ffff78fe73c in _int_free (av=0x7ffff7a38c40 <main_arena>, p=0x555569810db0, have_lock=<optimized out>) at malloc.c:4309
#5 0x0000555555712553 in checked_free (ptr=0x555569810dc0) at misc.c:1275
#6 0x0000555555711550 in setString (old_value=0x555558608050 <tape+16>, new_value=0x55555c72c980 "rnd_martijn_mooij_ii") at misc.c:844
#7 0x00005555556eb9da in TapeErase () at tape.c:530
#8 0x00005555556ebb96 in TapeStartRecording (random_seed=1581548454) at tape.c:584
#9 0x00005555556a6e90 in StartGameActions (init_network_game=0, record_tape=1, random_seed=0) at game.c:11320
#10 0x0000555555662557 in HandleMainMenu (mx=0, my=0, dx=0, dy=0, button=0) at screens.c:2107
#11 0x0000555555648597 in HandleKey (key=13, key_status=1) at events.c:2272
#12 0x0000555555646b75 in HandleKeyEvent (event=0x7fffffffda30) at events.c:1445
#13 0x0000555555644a98 in HandleEvents () at events.c:233
#14 0x0000555555644c6e in EventLoop () at events.c:328
#15 0x00005555556381aa in main (argc=1, argv=0x7fffffffdb88) at main.c:7762

User avatar
Holger
Site Admin
Posts: 3268
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Crashes, most often when starting or finishing levels?

Post by Holger » Fri Jan 03, 2020 11:19 pm

Thank you for you crash reports and backtraces so far!

Unfortunately, I still have no clue why this happens so frequently to you. :-(
Would adding more backtraces here help?
No, I think they are all quite similar in that they almost all crash in "free()" (which is always the last code path inside R'n'D, in function "checked_free()").
I have a feeling these are related to the 'tape' system being bad.
Hmmm... something that seems to stand out from your backtraces is that there's often occurences of "FreeSnapshot()" / "FreeSnapshotBuffers()" / "FreeSnapshotBuffer()" to be seen... :-/

Maybe there's something bad in there; this code is not very well tested, I think, as it is disabled by default.

So there's the question: Do you have "game engine snapshot mode" (unter "setup" -> "game & menu") set to anything other than "off"?

It may well be possible that I did my Valgrind memory testing with "game engine snapshot mode" disabled, so maybe there is some memory corruption in there.

I will also do another Valgrind test with this functionality enabled... :-/

Post Reply