BlitterStudio / amiberry

Optimized Amiga emulator for Linux/macOS
https://amiberry.com
GNU General Public License v3.0
660 stars 89 forks source link

Segmentation faults while using BetterWB #814

Closed boras-pl closed 3 years ago

boras-pl commented 3 years ago

Describe the bug I experience segmentation faults during startup of Workbench 3.1 + BetterWB add-on on a default A4000 emulation. There are two use cases:

I thought that I could get more meaningful stacktrace, so I compiled the program with some symbols by using DEBUG=1 flag enabled, but it hangs, unfortunately. I am not so experienced with gdb as well.

To Reproduce

Desktop (please complete the following information): RaspiOS lite, no X11, KMSDRM

pi@raspberrypi:~/SDL $ git describe --tags
release-2.0.14-841-g157c3f80
pi@raspberrypi:~/SDL $ git log -1 --format="%H"
157c3f8097403c08cc9747082de37276fb2ab28c
pi@raspberrypi:~/SDL $ uname -a
Linux raspberrypi 5.10.17-v8+ #1414 SMP PREEMPT Fri Apr 30 13:23:25 BST 2021 aarch64 GNU/Linux
pi@raspberrypi:~/SDL $ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:    10
Codename:   buster
pi@raspberrypi:~/SDL $ cd ../amiberry_4.1.2/
pi@raspberrypi:~/amiberry_4.1.2 $ git log -1 --format="%H"
c1d54aa4912898c6be5206ac4a024512af7d06cc

A4000-test.uae

config_description=UAE default configuration
config_hardware=true
config_host=true
config_version=4.1.2
config_hardware_path=
config_host_path=
config_all_path=
amiberry.rom_path=./
amiberry.floppy_path=./
amiberry.hardfile_path=./
amiberry.cd_path=./
; host-specific
amiberry.middle_mouse=true
amiberry.cpu_idle=150
; common
use_gui=yes
kickstart_rom_file=/home/pi/Amiga_files/kickstarts/Kickstart v3.1 rev 40.68 (1993)(Commodore)(A4000).rom
kickstart_rom_file_id=D6BAE334,KS ROM v3.1 (A4000)
kickstart_ext_rom_file=
ide_mb_rom_file=:ENABLED
flash_file=
cart_file=
rtc_file=
kickshifter=false
floppy_volume=33
floppy0=df0.adf
floppy1=df1.adf
floppy1type=1
floppy2=df2.adf
floppy3=df3.adf
nr_floppies=2
floppy_speed=0
cd_speed=100
parallel_on_demand=false
serial_on_demand=false
serial_hardware_ctsrts=true
serial_direct=false
scsi=false
uaeserial=false
sana2=false
sound_output=normal
sound_channels=stereo
sound_stereo_separation=7
sound_stereo_mixing_delay=0
sound_max_buff=16384
sound_frequency=44100
sound_interpol=anti
sound_filter=emulated
sound_filter_type=enhanced
sound_volume=0
sound_volume_paula=0
sound_volume_cd=0
sound_volume_ahi=0
sound_volume_midi=0
sound_volume_genlock=0
sound_auto=true
sound_cdaudio=false
sound_stereo_swap_paula=false
sound_stereo_swap_ahi=false
comp_trustbyte=direct
comp_trustword=direct
comp_trustlong=direct
comp_trustnaddr=direct
comp_nf=true
comp_constjump=true
comp_flushmode=soft
compfpu=true
comp_catchfault=true
cachesize=16384
joyport0=mouse
joyport0autofire=none
joyportfriendlyname0=System mouse
joyportname0=MOUSE0
joyport1=joy0
joyport1autofire=none
joyportfriendlyname1=Logitech F710 Gamepad (XInput)
joyportname1=JOY0
bsdsocket_emu=false
synchronize_clock=false
maprom=0x0
parallel_postscript_emulation=false
parallel_postscript_detection=false
ghostscript_parameters=
parallel_autoflush=5
gfx_display=0
gfx_display_rtg=0
gfx_framerate=1
gfx_width=640
gfx_height=512
gfx_top_windowed=0
gfx_left_windowed=0
gfx_width_windowed=640
gfx_height_windowed=512
gfx_width_fullscreen=800
gfx_height_fullscreen=600
gfx_refreshrate=0
gfx_autoresolution=0
gfx_autoresolution_vga=true
gfx_backbuffers=2
gfx_backbuffers_rtg=1
gfx_vsync=false
gfx_vsyncmode=normal
gfx_vsync_picasso=false
gfx_vsyncmode_picasso=normal
gfx_lores=false
gfx_resolution=hires
gfx_lores_mode=normal
gfx_flickerfixer=false
gfx_linemode=none
gfx_fullscreen_amiga=false
gfx_fullscreen_picasso=false
gfx_center_horizontal=none
gfx_center_vertical=none
gfx_colour_mode=32bit
gfx_blacker_than_black=false
gfx_api=direct3d11
gfx_api_options=hardware
immediate_blits=false
waiting_blits=automatic
fast_copper=false
ntsc=false
genlock=false
chipset=aga
collision_level=playfields
chipset_compatible=A4000
ciaatod=50hz
ksmirror_e0=false
fatgary=0
ramsey=15
z3_autoconfig=true
unmapped_address_space=zero
ide=a4000
z3mapping=real
fastmem_size=0
mem25bit_size=0
a3000mem_size=0
mbresmem_size=0
z3mem_size=8
z3mem_start=0x40000000
bogomem_size=0
gfxcard_hardware_vblank=false
gfxcard_hardware_sprite=true
gfxcard_multithread=false
chipmem_size=4
cpu_speed=max
cpu_throttle=0.0
cpu_type=68020/68881
cpu_model=68030
fpu_model=68882
cpu_compatible=false
cpu_24bit_addressing=false
cpu_data_cache=false
cpu_cycle_exact=false
cpu_memory_cycle_exact=false
blitter_cycle_exact=false
cycle_exact=false
fpu_strict=false
rtg_nocustom=true
rtg_modes=0x212
kbd_lang=us
filesystem2=rw,DH0:System:/home/pi/Amiga_files/hdd/System,0
uaehf0=dir,rw,DH0:System:/home/pi/Amiga_files/hdd/System,0
input.config=0
input.joymouse_speed_analog=100
input.joymouse_speed_digital=10
input.joymouse_deadzone=33
input.joystick_deadzone=33
input.analog_joystick_multiplier=18
input.analog_joystick_offset=-5
input.mouse_speed=100
input.autofire_speed=600
input.autoswitch=1
input.1.joystick.0.friendlyname=Logitech F710 Gamepad (XInput)
input.1.joystick.0.name=JOY0
input.1.joystick.0.empty=true
input.1.joystick.1.empty=true
input.1.joystick.2.empty=true
input.1.joystick.3.empty=true
input.1.joystick.4.empty=true
input.1.joystick.5.empty=true
input.1.joystick.6.empty=true
input.1.joystick.7.empty=true
input.1.mouse.0.friendlyname=System mouse
input.1.mouse.0.name=MOUSE0
input.1.mouse.0.empty=true
input.1.mouse.1.empty=true
input.1.mouse.2.empty=true
input.1.mouse.3.empty=true
input.1.mouse.4.empty=true
input.1.mouse.5.empty=true
input.1.mouse.6.empty=true
input.1.mouse.7.empty=true
input.1.keyboard.0.friendlyname=Default Keyboard
input.1.keyboard.0.name=KEYBOARD0
input.1.keyboard.0.empty=false
input.1.keyboard.0.disabled=false
input.1.keyboard.1.empty=true
input.1.keyboard.2.empty=true
input.1.keyboard.3.empty=true
input.1.keyboard.4.empty=true
input.1.keyboard.5.empty=true
input.1.keyboard.6.empty=true
input.1.keyboard.7.empty=true
input.1.internal.0.friendlyname=Internal events
input.1.internal.0.name=INTERNALEVENTS1
input.1.internal.0.empty=true
input.1.internal.0.disabled=false
input.2.joystick.0.friendlyname=Logitech F710 Gamepad (XInput)
input.2.joystick.0.name=JOY0
input.2.joystick.0.empty=true
input.2.joystick.1.empty=true
input.2.joystick.2.empty=true
input.2.joystick.3.empty=true
input.2.joystick.4.empty=true
input.2.joystick.5.empty=true
input.2.joystick.6.empty=true
input.2.joystick.7.empty=true
input.2.mouse.0.friendlyname=System mouse
input.2.mouse.0.name=MOUSE0
input.2.mouse.0.empty=true
input.2.mouse.1.empty=true
input.2.mouse.2.empty=true
input.2.mouse.3.empty=true
input.2.mouse.4.empty=true
input.2.mouse.5.empty=true
input.2.mouse.6.empty=true
input.2.mouse.7.empty=true
input.2.keyboard.0.friendlyname=Default Keyboard
input.2.keyboard.0.name=KEYBOARD0
input.2.keyboard.0.empty=false
input.2.keyboard.0.disabled=false
input.2.keyboard.1.empty=true
input.2.keyboard.2.empty=true
input.2.keyboard.3.empty=true
input.2.keyboard.4.empty=true
input.2.keyboard.5.empty=true
input.2.keyboard.6.empty=true
input.2.keyboard.7.empty=true
input.2.internal.0.friendlyname=Internal events
input.2.internal.0.name=INTERNALEVENTS1
input.2.internal.0.empty=true
input.3.joystick.0.friendlyname=Logitech F710 Gamepad (XInput)
input.3.joystick.0.name=JOY0
input.3.joystick.0.empty=true
input.3.joystick.1.empty=true
input.3.joystick.2.empty=true
input.3.joystick.3.empty=true
input.3.joystick.4.empty=true
input.3.joystick.5.empty=true
input.3.joystick.6.empty=true
input.3.joystick.7.empty=true
input.3.mouse.0.friendlyname=System mouse
input.3.mouse.0.name=MOUSE0
input.3.mouse.0.empty=true
input.3.mouse.1.empty=true
input.3.mouse.2.empty=true
input.3.mouse.3.empty=true
input.3.mouse.4.empty=true
input.3.mouse.5.empty=true
input.3.mouse.6.empty=true
input.3.mouse.7.empty=true
input.3.keyboard.0.friendlyname=Default Keyboard
input.3.keyboard.0.name=KEYBOARD0
input.3.keyboard.0.empty=false
input.3.keyboard.0.disabled=false
input.3.keyboard.1.empty=true
input.3.keyboard.2.empty=true
input.3.keyboard.3.empty=true
input.3.keyboard.4.empty=true
input.3.keyboard.5.empty=true
input.3.keyboard.6.empty=true
input.3.keyboard.7.empty=true
input.3.internal.0.friendlyname=Internal events
input.3.internal.0.name=INTERNALEVENTS1
input.3.internal.0.empty=true
input.4.joystick.0.friendlyname=Logitech F710 Gamepad (XInput)
input.4.joystick.0.name=JOY0
input.4.joystick.0.custom=true
input.4.mouse.0.friendlyname=System mouse
input.4.mouse.0.name=MOUSE0
input.4.mouse.0.custom=true
input.4.keyboard.0.friendlyname=Default Keyboard
input.4.keyboard.0.name=KEYBOARD0
input.4.keyboard.0.custom=true
; *** WHDLoad Booter. Options
whdload_slave=
whdload_showsplash=true
whdload_buttonwait=false
whdload_custom1=0
whdload_custom2=0
whdload_custom3=0
whdload_custom4=0
whdload_custom5=0
whdload_custom=

Amiberry executed in Midnight Commander

pi@raspberrypi:~/amiberry_4.1.2 $ cat amiberry.log_executed_in_mc
Amiberry v4.1.2 (2021-04-06) Logfile

Allocated 16 MB for 24-bit area (0x0000000020000000) and 1152 MB for Z3 and RTG at real address (0x0000000060000000 - 0x00000000a8000020)
Sorting devices and modes...
0: 640x480, 32-bit (60)
1: 720x576, 32-bit (50)
2: 1024x768, 32-bit (60)
3: 1280x720, 32-bit (60)
4: 1920x1080, 32-bit (60)
5 display modes.
Desktop: W=1920 H=1080 B=32 HZ=60. CXVS=1920 CYVS=1080
clipboard_init
Controller #0: Logitech F710 Gamepad (XInput)
      GUID: 030000006d0400001fc2000005030000
Controller 0 is mapped as "030000006d0400001fc2000005030000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,".
Retroarch controller cfg file found, using that for mapping
Controller Detection: input_enable_hotkey_btn : 6
Controller Detection: input_exit_emulator_btn : -1
Controller Detection: input_reset_btn : -1
Controller Detection: input_b_btn : 0
Controller Detection: input_a_btn : 1
Controller Detection: input_y_btn : 2
Controller Detection: input_x_btn : 3
Controller Detection: input_select_btn : -1
Controller Detection: input_menu_toggle_btn : -1
Controller Detection: input_start_btn : 7
Controller Detection: input_l3_btn : 9
Controller Detection: input_r3_btn : 10
Controller Detection: input_l_btn : 4
Controller Detection: input_r_btn : 5
Controller Detection: input_up_btn : -1
Controller Detection: input_down_btn : -1
Controller Detection: input_left_btn : -1
Controller Detection: input_right_btn : -1
Controller Detection: left : -1
Controller Detection: right : -1
Controller Detection: up : -1
Controller Detection: down : -1
Controller Detection: a : -1
Controller Detection: b : -1
Controller Detection: input_l_x_plus_axis : 0
Controller Detection: input_l_y_plus_axis : 1
Controller Detection: input_r_x_plus_axis : 2
Controller Detection: input_r_y_plus_axis : 3
Controller Detection: input_l2_axis : -1
Controller Detection: input_r2_axis : -1
Controller Detection: count_hats : 1
Controller Detection: invert left  y axis: 0
Controller Detection: invert left  x axis: 0
Controller Detection: invert right y axis: 0
Controller Detection: invert right x axis: 0
KS ver = 34 (0x22)
Stored port 0/0 d=0: added 200 0  
Stored port 0/0 d=0: added 200 0 System mouse MOUSE0
Port0: ID 'mouse' matched
Stored port 1/0 d=0: added 100 0  
Stored port 1/0 d=0: added 100 0 Logitech F710 Gamepad (XInput) JOY0
Port1: ID 'joy0' matched
Port2: NONE
Port3: NONE
target_cfgfile_load(): load file /home/pi/Amiga_files/conf/default.uae
load config '/home/pi/Amiga_files/conf/default.uae':3
cfgfile_load_2 failed
KS ver = 34 (0x22)
Stored port 0/0 d=0: added 200 0  
Stored port 0/0 d=0: added 200 0 System mouse MOUSE0
Port0: ID 'mouse' matched
Stored port 1/0 d=0: added 100 0  
Stored port 1/0 d=0: added 100 0 Logitech F710 Gamepad (XInput) JOY0
Port1: ID 'joy0' matched
Port2: NONE
Port3: NONE
failed to load config '/home/pi/Amiga_files/conf/default.uae'
KS ver = 34 (0x22)
Stored port 0/0 d=1: added 200 0 System mouse MOUSE0
Port0: COMBO 'System mouse' + 'MOUSE0' matched
Stored port 1/0 d=1: added 100 0 Logitech F710 Gamepad (XInput) JOY0
Port1: COMBO 'Logitech F710 Gamepad (XInput)' + 'JOY0' matched
Port2: NONE
Port3: NONE
Autoconfig board list:
Card 01: 'UAE Boot ROM' no autoconfig 00f00000 - 00f0ffff.
Card 02: 'UAE FS ROM'
  d1.52.40.00.07.db.00.00.00.03.20.00.00.00.00.00
  MID 2011 (07db) PID 82 (52) SER 00000003
  Z2 0x00e90000 0x00e90000   64K ROM 0
END
Could not create color cursor: Cursors are not currently supported
Autoconfig board list:
END
Stored port 0/1 d=0: added 200 0 System mouse MOUSE0
Stored port 1/1 d=0: added 100 0 Logitech F710 Gamepad (XInput) JOY0
target_cfgfile_load(): load file /home/pi/Amiga_files/conf/A4000-test.uae
load config '/home/pi/Amiga_files/conf/A4000-test.uae':3
KS ver = 40 (0x28)
Stored port 0/1 d=0: added 200 0 System mouse MOUSE0
Port0: COMBO 'System mouse' + 'MOUSE0' matched
Stored port 1/1 d=0: added 100 0 Logitech F710 Gamepad (XInput) JOY0
Port1: COMBO 'Logitech F710 Gamepad (XInput)' + 'JOY0' matched
Port2: NONE
Port3: NONE
Stored port 0/1 d=0: added 200 0 System mouse MOUSE0
Stored port 1/1 d=0: added 100 0 Logitech F710 Gamepad (XInput) JOY0
Autoconfig board list:
Card 01: '<no name>' no autoconfig 00dd2020 - 00dd301f.
Card 02: 'UAE Boot ROM' no autoconfig 00f00000 - 00f0ffff.
Card 03: 'UAE FS ROM'
  d1.52.40.00.07.db.00.00.00.03.20.00.00.00.00.00
  MID 2011 (07db) PID 82 (52) SER 00000003
  Z2 0x00e90000 0x00e90000   64K ROM 0
Card 04: 'Z3 Fast RAM'
  a0.53.9a.00.07.db.00.00.00.01.00.00.00.00.00.00
  MID 2011 (07db) PID 83 (53) SER 00000001
  Z3 0x40000000 0x40000000   16M RAM 0
END
Autoconfig board list:
Card 01: '<no name>' no autoconfig 00dd2020 - 00dd301f.
Card 02: 'UAE Boot ROM' no autoconfig 00f00000 - 00f0ffff.
Card 03: 'UAE FS ROM'
  d1.52.40.00.07.db.00.00.00.03.20.00.00.00.00.00
  MID 2011 (07db) PID 82 (52) SER 00000003
  Z2 0x00e90000 0x00e90000   64K ROM 0
Card 04: 'Z3 Fast RAM'
  a0.53.9a.00.07.db.00.00.00.01.00.00.00.00.00.00
  MID 2011 (07db) PID 83 (53) SER 00000001
  Z3 0x40000000 0x40000000   16M RAM 0
END
KS ver = 40 (0x28)
Stored port 0/1 d=0: added 200 0 System mouse MOUSE0
Port0: COMBO 'System mouse' + 'MOUSE0' matched
Stored port 1/1 d=0: added 100 0 Logitech F710 Gamepad (XInput) JOY0
Port1: COMBO 'Logitech F710 Gamepad (XInput)' + 'JOY0' matched
Port2: NONE
Port3: NONE
Stored port 0/1 d=0: added 200 0 System mouse MOUSE0
Stored port 1/1 d=0: added 100 0 Logitech F710 Gamepad (XInput) JOY0
Autoconfig board list:
Card 01: '<no name>' no autoconfig 00dd2020 - 00dd301f.
Card 02: 'UAE Boot ROM' no autoconfig 00f00000 - 00f0ffff.
Card 03: 'UAE FS ROM'
  d1.52.40.00.07.db.00.00.00.03.20.00.00.00.00.00
  MID 2011 (07db) PID 82 (52) SER 00000003
  Z2 0x00e90000 0x00e90000   64K ROM 0
Card 04: 'Z3 Fast RAM'
  a0.53.9a.00.07.db.00.00.00.01.00.00.00.00.00.00
  MID 2011 (07db) PID 83 (53) SER 00000001
  Z3 0x40000000 0x40000000   16M RAM 0
END
KS ver = 40 (0x28)
Stored port 0/1 d=0: added 200 0 System mouse MOUSE0
Stored port 1/1 d=0: added 100 0 Logitech F710 Gamepad (XInput) JOY0
RTAREA located at 00F00000
mapped_malloc(): 0x00f00000 - 0x00f10000 (0x20f00000 - 0x20f10000) -> UAE Boot ROM (rtarea)
TRAP_ENTRY = 00f01eda
mapped_malloc(): 0x40000000 - 0x40800000 (0x60000000 - 0x60800000) -> Zorro III Fast RAM (*)
mapped_malloc(): 0x00f80000 - 0x01000000 (0x20f80000 - 0x21000000) -> Kickstart ROM (kick)
mapped_malloc(): 0x00000000 - 0x00200000 (0x20000000 - 0x20200000) -> Chip memory (chip)
ROM loader.. (<none>)
Known ROM 'KS ROM v3.1 (A4000)' loaded
ROM loader end
memory init end
No disk in drive 0.
Resetting frame rate hack
1867 CPU functions
Getting Current Video Driver...
Current Display mode: bpp 32    SDL_PIXELFORMAT_ARGB8888    1920 x 1080 50Hz
Creating Amiberry window...
SDL2: Set window not to minimize on focus loss
Stored port 0/1 d=0: added 200 0 System mouse MOUSE0
Stored port 1/1 d=0: added 100 0 Logitech F710 Gamepad (XInput) JOY0
Resetting frame rate hack
Building CPU, 45926 opcodes (3 0 0)
JIT popallspace: 0x7f94203000-0x7f94203800
Actual translation cache size : 16384 KB at 0x7f94203800-0x7f95203800
CPU=68030, FPU=68882 (host), JIT=CPU/FPU=16384. fast
clipboard: reset (00000000)
memory init end
uae_start_thread "filesys" function at 0x555c4244d0 arg 0x555f6457e8
Reset at 00000000. Chipset mask = 00000007
PAL mode V=50.0804Hz H=15625.0879Hz (227x312+0) IDX=10 (PAL) D=0 RTG=0/0
Buffer 0 size (640*256) Native
RTGFREQ: 312*50.0804 = 15625.0879 / 50.1 = 312
Autoconfig board list:
Card 01: '<no name>' no autoconfig 00dd2020 - 00dd301f.
Card 02: 'UAE Boot ROM' no autoconfig 00f00000 - 00f0ffff.
Card 03: 'UAE FS ROM'
  d1.52.40.00.07.db.00.00.00.03.20.00.00.00.00.00
  MID 2011 (07db) PID 82 (52) SER 00000003
  Z2 0x00e90000 0x00e90000   64K ROM 0
Card 04: 'Z3 Fast RAM'
  a0.53.9a.00.07.db.00.00.00.01.00.00.00.00.00.00
  MID 2011 (07db) PID 83 (53) SER 00000001
  Z3 0x40000000 0x40000000   16M RAM 0
END
uae_start_thread "ide" function at 0x555c45d290 arg 0x555f7ade40
Card 0: skipping autoconfig (not autoconfig)
Card 1: skipping autoconfig (not autoconfig)
hardreset, memory cleared
SNDRATE 312.0*227.0*50.080410=3546894.958099
SERIAL: period=372, baud=9600, hsyncs=14, bits=8, PC=f8012e
mapped_malloc(): 0x00e90000 - 0x00ea0000 (0x20e90000 - 0x20ea0000) -> Filesystem autoconfig (*)
Card 3: Z2 0x00e90000   64K ROM Filesystem autoconfig
Card 4: Z3 0x40000000   16M RAM Zorro III Fast RAM
filesystem: diagentry 40000098 configdev 00000c00
Gary timeout: 07f7fff0 2 R PC=00000482
Gary timeout: 07f7fff4 2 R PC=00000482
Gary timeout: 07f7fff8 2 R PC=00000482
Gary timeout: 07f7fffc 2 R PC=00000482
Gary timeout: 07f7fff0 2 W PC=00000488
Gary timeout: 07f7fff4 2 W PC=0000048a
Gary timeout: 07f7fff8 2 W PC=0000048c
Gary timeout: 07f7fffc 2 W PC=0000048e
Gary timeout: 07f7fffc 2 R PC=000004a6
Gary timeout: 07f7fff0 2 W PC=000004c8
Gary timeout: 07f7fff4 2 W PC=000004c8
Gary timeout: 07f7fff8 2 W PC=000004c8
Gary timeout: 07f7fffc 2 W PC=000004c8
waiting_blits detected PC=00faaca2
SNDRATE 313.0*227.0*49.920410=3546895.062012
PAL mode V=49.9204Hz H=15625.0879Hz (227x312+1) IDX=10 (PAL) D=0 RTG=0/0
Mounting uaehf.device:0 0 (0):
FS: mounted virtual unit DH0 (/home/pi/Amiga_files/hdd/System)
FS: System (flags=00000002,E=0,ED=1,EF=0,native='/home/pi/Amiga_files/hdd/System') starting..
--- New exception ---
Error in compiled code.
JIT: Address bank: NONE, address c0000142
JIT: AARCH64 opcode = 0xb87b69a2
long load to register x2
Gary timeout: c0000142 2 R PC=4001a09a
New value in x2: 0x00000000 (old: 0x340100c0)
JIT: Deleted trigger (0x0000000094307cb8 < 0x0000000094307c14 < 0x0000000094307cd4) 0x000000006001a088
Segmentation Fault
info.si_signo = 11
info.si_errno = 0
info.si_code = 1
info.si_addr = e0000142
x00  = 0x0000007f94203000
x01  = 0x0000000000000000
x02  = 0x0000000000000000
x03  = 0x0000000000000000
x04  = 0x0000000000000000
x05  = 0x0000000000000001
x06  = 0x00000055605e3c90
x07  = 0x00000055606c52d0
x08  = 0x00000055606c52c0
x09  = 0x00000055605e3ba0
x10  = 0x00000055605e3c88
x11  = 0x0000000000000069
x12  = 0x0000000000fce1c3
x13  = 0x00000000c0000142
x14  = 0x00000000c0000134
x15  = 0x0000000040000484
x16  = 0x0000000040019970
x17  = 0x0000000040019980
x18  = 0x0000005560785830
x19  = 0x000000555ce4d8c4
x20  = 0x000000555cddf000
x21  = 0x0000005560645220
x22  = 0x00000055605e3000
x23  = 0x000000555cddf000
x24  = 0x00000055606c57c8
x25  = 0x0000000000000000
x26  = 0x00000055605e3ba0
x27  = 0x0000000020000000
x28  = 0x00000055605e3ba0
x29  = 0x0000007fdda5b550
x30  = 0x000000555c5bac88
SP  = 0x0000007fdda5b540
PC  = 0x0000007f94307c18
Fault Address = 0x00000000e0000142
pstate  = 0x0000000080000000
LR - 0x5C5BAC88: <(null)> (./amiberry)
Stack trace:
0x5c5479a0 <(null) + 0x5c5479a0> (./amiberry)
0x98d1e7c0 <__kernel_rt_sigreturn + 0x00000000> (linux-vdso.so.1)
Stack trace (non-dedicated):
./amiberry(+0x307a20) [0x555c547a20]
linux-vdso.so.1(__kernel_rt_sigreturn+0) [0x7f98d1e7c0]
[0x7f94307c18]
End of stack trace.
--- end exception ---
--- New exception ---
Error in compiled code.
JIT: Address bank: NONE, address c000012a
JIT: AARCH64 opcode = 0xb87b69a2
long load to register x2
Gary timeout: c000012a 2 R PC=4001a088
New value in x2: 0x00000000 (old: 0x1c0100c0)
JIT: Deleted trigger (0x000000009430809c < 0x0000000094307ff8 < 0x00000000943080b8) 0x000000006001a088
Segmentation Fault
info.si_signo = 11
info.si_errno = 0
info.si_code = 1
info.si_addr = e000012a
x00  = 0x0000007f94203000
x01  = 0x0000000000000000
x02  = 0x0000000000000000
x03  = 0x000000006001a088
x04  = 0x0000007f943081fc
x05  = 0x0000005560715d68
x06  = 0x00000055605e3c90
x07  = 0x00000055606c52d0
x08  = 0x00000055606c52c0
x09  = 0x00000055605e3ba0
x10  = 0x00000055605e3c88
x11  = 0x0000000000000069
x12  = 0x0000000000fed70e
x13  = 0x00000000c000012a
x14  = 0x00000000c000011c
x15  = 0x00000000400004c8
x16  = 0x0000000040019970
x17  = 0x0000000040019980
x18  = 0x0000005560785830
x19  = 0x000000555ce4d8c4
x20  = 0x000000555cddf000
x21  = 0x0000005560645220
x22  = 0x00000055605e3000
x23  = 0x000000555cddf000
x24  = 0x00000055606c57c8
x25  = 0x0000000000000000
x26  = 0x00000055605e3ba0
x27  = 0x0000000020000000
x28  = 0x00000055605e3ba0
x29  = 0x0000007fdda5b550
x30  = 0x000000555c5bac88
SP  = 0x0000007fdda5b540
PC  = 0x0000007f94307ffc
Fault Address = 0x00000000e000012a
pstate  = 0x0000000060000000
LR - 0x5C5BAC88: <(null)> (./amiberry)
Stack trace:
0x5c5479a0 <(null) + 0x5c5479a0> (./amiberry)
0x98d1e7c0 <__kernel_rt_sigreturn + 0x00000000> (linux-vdso.so.1)
Stack trace (non-dedicated):
./amiberry(+0x307a20) [0x555c547a20]
linux-vdso.so.1(__kernel_rt_sigreturn+0) [0x7f98d1e7c0]
[0x7f94307ffc]
End of stack trace.
--- end exception ---

Amiberry executed in shell

pi@raspberrypi:~/amiberry_4.1.2 $ cat amiberry.log_executed_in_shell 
Amiberry v4.1.2 (2021-04-06) Logfile

Allocated 16 MB for 24-bit area (0x0000000020000000) and 1152 MB for Z3 and RTG at real address (0x0000000060000000 - 0x00000000a8000020)
Sorting devices and modes...
0: 640x480, 32-bit (60)
1: 720x576, 32-bit (50)
2: 1024x768, 32-bit (60)
3: 1280x720, 32-bit (60)
4: 1920x1080, 32-bit (60)
5 display modes.
Desktop: W=1920 H=1080 B=32 HZ=60. CXVS=1920 CYVS=1080
clipboard_init
Controller #0: Logitech F710 Gamepad (XInput)
      GUID: 030000006d0400001fc2000005030000
Controller 0 is mapped as "030000006d0400001fc2000005030000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,".
Retroarch controller cfg file found, using that for mapping
Controller Detection: input_enable_hotkey_btn : 6
Controller Detection: input_exit_emulator_btn : -1
Controller Detection: input_reset_btn : -1
Controller Detection: input_b_btn : 0
Controller Detection: input_a_btn : 1
Controller Detection: input_y_btn : 2
Controller Detection: input_x_btn : 3
Controller Detection: input_select_btn : -1
Controller Detection: input_menu_toggle_btn : -1
Controller Detection: input_start_btn : 7
Controller Detection: input_l3_btn : 9
Controller Detection: input_r3_btn : 10
Controller Detection: input_l_btn : 4
Controller Detection: input_r_btn : 5
Controller Detection: input_up_btn : -1
Controller Detection: input_down_btn : -1
Controller Detection: input_left_btn : -1
Controller Detection: input_right_btn : -1
Controller Detection: left : -1
Controller Detection: right : -1
Controller Detection: up : -1
Controller Detection: down : -1
Controller Detection: a : -1
Controller Detection: b : -1
Controller Detection: input_l_x_plus_axis : 0
Controller Detection: input_l_y_plus_axis : 1
Controller Detection: input_r_x_plus_axis : 2
Controller Detection: input_r_y_plus_axis : 3
Controller Detection: input_l2_axis : -1
Controller Detection: input_r2_axis : -1
Controller Detection: count_hats : 1
Controller Detection: invert left  y axis: 0
Controller Detection: invert left  x axis: 0
Controller Detection: invert right y axis: 0
Controller Detection: invert right x axis: 0
KS ver = 34 (0x22)
Stored port 0/0 d=0: added 200 0  
Stored port 0/0 d=0: added 200 0 System mouse MOUSE0
Port0: ID 'mouse' matched
Stored port 1/0 d=0: added 100 0  
Stored port 1/0 d=0: added 100 0 Logitech F710 Gamepad (XInput) JOY0
Port1: ID 'joy0' matched
Port2: NONE
Port3: NONE
target_cfgfile_load(): load file /home/pi/Amiga_files/conf/default.uae
load config '/home/pi/Amiga_files/conf/default.uae':3
cfgfile_load_2 failed
KS ver = 34 (0x22)
Stored port 0/0 d=0: added 200 0  
Stored port 0/0 d=0: added 200 0 System mouse MOUSE0
Port0: ID 'mouse' matched
Stored port 1/0 d=0: added 100 0  
Stored port 1/0 d=0: added 100 0 Logitech F710 Gamepad (XInput) JOY0
Port1: ID 'joy0' matched
Port2: NONE
Port3: NONE
failed to load config '/home/pi/Amiga_files/conf/default.uae'
KS ver = 34 (0x22)
Stored port 0/0 d=1: added 200 0 System mouse MOUSE0
Port0: COMBO 'System mouse' + 'MOUSE0' matched
Stored port 1/0 d=1: added 100 0 Logitech F710 Gamepad (XInput) JOY0
Port1: COMBO 'Logitech F710 Gamepad (XInput)' + 'JOY0' matched
Port2: NONE
Port3: NONE
Autoconfig board list:
Card 01: 'UAE Boot ROM' no autoconfig 00f00000 - 00f0ffff.
Card 02: 'UAE FS ROM'
  d1.52.40.00.07.db.00.00.00.03.20.00.00.00.00.00
  MID 2011 (07db) PID 82 (52) SER 00000003
  Z2 0x00e90000 0x00e90000   64K ROM 0
END
Could not create color cursor: Cursors are not currently supported
Autoconfig board list:
END
Stored port 0/1 d=0: added 200 0 System mouse MOUSE0
Stored port 1/1 d=0: added 100 0 Logitech F710 Gamepad (XInput) JOY0
target_cfgfile_load(): load file /home/pi/Amiga_files/conf/A4000-test.uae
load config '/home/pi/Amiga_files/conf/A4000-test.uae':3
KS ver = 40 (0x28)
Stored port 0/1 d=0: added 200 0 System mouse MOUSE0
Port0: COMBO 'System mouse' + 'MOUSE0' matched
Stored port 1/1 d=0: added 100 0 Logitech F710 Gamepad (XInput) JOY0
Port1: COMBO 'Logitech F710 Gamepad (XInput)' + 'JOY0' matched
Port2: NONE
Port3: NONE
Stored port 0/1 d=0: added 200 0 System mouse MOUSE0
Stored port 1/1 d=0: added 100 0 Logitech F710 Gamepad (XInput) JOY0
Autoconfig board list:
Card 01: '<no name>' no autoconfig 00dd2020 - 00dd301f.
Card 02: 'UAE Boot ROM' no autoconfig 00f00000 - 00f0ffff.
Card 03: 'UAE FS ROM'
  d1.52.40.00.07.db.00.00.00.03.20.00.00.00.00.00
  MID 2011 (07db) PID 82 (52) SER 00000003
  Z2 0x00e90000 0x00e90000   64K ROM 0
Card 04: 'Z3 Fast RAM'
  a0.53.9a.00.07.db.00.00.00.01.00.00.00.00.00.00
  MID 2011 (07db) PID 83 (53) SER 00000001
  Z3 0x40000000 0x40000000   16M RAM 0
END
Autoconfig board list:
Card 01: '<no name>' no autoconfig 00dd2020 - 00dd301f.
Card 02: 'UAE Boot ROM' no autoconfig 00f00000 - 00f0ffff.
Card 03: 'UAE FS ROM'
  d1.52.40.00.07.db.00.00.00.03.20.00.00.00.00.00
  MID 2011 (07db) PID 82 (52) SER 00000003
  Z2 0x00e90000 0x00e90000   64K ROM 0
Card 04: 'Z3 Fast RAM'
  a0.53.9a.00.07.db.00.00.00.01.00.00.00.00.00.00
  MID 2011 (07db) PID 83 (53) SER 00000001
  Z3 0x40000000 0x40000000   16M RAM 0
END
KS ver = 40 (0x28)
Stored port 0/1 d=0: added 200 0 System mouse MOUSE0
Port0: COMBO 'System mouse' + 'MOUSE0' matched
Stored port 1/1 d=0: added 100 0 Logitech F710 Gamepad (XInput) JOY0
Port1: COMBO 'Logitech F710 Gamepad (XInput)' + 'JOY0' matched
Port2: NONE
Port3: NONE
Stored port 0/1 d=0: added 200 0 System mouse MOUSE0
Stored port 1/1 d=0: added 100 0 Logitech F710 Gamepad (XInput) JOY0
Autoconfig board list:
Card 01: '<no name>' no autoconfig 00dd2020 - 00dd301f.
Card 02: 'UAE Boot ROM' no autoconfig 00f00000 - 00f0ffff.
Card 03: 'UAE FS ROM'
  d1.52.40.00.07.db.00.00.00.03.20.00.00.00.00.00
  MID 2011 (07db) PID 82 (52) SER 00000003
  Z2 0x00e90000 0x00e90000   64K ROM 0
Card 04: 'Z3 Fast RAM'
  a0.53.9a.00.07.db.00.00.00.01.00.00.00.00.00.00
  MID 2011 (07db) PID 83 (53) SER 00000001
  Z3 0x40000000 0x40000000   16M RAM 0
END
KS ver = 40 (0x28)
Stored port 0/1 d=0: added 200 0 System mouse MOUSE0
Stored port 1/1 d=0: added 100 0 Logitech F710 Gamepad (XInput) JOY0
RTAREA located at 00F00000
mapped_malloc(): 0x00f00000 - 0x00f10000 (0x20f00000 - 0x20f10000) -> UAE Boot ROM (rtarea)
TRAP_ENTRY = 00f01eda
mapped_malloc(): 0x40000000 - 0x40800000 (0x60000000 - 0x60800000) -> Zorro III Fast RAM (*)
mapped_malloc(): 0x00f80000 - 0x01000000 (0x20f80000 - 0x21000000) -> Kickstart ROM (kick)
mapped_malloc(): 0x00000000 - 0x00200000 (0x20000000 - 0x20200000) -> Chip memory (chip)
ROM loader.. (<none>)
Known ROM 'KS ROM v3.1 (A4000)' loaded
ROM loader end
memory init end
No disk in drive 0.
Resetting frame rate hack
1867 CPU functions
Getting Current Video Driver...
Current Display mode: bpp 32    SDL_PIXELFORMAT_ARGB8888    1920 x 1080 50Hz
Creating Amiberry window...
SDL2: Set window not to minimize on focus loss
Stored port 0/1 d=0: added 200 0 System mouse MOUSE0
Stored port 1/1 d=0: added 100 0 Logitech F710 Gamepad (XInput) JOY0
Resetting frame rate hack
Building CPU, 45926 opcodes (3 0 0)
JIT popallspace: 0x7f7d4a2000-0x7f7d4a2800
Actual translation cache size : 16384 KB at 0x7f7d4a2800-0x7f7e4a2800
CPU=68030, FPU=68882 (host), JIT=CPU/FPU=16384. fast
clipboard: reset (00000000)
memory init end
uae_start_thread "filesys" function at 0x557ed244d0 arg 0x5581f457e8
Reset at 00000000. Chipset mask = 00000007
PAL mode V=50.0804Hz H=15625.0879Hz (227x312+0) IDX=10 (PAL) D=0 RTG=0/0
Buffer 0 size (640*256) Native
RTGFREQ: 312*50.0804 = 15625.0879 / 50.1 = 312
Autoconfig board list:
Card 01: '<no name>' no autoconfig 00dd2020 - 00dd301f.
Card 02: 'UAE Boot ROM' no autoconfig 00f00000 - 00f0ffff.
Card 03: 'UAE FS ROM'
  d1.52.40.00.07.db.00.00.00.03.20.00.00.00.00.00
  MID 2011 (07db) PID 82 (52) SER 00000003
  Z2 0x00e90000 0x00e90000   64K ROM 0
Card 04: 'Z3 Fast RAM'
  a0.53.9a.00.07.db.00.00.00.01.00.00.00.00.00.00
  MID 2011 (07db) PID 83 (53) SER 00000001
  Z3 0x40000000 0x40000000   16M RAM 0
END
uae_start_thread "ide" function at 0x557ed5d290 arg 0x55820ade40
Card 0: skipping autoconfig (not autoconfig)
Card 1: skipping autoconfig (not autoconfig)
hardreset, memory cleared
SNDRATE 312.0*227.0*50.080410=3546894.958099
SERIAL: period=372, baud=9600, hsyncs=14, bits=8, PC=f8012e
mapped_malloc(): 0x00e90000 - 0x00ea0000 (0x20e90000 - 0x20ea0000) -> Filesystem autoconfig (*)
Card 3: Z2 0x00e90000   64K ROM Filesystem autoconfig
Card 4: Z3 0x40000000   16M RAM Zorro III Fast RAM
filesystem: diagentry 40000098 configdev 00000c00
Gary timeout: 07f7fff0 2 R PC=00000482
Gary timeout: 07f7fff4 2 R PC=00000482
Gary timeout: 07f7fff8 2 R PC=00000482
Gary timeout: 07f7fffc 2 R PC=00000482
Gary timeout: 07f7fff0 2 W PC=00000488
Gary timeout: 07f7fff4 2 W PC=0000048a
Gary timeout: 07f7fff8 2 W PC=0000048c
Gary timeout: 07f7fffc 2 W PC=0000048e
Gary timeout: 07f7fffc 2 R PC=000004a6
Gary timeout: 07f7fff0 2 W PC=000004c8
Gary timeout: 07f7fff4 2 W PC=000004c8
Gary timeout: 07f7fff8 2 W PC=000004c8
Gary timeout: 07f7fffc 2 W PC=000004c8
waiting_blits detected PC=00faaca2
SNDRATE 313.0*227.0*49.920410=3546895.062012
PAL mode V=49.9204Hz H=15625.0879Hz (227x312+1) IDX=10 (PAL) D=0 RTG=0/0
Mounting uaehf.device:0 0 (0):
FS: mounted virtual unit DH0 (/home/pi/Amiga_files/hdd/System)
FS: System (flags=00000002,E=0,ED=1,EF=0,native='/home/pi/Amiga_files/hdd/System') starting..
--- New exception ---
Error not in JIT code.
Segmentation Fault
info.si_signo = 11
info.si_errno = 0
info.si_code = -6
info.si_addr = 00005367
x00  = 0x0000000000000000
x01  = 0x0000007fdc350948
x02  = 0x0000000000000000
x03  = 0x0000000000000008
x04  = 0x0000000000000000
x05  = 0x0000007fdc350948
x06  = 0xffffffffffffffff
x07  = 0xffffffffffffffff
x08  = 0x0000000000000087
x09  = 0xffffffffffffffff
x10  = 0xffffffffffffffff
x11  = 0xffffffffffffffff
x12  = 0xffffffffffffffff
x13  = 0xffffffffffffffff
x14  = 0x0000000000000008
x15  = 0x00000000000000a0
x16  = 0x0000007f899c7000
x17  = 0x0000007f894b22d0
x18  = 0x0000005583085830
x19  = 0x0000007f899c6000
x20  = 0x000000000000000b
x21  = 0x0000007fdc350b80
x22  = 0x0000007fdc350b00
x23  = 0x000000557f6df000
x24  = 0x0000005582fc57c8
x25  = 0x0000000000000000
x26  = 0x0000005582ee3ba0
x27  = 0x0000000020000000
x28  = 0x0000005582ee3ba0
x29  = 0x0000007fdc350920
x30  = 0x0000007f899af314
SP  = 0x0000007fdc350920
PC  = 0x0000007f899af384
Fault Address = 0x00000000e0000142
pstate  = 0x0000000000000000
LR - 0x899AF314: <raise> (/lib/aarch64-linux-gnu/libpthread.so.0)
Stack trace:
0x7ee479a0 <(null) + 0x7ee479a0> (./amiberry)
0x89bb37c0 <__kernel_rt_sigreturn + 0x00000000> (linux-vdso.so.1)
0x899af384 <raise + 0x000000ac> (/lib/aarch64-linux-gnu/libpthread.so.0)
0x89b0f0bc <(null) + 0x89b0f0bc> (/usr/local/lib/libSDL2-2.0.so.0)
0x89bb37c0 <__kernel_rt_sigreturn + 0x00000000> (linux-vdso.so.1)
Stack trace (non-dedicated):
./amiberry(+0x307a20) [0x557ee47a20]
linux-vdso.so.1(__kernel_rt_sigreturn+0) [0x7f89bb37c0]
/lib/aarch64-linux-gnu/libpthread.so.0(raise+0xac) [0x7f899af384]
/usr/local/lib/libSDL2-2.0.so.0(+0xfd0bc) [0x7f89b0f0bc]
linux-vdso.so.1(__kernel_rt_sigreturn+0) [0x7f89bb37c0]
[0x7f7d5a6f78]
End of stack trace.
--- end exception ---

Love Amiberry? Please consider supporting our collective: 👉 https://opencollective.com/amiberry/donate

boras-pl commented 3 years ago

I probably (90%) had the same issue while I was experimenting with Manjaro. Unfortunately I didn't investigated it enough. I was convinced that it must be smth wrong with my Manjaro environment, so I gave up that time.

midwan commented 3 years ago

It seems that JIT crashed. Could you isolate what exactly tried to run when this happened? That would help in recreating this and forwarding the bug report to TomB, who's working on the JIT engine for ARM.

boras-pl commented 3 years ago

Yes, it is a JIT problem. When I disable this, then it helps. I suspect that some BetterWB specific library or an executable causes the problem. I'll do my best.

boras-pl commented 3 years ago

The problem occurs while dealing with icon.library. Removing it from DH0:/Libs helped. BetterWB replaces the original library included in Kickstart with a modern 46.4.473 (68000) version. First, I checked the newest 68000, 68020 and TC020 versions from the official package: http://aminet.net/package/util/libs/IconLib_46.4 and it did not change anything. Then I looked at Startup-sequence and found this:

if exists Sys:Libs/icon.library
RemLib >nil: icon.library
endif

It is enough to comment out the lines or remove the DH0:/Libs/icon.library file to get rid of the problem. However this is not a problem with icon.library but rather with RemLib. RemLib is a tool that comes from http://aminet.net/package/util/libs/IconLib_46.4 as well. It unloads the default implementation of icon.library placed in Kickstart ROM. I checked md5 and RemLib from BetterWB is the same as the file from IconLib_46.4. This tool is quite short (1700 bytes), so I hope you will be able to trace what happens in JIT while executing it.

As the modern icon.library is widely used in Amiga world I am afraid that it is a serious problem for v4.1.2. I haven't try to work the problem around by using LoadModule or any other method that could replace RemLib. Anyway, Amiberry v3.3 had not the issue. The only thing that I do not understand is why on Earth it works when I start the emulator from Midnight Commander.

TL;DR

boras-pl commented 3 years ago

The workaround for the problem is:

midwan commented 3 years ago

Does this only happen on RetroPie/RPI OS? I can't recreate this on Manjaro at least, with a 3.9 or 3.1 system. I tested booting with no S-S, and only running RemLib icon.library (which worked fine), then I also tested Loadmodule icon.library which also worked fine. I used the latest version of IconLib from Aminet...

midwan commented 3 years ago

I've also tested 32-bit RPI OS, with the same scenario above - still no crash for me. Perhaps I'm missing something, I'll try setting up the whole BetterWB thing later.

boras-pl commented 3 years ago

The issue is quite old. I'll check this again soon.

bugjacobs commented 1 year ago

I get this on Linux Mint 5.6 too on an i3 haswell PC :-/ Memory segmentation fault - when launching. EDIT: Sorry to necromance a thread :-) And I can inform it seems I solved the problem by compiling from source myself !

midwan commented 1 year ago

I get this on Linux Mint 5.6 too on an i3 haswell PC :-/ Memory segmentation fault - when launching. EDIT: Sorry to necromance a thread :-) And I can inform it seems I solved the problem by compiling from source myself !

Thanks for reporting - it might be some issue with the pre-compiled binary vs the environment you're running it on. The pre-compiled one is prepared in a docker container running Debian, perhaps there's some difference between that and Mint that triggers this problem.