Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

When I use ttf04 localization in shooter3-31's shop and click on a button, the program crashes unexpectedly.

$ valgrind ./shooter3-31

==33639== Memcheck, a memory error detector

==33639== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.

==33639== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info

==33639== Command: ./shooter3-31

==33639== 

==33639== Invalid read of size 8

==33639==    at 0x4023AB4: strncmp (strcmp-sse2.S:162)

==33639==    by 0x4004B9E: is_dst (dl-load.c:216)

==33639==    by 0x400596E: _dl_dst_count (dl-load.c:253)

==33639==    by 0x4005B47: expand_dynamic_string_token (dl-load.c:395)

==33639==    by 0x4005CB2: fillin_rpath.isra.0 (dl-load.c:483)

==33639==    by 0x4005FA2: decompose_rpath (dl-load.c:654)

==33639==    by 0x400815B: _dl_map_object (dl-load.c:2111)

==33639==    by 0x4002260: openaux (dl-deps.c:64)

==33639==    by 0x4CCA199: _dl_catch_exception (dl-error-skeleton.c:208)

==33639==    by 0x40025C9: _dl_map_object_deps (dl-deps.c:232)

==33639==    by 0x400BA6C: dl_open_worker_begin (dl-open.c:592)

==33639==    by 0x4CCA199: _dl_catch_exception (dl-error-skeleton.c:208)

==33639==  Address 0x2885bed9 is 9 bytes inside a block of size 15 alloc'd

==33639==    at 0x48407B4: malloc (vg_replace_malloc.c:381)

==33639==    by 0x402389A: malloc (rtld-malloc.h:56)

==33639==    by 0x402389A: strdup (strdup.c:42)

==33639==    by 0x4005F34: decompose_rpath (dl-load.c:629)

==33639==    by 0x400815B: _dl_map_object (dl-load.c:2111)

==33639==    by 0x4002260: openaux (dl-deps.c:64)

==33639==    by 0x4CCA199: _dl_catch_exception (dl-error-skeleton.c:208)

==33639==    by 0x40025C9: _dl_map_object_deps (dl-deps.c:232)

==33639==    by 0x400BA6C: dl_open_worker_begin (dl-open.c:592)

==33639==    by 0x4CCA199: _dl_catch_exception (dl-error-skeleton.c:208)

==33639==    by 0x400B1C5: dl_open_worker (dl-open.c:782)

==33639==    by 0x4CCA199: _dl_catch_exception (dl-error-skeleton.c:208)

==33639==    by 0x400B5B7: _dl_open (dl-open.c:884)

==33639== 

==33639== Invalid read of size 8

==33639==    at 0x4023AB4: strncmp (strcmp-sse2.S:162)

==33639==    by 0x4004B9E: is_dst (dl-load.c:216)

==33639==    by 0x4005A0D: _dl_dst_substitute (dl-load.c:295)

==33639==    by 0x4005CB2: fillin_rpath.isra.0 (dl-load.c:483)

==33639==    by 0x4005FA2: decompose_rpath (dl-load.c:654)

==33639==    by 0x400815B: _dl_map_object (dl-load.c:2111)

==33639==    by 0x4002260: openaux (dl-deps.c:64)

==33639==    by 0x4CCA199: _dl_catch_exception (dl-error-skeleton.c:208)

==33639==    by 0x40025C9: _dl_map_object_deps (dl-deps.c:232)

==33639==    by 0x400BA6C: dl_open_worker_begin (dl-open.c:592)

==33639==    by 0x4CCA199: _dl_catch_exception (dl-error-skeleton.c:208)

==33639==    by 0x400B1C5: dl_open_worker (dl-open.c:782)

==33639==  Address 0x2885bed9 is 9 bytes inside a block of size 15 alloc'd

==33639==    at 0x48407B4: malloc (vg_replace_malloc.c:381)

==33639==    by 0x402389A: malloc (rtld-malloc.h:56)

==33639==    by 0x402389A: strdup (strdup.c:42)

==33639==    by 0x4005F34: decompose_rpath (dl-load.c:629)

==33639==    by 0x400815B: _dl_map_object (dl-load.c:2111)

==33639==    by 0x4002260: openaux (dl-deps.c:64)

==33639==    by 0x4CCA199: _dl_catch_exception (dl-error-skeleton.c:208)

==33639==    by 0x40025C9: _dl_map_object_deps (dl-deps.c:232)

==33639==    by 0x400BA6C: dl_open_worker_begin (dl-open.c:592)

==33639==    by 0x4CCA199: _dl_catch_exception (dl-error-skeleton.c:208)

==33639==    by 0x400B1C5: dl_open_worker (dl-open.c:782)

==33639==    by 0x4CCA199: _dl_catch_exception (dl-error-skeleton.c:208)

==33639==    by 0x400B5B7: _dl_open (dl-open.c:884)

==33639== 

INFO: 0 joysticks available

INFO: Loading data/atlas/atlas.json ...

INFO: Loading data/widgets/comms.json ...

INFO: Loading data/widgets/shop.json ...

INFO: Loading data/widgets/loadSave.json ...

INFO: Loading data/widgets/options.json ...

INFO: Loading data/widgets/controls.json ...

INFO: Loading data/widgets/missionFailed.json ...

INFO: Loading data/widgets/stageOptions.json ...

INFO: Loading data/widgets/title.json ...

INFO: Loading data/intermission/planets.json ...

INFO: Loading data/intermission/shopItems.json ...

INFO: Loading data/intermission/shopChat.json ...

INFO: Loading config.json ...

INFO: Loading gfx/backgrounds/default.jpg ...

INFO: Creating entity 'greeblePOWShip'

INFO: Creating entity 'greebleBomber'

INFO: Creating entity 'greebleLightFighter'

INFO: Creating entity 'greebleLightFighter'

INFO: Creating entity 'greebleLightFighter'

INFO: Creating entity 'greeblePOWShip'

INFO: Creating entity 'greeblePOWShip'

INFO: Creating entity 'greebleLightFighter'

INFO: Creating entity 'greeblePOWShip'

INFO: Creating entity 'greebleBomber'

INFO: Creating entity 'greebleLightFighter'

INFO: Creating entity 'greebleBomber'

INFO: Creating entity 'greebleDualFighter'

INFO: Creating entity 'greebleLightFighter'

INFO: Creating entity 'greebleBomber'

INFO: Creating entity 'greeblePOWShip'

INFO: Save Slot #1: (空)

INFO: Save Slot #2: (空)

INFO: Save Slot #3: (空)

INFO: Save Slot #4: (空)

INFO: Save Slot #5: (空)

INFO: Continue Save Slot: -1

I am unable to replicate this. It seems that you're making a number of changes to the tutorial's code, and have introduced a bug or memory corruption along the way. None of those errors in the stacktrace are coming from the tutorial code, so it doesn't appear to be at fault here.

You seem quite keen to localise this game into another language, but I would suggest that if you want to learn how to support fonts with glyphs that include Chinese, Korean, Japanese, etc. that you opt for something a lot more simple than the larger projects here. There are a lot of moving parts in SDL2 Shooter 3 that could break while you're doing this, which will only lead to a lot of frustration.