Page 1 of 1

Occasionally a segmentation fault when switching 'CUSTOM ARTWORK' graphics

Posted: Mon Jan 16, 2023 12:57 pm
by BryanFRitt
Occasionally(not that often), when switching 'CUSTOM ARTWORK' graphics theme or when switching levelsets that would do this, I've gotten a segmentation fault; on the screen there was a message about a config file. (Should have taken screenshot at least one of these times, but didn't) EDIT: Could this have been caused by me playing around with these config files?
Thread 1 "rocksndiamonds" received signal SIGSEGV, Segmentation fault.
0x0000555555710778 in CreateScaledBitmaps (bitmaps=0x55555b79ad70, zoom_factor=1, tile_size=32, create_small_bitmaps=1)
at system.c:1258
1258 old_width = old_bitmap->width;
After restarting Rocks'n'Diamonds things seem to fine. Haven't gotten it enough to notice more of a pattern to help reproduce it.

Re: Occasionally a segmentation fault when switching 'CUSTOM ARTWORK' graphics

Posted: Mon Jan 16, 2023 3:08 pm
by Holger
Very interesting, and should indeed not happen! :-o

It would be very worth knowing which custom artwork sets were loaded last (or about to be loaded) when this happens.

It could either be a "general" programming bug that happens when changing custom artwork sets "too often" (that is, it should of course not happen, but is an existing program bug that happens if a valid action is repeated many times, triggering a bug only in such cases).

Or it could be a bug that occurs when processing "invalid" custom graphics configuration files ("graphicsinfo.conf" files). That means that a configuration file contains some "invalid" values for certain options that would result in buggy behavior, which should be prevented by the program, but isn't.

I could imagine that it is hard or impossible to deterministically reproduce this crash, but it would help to know all custom artwork sets that were used between starting the game and the program finally crashing.

At least the crash message you quoted gives a good hint at which part of the program the crash occurred -- thanks for this information!

Re: Occasionally a segmentation fault when switching 'CUSTOM ARTWORK' graphics

Posted: Tue Jan 17, 2023 3:18 pm
by BryanFRitt
Holger wrote: Mon Jan 16, 2023 3:08 pm It could either be a "general" programming bug that happens when changing custom artwork sets "too often" (that is, it should of course not happen, but is an existing program bug that happens if a valid action is repeated many times, triggering a bug only in such cases).
Those times I think I was applying different custom artwork sets quickly; so this may be what happened for these cases.