Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amiberry crashes if i try to use ipf images #1591

Closed
randomMesh opened this issue Jan 12, 2025 · 6 comments
Closed

Amiberry crashes if i try to use ipf images #1591

randomMesh opened this issue Jan 12, 2025 · 6 comments
Assignees
Labels

Comments

@randomMesh
Copy link

If i try to load an ipf image in DF0:, Amiberry crashes. The gdb output suggests that it's searching for a capsimg.so which cannot be found.

The compiled capsimage library indeed is named differently: libcapsimage.so.

Renaming the library does not work, unfortunately.

xxx@xxx:/usr/local/bin $ gdb ./amiberry 
GNU gdb (Debian 13.1-3) 13.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "aarch64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./amiberry...
(gdb) r
Starting program: /usr/local/bin/amiberry 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff5d1f080 (LWP 50900)]
[New Thread 0x7ffff150f080 (LWP 50901)]
[New Thread 0x7fffe066f080 (LWP 50906)]
warning: queue 0x56de8b0 destroyed while proxies still attached:
  wl_callback#33 still attached
  wl_surface#32 still attached
[Thread 0x7fffe066f080 (LWP 50906) exited]
[New Thread 0x7fffe066f080 (LWP 50924)]
[New Thread 0x7fffdfaa3080 (LWP 50929)]
terminate called after throwing an instance of 'gcn::Exception'

Thread 1 "amiberry" received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=140737351572544, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44	./nptl/pthread_kill.c: No such file or directory.
(gdb) where
#0  __pthread_kill_implementation (threadid=140737351572544, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x00007ffff76d0aa4 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  0x00007ffff768a72c in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff767747c in __GI_abort () at ./stdlib/abort.c:79
#4  0x00007ffff79949d4 in __gnu_cxx::__verbose_terminate_handler() () from /lib/aarch64-linux-gnu/libstdc++.so.6
#5  0x00007ffff79923bc in ?? () from /lib/aarch64-linux-gnu/libstdc++.so.6
#6  0x00007ffff7992420 in std::terminate() () from /lib/aarch64-linux-gnu/libstdc++.so.6
#7  0x00007ffff7992704 in __cxa_throw () from /lib/aarch64-linux-gnu/libstdc++.so.6
#8  0x000000000114ee24 in gcn::SDLTrueTypeFont::SDLTrueTypeFont (this=this@entry=0x5e15080, 
    filename="/usr/local/share/amiberry/data//usr/share/fonts/truetype/iosevka/Iosevka-Medium.ttf", size=<optimized out>)
    at /usr/include/c++/12/bits/new_allocator.h:90
#9  0x000000000088f308 in InitShowMessage (message="capsimg.so not found. CAPS/IPF support not available.")
    at /home/xxx/development/amiberry/src/osdep/gui/ShowMessage.cpp:191
#10 0x000000000088f990 in ShowMessage (title="", line1="capsimg.so not found. CAPS/IPF support not available.", line2="", line3="", button1="Ok", button2="")
    at /home/xxx/development/amiberry/src/osdep/gui/ShowMessage.cpp:593
#11 0x0000000000717f2c in gui_message (format=<optimized out>) at /home/xxx/development/amiberry/src/osdep/amiberry_gui.cpp:1265
#12 0x0000000000718030 in notify_user (msg=msg@entry=16) at /home/xxx/development/amiberry/src/osdep/amiberry_gui.cpp:1275
#13 0x0000000000686be0 in caps_init () at /home/xxx/development/amiberry/src/caps/caps_amiberry.cpp:74
#14 0x0000000000686cf4 in caps_loadimage (zf=0x653c8b0, drv=0, num_tracks=num_tracks@entry=0x7fffffffda5c)
    at /home/xxx/development/amiberry/src/caps/caps_amiberry.cpp:133
#15 0x00000000004d7ec8 in drive_insert (drv=drv@entry=0x26409e0 <floppy>, p=p@entry=0x3bce228 <currprefs>, dnum=dnum@entry=0, fname_in=<optimized out>, 
    fake=fake@entry=true, forcedwriteprotect=forcedwriteprotect@entry=true) at /home/xxx/development/amiberry/src/disk.cpp:1475
#16 0x00000000004d73dc in DISK_examine_image (p=p@entry=0x3bce228 <currprefs>, num=num@entry=0, di=di@entry=0x241a048 <disk_info_data>, 
    deepcheck=deepcheck@entry=false, infotext=infotext@entry=0x0) at /home/xxx/development/amiberry/src/disk.cpp:5716
#17 0x00000000004d7a58 in drive_insert (drv=drv@entry=0x26409e0 <floppy>, p=0x3bce228 <currprefs>, dnum=dnum@entry=0, 
    fname_in=0x3d8b4f4 <currprefs+1823436> "/home/xxx/Downloads/games/amiga/roms/games/downAtTheTrolls/Down at the Trolls (Europe) (Disk 1).ipf", 
    fake=fake@entry=false, forcedwriteprotect=false) at /home/xxx/development/amiberry/src/disk.cpp:1364
#18 0x00000000004db170 in DISK_init () at /home/xxx/development/amiberry/src/disk.cpp:5462
#19 0x00000000005a3920 in real_main2 (argc=argc@entry=1, argv=argv@entry=0x7fffffffeef8) at /home/xxx/development/amiberry/src/main.cpp:1577
#20 0x00000000005a3a68 in real_main (argc=1, argv=argv@entry=0x7fffffffeef8) at /home/xxx/development/amiberry/src/main.cpp:1614
#21 0x0000000000701894 in main (argc=<optimized out>, argv=0x7fffffffeef8) at /home/xxx/development/amiberry/src/osdep/amiberry.cpp:4616
(gdb) k
Kill the program being debugged? (y or n) y
[Inferior 1 (process 50898) killed]
(gdb) q
xxx@xxx:/usr/local/bin $ 

System is Raspberry Pi 5.

@midwan midwan self-assigned this Jan 12, 2025
@midwan
Copy link
Collaborator

midwan commented Jan 12, 2025

On which Amiberry version?
Testing with the latest RC here seems to work as expected, on the RPI5 (I tested Apidya).

@randomMesh
Copy link
Author

This is on the latest master branch.

@midwan
Copy link
Collaborator

midwan commented Jan 12, 2025

Check what you have in your Paths settings for plugins directory. The library will be picked up from there, if it exists. If you used the .DEB package, these are already installed for you.

@midwan
Copy link
Collaborator

midwan commented Jan 12, 2025

And the real reason it crashed is an invalid path for the Font file, it seems:

/usr/local/share/amiberry/data//usr/share/fonts/truetype/iosevka/Iosevka-Medium.ttf

Not sure how that ended up there, but of course it shouldn't crash even with an invalid path.

@midwan midwan added bug and removed can't recreate labels Jan 12, 2025
@midwan
Copy link
Collaborator

midwan commented Jan 12, 2025

Found it - the ShowMessage window would always use a prefix of the data directory, when trying to look for the font.

@randomMesh
Copy link
Author

randomMesh commented Jan 12, 2025

The plugins path in amiberry.conf points to the Amiberry/plugins directory in my home.

But that directory didn't exist. I created that directory and copied /usr/local/lib/amiberry/libcapsimage.so to it.

After this, the ipf image worked fine.

So i think the bug is that if you compiled from source, the capsimage lib is not copied to $HOME/Amiberry/plugins.

@midwan midwan closed this as completed in 69c11f9 Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants