protrekkr icon indicating copy to clipboard operation
protrekkr copied to clipboard

Crash on startup

Open voidshine opened this issue 3 years ago • 4 comments
trafficstars

Building on Manjaro Linux went smoothly but the program struggles to run -- I tried on two machines and was briefly able to see the user interface on one, but the crashes soon followed; on the other, crashes were immediate. The crashes are inconsistent, which hints at a threading & pointers issue:

[user@system distrib]$ ./ptk_linux ptk_linux: malloc.c:2617: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed. Aborted (core dumped) [user@system distrib]$ ./ptk_linux Segmentation fault (core dumped) [user@system distrib]$ ./ptk_linux free(): invalid pointer Aborted (core dumped)

voidshine avatar May 02 '22 03:05 voidshine

Indeed there's an assertion in linux 64 bit (debian) and a seg fault in 32 bit flavour, i'll investigate.

hitchhikr avatar Jun 03 '22 13:06 hitchhikr

It should now work on Linux 64 bit (it least it does in VirtualBox) but it refuses to work on Linux 32 bit (where it segfault in SDL_SetPalette()).

hitchhikr avatar Jun 06 '22 09:06 hitchhikr

Pulled and rebuilt, tried again on Linux 64-bit (Manjaro). Same issues, different errors on different attempts to run:

free(): invalid pointer
Aborted (core dumped)
ptk_linux: malloc.c:2617: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
Aborted (core dumped)

On the last run, I was able to see the interface for about 4 seconds before it crashed out with just "Segmentation fault (core dumped)".

voidshine avatar Jun 07 '22 20:06 voidshine

There are several errors and they all are occurring inside SDL, i don't know why (the tracker works perfectly in Windows & FreeBSD), it could also be some GCC quirks. I guess they'll hopefully be fixed when i'll switch it to SDL2 and true colors.

hitchhikr avatar Jun 15 '22 11:06 hitchhikr

Try it again, it should work now...

hitchhikr avatar Feb 18 '24 05:02 hitchhikr

It does work now, thanks!

On this system, I guess it was crashing about when the splash screen was going to disappear. Now it disappears with no crash, and the program can load modules and play them. The pattern editor area is still totally black, but I guess that's some incompatibility between my system and the graphics rendering.

voidshine avatar Feb 18 '24 20:02 voidshine

Check if you're using sdl12-compat.

hitchhikr avatar Feb 18 '24 20:02 hitchhikr

Yes, I am using that. Is it known to break the graphics, or it's required?

voidshine avatar Feb 18 '24 21:02 voidshine

@voidshine It seems to break SDL_Draw because it only has a compatibility layer for SDL_GFX instead. See #11 for details.

SamuraiCrow avatar Feb 18 '24 22:02 SamuraiCrow

I see, yes #11 is exactly my new problem, but this old crashing problem is indeed fixed so I'll close the issue. Thanks for your work on this, I'm looking forward to getting into this when I can get a chance to hack & track!

voidshine avatar Feb 19 '24 17:02 voidshine