Francesco149 / cubecalc-ui

MapleStory average cubing cost calculator (UI version)
The Unlicense
0 stars 0 forks source link

random crashes when switching presets on desktop build #3

Open Francesco149 opened 2 years ago

Francesco149 commented 2 years ago

somewhat reliable way to repro

I can't reproduce on browser.

I think it might be a bug with nuklear. either that or memory corruption somewhere when loading presets that only happens on desktop.

basically the y_offset pointer in nk_group_scrolled_offset_begin is NULL (but not x_offset?)

compilation-units/../thirdparty/nuklear.h:22651:25: runtime error: load of null pointer of type 'nk_uint' (aka 'unsigned int')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior compilation-units/../thirdparty/nuklear.h:22651:25 in 
AddressSanitizer:DEADLYSIGNAL
=================================================================
==3669821==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x0000005205e9 bp 0x7ffe9a4e7990 sp 0x7ffe9a4e7380 T0)
==3669821==The signal is caused by a READ memory access.
==3669821==Hint: address points to the zero page.
    #0 0x5205e9 in nk_group_scrolled_offset_begin /home/loli/src/cubecalc-ui/src/compilation-units/../thirdparty/nuklear.h:22651
    #1 0x527705 in nk_group_begin_titled /home/loli/src/cubecalc-ui/src/compilation-units/../thirdparty/nuklear.h:22776
    #2 0x306c36 in nk_group_begin /home/loli/src/cubecalc-ui/src/compilation-units/../thirdparty/nuklear.h:22781
    #3 0x303d16 in uiBeginNode /home/loli/src/cubecalc-ui/src/compilation-units/../main.c:332
    #4 0x31970d in loop /home/loli/src/cubecalc-ui/src/compilation-units/../main.c:722
    #5 0x37621e in main /home/loli/src/cubecalc-ui/src/compilation-units/../main.c:1668
    #6 0x7fd16ed4424d in __libc_start_call_main ??:?
    #7 0x7fd16ed44308 in __libc_start_main_alias_2 ??:?
    #8 0x21e584 in _start /build/glibc-2.35/csu/../sysdeps/x86_64/start.S:115

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/loli/src/cubecalc-ui/src/compilation-units/../thirdparty/nuklear.h:22651 in nk_group_scrolled_offset_begin
==3669821==ABORTING
Francesco149 commented 2 years ago

it seems to only happen when I expand the window to fullscreen which is even weirder.

if I do the steps in a smaller window, nothing happens. but as soon as i expand it it crashes.

Francesco149 commented 2 years ago

it happens only if all nodes are on screen.

Francesco149 commented 2 years ago

the offending node is 'Cube 25' when switching to accessory and 'Split 19' when switching to WSE

Francesco149 commented 2 years ago

this doesn't seem to happen on a 32-bit build.