mgerdes / Open-Golf

A cross-platform minigolf game written in C.
MIT License
1.8k stars 87 forks source link

Crashes when releasing ball #14

Closed WTechNinja closed 2 years ago

WTechNinja commented 2 years ago

I can build and run the app, but when I release the mouse to launch the ball the app crashes.

Here's a backtrace

``` /opt/open-golf » gdb out/linux/golf walter@willow GNU gdb (GDB) 11.2 Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from out/linux/golf... (No debugging symbols found in out/linux/golf) (gdb) run Starting program: /opt/open-golf/out/linux/golf [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". [New Thread 0x7fffecf86640 (LWP 33187)] [New Thread 0x7fffe7fff640 (LWP 33188)] [New Thread 0x7fffe75b5640 (LWP 33189)] Loading file data/static_data.static_data, count: 1 Loading file data/models/ui_square.obj, count: 1 Loading file data/models/cube.obj, count: 1 Loading file data/models/render_image_square.obj, count: 1 Loading file data/models/editor/ball_start.obj, count: 1 Loading file data/models/golf_ball.obj, count: 1 Loading file data/textures/golf_ball_normal_map.jpg, count: 1 Loading file data/textures/fallback.png, count: 1 Loading file data/textures/colors/white.png, count: 1 Loading file data/textures/colors/black.png, count: 1 Loading file data/textures/colors/red.png, count: 1 Loading file data/textures/colors/yellow.png, count: 1 Loading file data/textures/aimer.png, count: 1 Loading file data/textures/arrow.png, count: 1 Loading file data/textures/water_noise_1.png, count: 1 Loading file data/textures/water_noise_2.png, count: 1 Loading file data/textures/water_noise_3.png, count: 1 [New Thread 0x7fffe5f85640 (LWP 33190)] [New Thread 0x7fffe5784640 (LWP 33191)] [New Thread 0x7fffe4ed6640 (LWP 33192)] Loading file data/audio/confirmation_002.ogg, count: 1 Loading file data/audio/drop_001.ogg, count: 1 Loading file data/audio/drop_003.ogg, count: 1 Loading file data/audio/error_008.ogg, count: 1 Loading file data/audio/footstep_grass_004.ogg, count: 1 Loading file data/audio/impactPlank_medium_000.ogg, count: 1 Loading file data/audio/in_water.ogg, count: 1 Loading file data/shaders/diffuse_color_material.glsl, count: 1 Loading file data/shaders/environment_material.glsl, count: 1 Loading file data/shaders/pass_through.glsl, count: 1 Loading file data/shaders/solid_color_material.glsl, count: 1 Loading file data/shaders/texture_material.glsl, count: 1 Loading file data/shaders/render_image.glsl, count: 1 Loading file data/shaders/fxaa.glsl, count: 1 Loading file data/shaders/ui.glsl, count: 1 Loading file data/shaders/aim_line.glsl, count: 1 Loading file data/shaders/ball.glsl, count: 1 Loading file data/shaders/editor_water.glsl, count: 1 Loading file data/shaders/water.glsl, count: 1 Loading file data/shaders/water_around_ball.glsl, count: 1 Loading file data/shaders/water_ripple.glsl, count: 1 Loading file data/shaders/ball_hidden.glsl, count: 1 Loading file data/levels/level-1.level, count: 1 Loading file data/textures/hole_lightmap.png, count: 1 Loading file data/models/hole.obj, count: 1 Loading file data/models/hole-cover.obj, count: 1 Loading file data/models/sphere.obj, count: 1 Loading file data/textures/wood.jpg, count: 1 Loading file data/textures/ground.png, count: 1 Loading file data/textures/colors/light_gray.png, count: 1 Loading file data/textures/colors/red.png, count: 2 Loading file data/textures/environment/grass_dark.jpg, count: 1 Loading file data/textures/environment/soil1_dark.jpg, count: 1 Loading file data/textures/environment/wood.jpg, count: 1 Loading file data/textures/environment/wood_dark.jpg, count: 1 Loading file data/textures/ground_spinner_platform.png, count: 1 Loading file data/textures/ground_mover_platform.png, count: 1 Loading file data/models/flag_red.obj, count: 1 Loading file data/models/nature_kit/platform_grass.obj, count: 1 Loading file data/models/nature_kit/tree_pineTallA.obj, count: 1 Loading file data/models/nature_kit/tree_pineDefaultA.obj, count: 1 Loading file data/models/nature_kit/tree_pineRoundA.obj, count: 1 Loading file data/models/nature_kit/tree_pineSmallB.obj, count: 1 Loading file data/models/nature_kit/tree_pineRoundD.obj, count: 1 Loading file data/models/nature_kit/tree_pineTallD_detailed.obj, count: 1 Loading file data/models/nature_kit/tree_pineRoundF.obj, count: 1 Loading file data/config/game.cfg, count: 1 Loading file data/ui/ui.ui, count: 1 Loading file data/textures/colors/white.png, count: 2 Loading file data/textures/loading.gif, count: 1 Loading file data/font/FiraSans-Bold.ttf, count: 1 Loading file data/textures/pixel_pack.pixel_pack, count: 1 Loading file data/textures/pixel_pack_tex.png, count: 1 Loading file data/font/Castle-Rock.ttf, count: 1 Loading file data/textures/ui_icons/locked.png, count: 1 Loading file data/textures/ui_icons/pause.png, count: 1 Loading file data/textures/ui_icons/pointer.png, count: 1 Unloading file data/levels/level-1.level Unloading file data/textures/hole_lightmap.png Unloading file data/models/hole.obj Unloading file data/models/hole-cover.obj Unloading file data/models/sphere.obj Unloading file data/textures/wood.jpg Unloading file data/textures/ground.png Unloading file data/textures/colors/light_gray.png Unloading file data/textures/colors/red.png Unloading file data/textures/environment/grass_dark.jpg Unloading file data/textures/environment/soil1_dark.jpg Unloading file data/textures/environment/wood.jpg Unloading file data/textures/environment/wood_dark.jpg Unloading file data/textures/ground_spinner_platform.png Unloading file data/textures/ground_mover_platform.png Unloading file data/models/flag_red.obj Unloading file data/models/nature_kit/platform_grass.obj Unloading file data/models/nature_kit/tree_pineTallA.obj Unloading file data/models/nature_kit/tree_pineDefaultA.obj Unloading file data/models/nature_kit/tree_pineRoundA.obj Unloading file data/models/nature_kit/tree_pineSmallB.obj Unloading file data/models/nature_kit/tree_pineRoundD.obj Unloading file data/models/nature_kit/tree_pineTallD_detailed.obj Unloading file data/models/nature_kit/tree_pineRoundF.obj Loading file data/levels/level-3.level, count: 1 Loading file data/textures/hole_lightmap.png, count: 1 Loading file data/models/hole.obj, count: 1 Loading file data/models/hole-cover.obj, count: 1 Loading file data/models/sphere.obj, count: 1 Loading file data/textures/wood.jpg, count: 1 Loading file data/textures/ground.png, count: 1 Loading file data/textures/colors/black.png, count: 2 Loading file data/textures/colors/light_gray.png, count: 1 Loading file data/textures/colors/red.png, count: 2 Loading file data/textures/environment/slab.jpg, count: 1 Loading file data/textures/environment/grass_dark.jpg, count: 1 Loading file data/textures/environment/wood.jpg, count: 1 Loading file data/textures/environment/grass.jpg, count: 1 Loading file data/textures/environment/soil1_dark.jpg, count: 1 Loading file data/textures/environment/water.jpg, count: 1 Loading file data/textures/environment/wood_dark.jpg, count: 1 Loading file data/textures/colors/dark_gray.png, count: 1 Loading file data/textures/ground_spinner_platform.png, count: 1 Loading file data/textures/ground_mover_platform.png, count: 1 Loading file data/textures/environment/grass.png, count: 1 Loading file data/textures/environment/dark_stone.jpg, count: 1 Loading file data/models/flag_red.obj, count: 1 Loading file data/models/nature_kit/platform_grass.obj, count: 1 Loading file data/models/nature_kit/tree_pineTallB_detailed.obj, count: 1 Loading file data/models/nature_kit/tree_pineRoundC.obj, count: 1 Loading file data/models/nature_kit/tree_pineDefaultA.obj, count: 1 Loading file data/models/nature_kit/tree_pineRoundA.obj, count: 1 Loading file data/models/nature_kit/tree_pineDefaultB.obj, count: 1 Loading file data/models/nature_kit/tree_pineTallB.obj, count: 1 Loading file data/models/nature_kit/tree_pineTallD.obj, count: 1 Loading file data/models/nature_kit/tree_pineGroundA.obj, count: 1 Loading file data/models/nature_kit/tree_pineTallA.obj, count: 1 Loading file data/models/nature_kit/tree_pineRoundB.obj, count: 1 Thread 1 "golf" received signal SIGSEGV, Segmentation fault. 0x00007ffff77fa692 in fwrite () from /usr/lib/libc.so.6 (gdb) backtrace #0 0x00007ffff77fa692 in fwrite () from /usr/lib/libc.so.6 #1 0x000055555559f15f in ?? () #2 0x000055555556b1f3 in ?? () #3 0x00005555555659e9 in ?? () #4 0x0000555555565d34 in ?? () #5 0x000055555555c0ba in ?? () #6 0x00007ffff77ad310 in __libc_start_call_main () from /usr/lib/libc.so.6 #7 0x00007ffff77ad3c1 in __libc_start_main_impl () from /usr/lib/libc.so.6 #8 0x000055555555d0d5 in ?? () (gdb) ```

I'm on Arch linux, running the latest commit of open-golf (b9029f1) I have the app installed in /opt/open-golf/ If you need more details, let me know.

WTechNinja commented 2 years ago

Yeah my bad I'm new to messing with packaging, and it's probably something on my end because I recompiled the app with debugging symbols this time and the files it's complaining about are in the temporary build directory, and don't exist. So clearly my screwup somewhere. I'll figure it out

WTechNinja commented 2 years ago

If you're curious about my mischief,

the new backtrace

``` /opt/open-golf » gdb out/linux/golf walter@willow GNU gdb (GDB) 11.2 Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from out/linux/golf... (gdb) run Starting program: /opt/open-golf/out/linux/golf [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". [New Thread 0x7fffecf84640 (LWP 41557)] [New Thread 0x7fffe7fff640 (LWP 41558)] [New Thread 0x7fffe75b5640 (LWP 41559)] Loading file data/static_data.static_data, count: 1 Loading file data/models/ui_square.obj, count: 1 Loading file data/models/cube.obj, count: 1 Loading file data/models/render_image_square.obj, count: 1 Loading file data/models/editor/ball_start.obj, count: 1 Loading file data/models/golf_ball.obj, count: 1 Loading file data/textures/golf_ball_normal_map.jpg, count: 1 Loading file data/textures/fallback.png, count: 1 Loading file data/textures/colors/white.png, count: 1 Loading file data/textures/colors/black.png, count: 1 Loading file data/textures/colors/red.png, count: 1 Loading file data/textures/colors/yellow.png, count: 1 Loading file data/textures/aimer.png, count: 1 Loading file data/textures/arrow.png, count: 1 Loading file data/textures/water_noise_1.png, count: 1 Loading file data/textures/water_noise_2.png, count: 1 Loading file data/textures/water_noise_3.png, count: 1 [New Thread 0x7fffe5f85640 (LWP 41560)] [New Thread 0x7fffe5784640 (LWP 41561)] [New Thread 0x7fffe4ed6640 (LWP 41562)] Loading file data/audio/confirmation_002.ogg, count: 1 Loading file data/audio/drop_001.ogg, count: 1 Loading file data/audio/drop_003.ogg, count: 1 Loading file data/audio/error_008.ogg, count: 1 Loading file data/audio/footstep_grass_004.ogg, count: 1 Loading file data/audio/impactPlank_medium_000.ogg, count: 1 Loading file data/audio/in_water.ogg, count: 1 Loading file data/shaders/diffuse_color_material.glsl, count: 1 Loading file data/shaders/environment_material.glsl, count: 1 Loading file data/shaders/pass_through.glsl, count: 1 Loading file data/shaders/solid_color_material.glsl, count: 1 Loading file data/shaders/texture_material.glsl, count: 1 Loading file data/shaders/render_image.glsl, count: 1 Loading file data/shaders/fxaa.glsl, count: 1 Loading file data/shaders/ui.glsl, count: 1 Loading file data/shaders/aim_line.glsl, count: 1 Loading file data/shaders/ball.glsl, count: 1 Loading file data/shaders/editor_water.glsl, count: 1 Loading file data/shaders/water.glsl, count: 1 Loading file data/shaders/water_around_ball.glsl, count: 1 Loading file data/shaders/water_ripple.glsl, count: 1 Loading file data/shaders/ball_hidden.glsl, count: 1 Loading file data/levels/level-1.level, count: 1 Loading file data/textures/hole_lightmap.png, count: 1 Loading file data/models/hole.obj, count: 1 Loading file data/models/hole-cover.obj, count: 1 Loading file data/models/sphere.obj, count: 1 Loading file data/textures/wood.jpg, count: 1 Loading file data/textures/ground.png, count: 1 Loading file data/textures/colors/light_gray.png, count: 1 Loading file data/textures/colors/red.png, count: 2 Loading file data/textures/environment/grass_dark.jpg, count: 1 Loading file data/textures/environment/soil1_dark.jpg, count: 1 Loading file data/textures/environment/wood.jpg, count: 1 Loading file data/textures/environment/wood_dark.jpg, count: 1 Loading file data/textures/ground_spinner_platform.png, count: 1 Loading file data/textures/ground_mover_platform.png, count: 1 Loading file data/models/flag_red.obj, count: 1 Loading file data/models/nature_kit/platform_grass.obj, count: 1 Loading file data/models/nature_kit/tree_pineTallA.obj, count: 1 Loading file data/models/nature_kit/tree_pineDefaultA.obj, count: 1 Loading file data/models/nature_kit/tree_pineRoundA.obj, count: 1 Loading file data/models/nature_kit/tree_pineSmallB.obj, count: 1 Loading file data/models/nature_kit/tree_pineRoundD.obj, count: 1 Loading file data/models/nature_kit/tree_pineTallD_detailed.obj, count: 1 Loading file data/models/nature_kit/tree_pineRoundF.obj, count: 1 Loading file data/config/game.cfg, count: 1 Loading file data/ui/ui.ui, count: 1 Loading file data/textures/colors/white.png, count: 2 Loading file data/textures/loading.gif, count: 1 Loading file data/font/FiraSans-Bold.ttf, count: 1 Loading file data/textures/pixel_pack.pixel_pack, count: 1 Loading file data/textures/pixel_pack_tex.png, count: 1 Loading file data/font/Castle-Rock.ttf, count: 1 Loading file data/textures/ui_icons/locked.png, count: 1 Loading file data/textures/ui_icons/pause.png, count: 1 Loading file data/textures/ui_icons/pointer.png, count: 1 Unloading file data/levels/level-1.level Unloading file data/textures/hole_lightmap.png Unloading file data/models/hole.obj Unloading file data/models/hole-cover.obj Unloading file data/models/sphere.obj Unloading file data/textures/wood.jpg Unloading file data/textures/ground.png Unloading file data/textures/colors/light_gray.png Unloading file data/textures/colors/red.png Unloading file data/textures/environment/grass_dark.jpg Unloading file data/textures/environment/soil1_dark.jpg Unloading file data/textures/environment/wood.jpg Unloading file data/textures/environment/wood_dark.jpg Unloading file data/textures/ground_spinner_platform.png Unloading file data/textures/ground_mover_platform.png Unloading file data/models/flag_red.obj Unloading file data/models/nature_kit/platform_grass.obj Unloading file data/models/nature_kit/tree_pineTallA.obj Unloading file data/models/nature_kit/tree_pineDefaultA.obj Unloading file data/models/nature_kit/tree_pineRoundA.obj Unloading file data/models/nature_kit/tree_pineSmallB.obj Unloading file data/models/nature_kit/tree_pineRoundD.obj Unloading file data/models/nature_kit/tree_pineTallD_detailed.obj Unloading file data/models/nature_kit/tree_pineRoundF.obj Loading file data/levels/level-3.level, count: 1 Loading file data/textures/hole_lightmap.png, count: 1 Loading file data/models/hole.obj, count: 1 Loading file data/models/hole-cover.obj, count: 1 Loading file data/models/sphere.obj, count: 1 Loading file data/textures/wood.jpg, count: 1 Loading file data/textures/ground.png, count: 1 Loading file data/textures/colors/black.png, count: 2 Loading file data/textures/colors/light_gray.png, count: 1 Loading file data/textures/colors/red.png, count: 2 Loading file data/textures/environment/slab.jpg, count: 1 Loading file data/textures/environment/grass_dark.jpg, count: 1 Loading file data/textures/environment/wood.jpg, count: 1 Loading file data/textures/environment/grass.jpg, count: 1 Loading file data/textures/environment/soil1_dark.jpg, count: 1 Loading file data/textures/environment/water.jpg, count: 1 Loading file data/textures/environment/wood_dark.jpg, count: 1 Loading file data/textures/colors/dark_gray.png, count: 1 Loading file data/textures/ground_spinner_platform.png, count: 1 Loading file data/textures/ground_mover_platform.png, count: 1 Loading file data/textures/environment/grass.png, count: 1 Loading file data/textures/environment/dark_stone.jpg, count: 1 Loading file data/models/flag_red.obj, count: 1 Loading file data/models/nature_kit/platform_grass.obj, count: 1 Loading file data/models/nature_kit/tree_pineTallB_detailed.obj, count: 1 Loading file data/models/nature_kit/tree_pineRoundC.obj, count: 1 Loading file data/models/nature_kit/tree_pineDefaultA.obj, count: 1 Loading file data/models/nature_kit/tree_pineRoundA.obj, count: 1 Loading file data/models/nature_kit/tree_pineDefaultB.obj, count: 1 Loading file data/models/nature_kit/tree_pineTallB.obj, count: 1 Loading file data/models/nature_kit/tree_pineTallD.obj, count: 1 Loading file data/models/nature_kit/tree_pineGroundA.obj, count: 1 Loading file data/models/nature_kit/tree_pineTallA.obj, count: 1 Loading file data/models/nature_kit/tree_pineRoundB.obj, count: 1 Thread 1 "golf" received signal SIGSEGV, Segmentation fault. 0x00007ffff77fa692 in fwrite () from /usr/lib/libc.so.6 (gdb) backtrace #0 0x00007ffff77fa692 in fwrite () from /usr/lib/libc.so.6 #1 0x000055555559f15f in _save_buf_to_file ( file=0x5555556a290c "storage.json", buf_size=21, buf=0x555556263e10 "{\"seen_tutorial_0\":1}") at /tmp/makepkg/open-golf-git/src/open-golf-git/src/common/storage.c:33 #2 golf_storage_save () at /tmp/makepkg/open-golf-git/src/open-golf-git/src/common/storage.c:187 #3 0x000055555556b1f3 in _golf_ui_in_game (dt=0.0171515048) at /tmp/makepkg/open-golf-git/src/open-golf-git/src/golf/ui.c:1191 #4 golf_ui_update (dt=dt@entry=0.0171515048) at /tmp/makepkg/open-golf-git/src/open-golf-git/src/golf/ui.c:1292 #5 0x00005555555659e9 in golf_update (dt=dt@entry=0.0171515048) at /tmp/makepkg/open-golf-git/src/open-golf-git/src/golf/golf.c:67 #6 0x0000555555565d34 in frame () at /tmp/makepkg/open-golf-git/src/open-golf-git/src/golf/main.c:68 #7 0x000055555555c0ba in _sapp_call_frame () at /tmp/makepkg/open-golf-git/src/open-golf-git/src/3rd_party/sokol/sokol_app.h:2337 #8 _sapp_frame () at /tmp/makepkg/open-golf-git/src/open-golf-git/src/3rd_party/sokol/sokol_app.h:2516 #9 _sapp_linux_run (desc=0x7fffffffb6e0) at /tmp/makepkg/open-golf-git/src/open-golf-git/src/3rd_party/sokol/sokol_app.h:10583 #10 main (argc=, argv=) at /tmp/makepkg/open-golf-git/src/open-golf-git/src/3rd_party/sokol/sokol_app.h:10606 (gdb) ```

The PKGBUILD I'm messing with

``` # Maintainer: Walter Broemeling < wallebroem at gmail dot com > pkgname=open-golf-git pkgver=0.0.r412.b9029f1 pkgrel=1 pkgdesc="A cross-platform minigolf game written in C." arch=('x86_64') url="https://github.com/mgerdes/Open-Golf" license=('MIT') makedepends=('git') source=("$pkgname::git+https://github.com/mgerdes/Open-Golf" "open-golf" "open-golf-editor") sha256sums=('SKIP' 'd5697ca3d489fd4a912376a7fc38cfc3c2a83f486e8565bde949225277809f05' '6f0fc28310bd5b84a8f5ecd484bfe4e9984f67b312a32a005c0217743a301545') options=(debug !strip) pkgver() { cd $pkgname printf "0.0.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } build() { cd $srcdir/$pkgname ./build/build-linux.sh } package() { cd $srcdir/$pkgname mkdir -p "${pkgdir}/usr/bin/" mkdir -p "${pkgdir}/opt/open-golf/" cp -r "data" "${pkgdir}/opt/open-golf/" install -Dm0755 "out/linux/golf" "${pkgdir}/opt/open-golf/out/linux/golf" install -Dm0755 "out/linux/editor" "${pkgdir}/opt/open-golf/out/linux/editor" install -Dm0755 "$srcdir/open-golf" "${pkgdir}/usr/bin/" install -Dm0755 "$srcdir/open-golf-editor" "${pkgdir}/usr/bin/" } ```

the /usr/bin/open-golf script I have in the package

``` #!/bin/bash cd /opt/open-golf ./out/linux/golf ```

The /usr/bin/open-golf-editor script

``` #!/bin/bash cd /opt/open-golf ./out/linux/editor ```

Thank you for your patience, and sorry for using your time