Re: [hatari-devel] memory setup segfault

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Le 06/11/2023 à 20:30, Thomas Huth a écrit :

I can reproduce the crash, but only with --enable-debug.

I can also reproduce it by starting without hatari.cfg with:

  hatari --machine ste --tos tos206fr.rom --memsize 14

Then go to the GUI, select 1 MB and return from the GUI.

Thanks, I can get the crash too with this scenario.

This is similar to previous crash when going from falcon to st with >= 4MB , MMU conf at ff8001 will store 0xf (invalid size for both memory banks) and MMU_Bank0_Size will be set to 0 at start, but will also keeps its 0 value after reset when calling memory_init with <= 4 MB, which calls memory_map_Standard_RAM and trigger the crash

I will look for a correct place to ensure MMU_Bank0_Size has a correct value in these cases.

Nicolas


It seems like hLogFile gets overwritten with garbage at one point in time -
if I set a watch to that in gdb, I get this backtrace:

#0  map_banks2 (bank=bank@entry=0x10cc3e0 <STmem_bank_MMU>, start=start@entry=1, size=65535,
     realsize=<optimized out>, quick=quick@entry=0)
     at /home/thomas/devel/hatari/git/src/cpu/memory.c:1960
#1  0x000000000049efa1 in map_banks_ce (bank=bank@entry=0x10cc3e0 <STmem_bank_MMU>,
     start=start@entry=1, size=size@entry=-1, realsize=realsize@entry=0,
     banktype=banktype@entry=1, cachable=cachable@entry=129)
     at /home/thomas/devel/hatari/git/src/cpu/memory.c:1988
#2  0x000000000049f12d in memory_map_Standard_RAM (MMU_Bank0_Size=0, MMU_Bank1_Size=0)
     at /home/thomas/devel/hatari/git/src/cpu/memory.c:1614
#3  0x000000000049f5de in memory_init (NewSTMemSize=<optimized out>,
     NewTTMemSize=<optimized out>, NewRomMemStart=14680064)
     at /home/thomas/devel/hatari/git/src/cpu/memory.c:1748
#4  0x0000000000448fda in TOS_InitImage () at /home/thomas/devel/hatari/git/src/tos.c:1135
#5  0x000000000043b709 in Reset_ST (bCold=bCold@entry=true)
     at /home/thomas/devel/hatari/git/src/reset.c:61
#6  0x000000000043b88d in Reset_Cold () at /home/thomas/devel/hatari/git/src/reset.c:139
#7  0x00000000004109ad in Change_CopyChangedParamsToConfiguration (
     current=current@entry=0x7ffffffbb580, changed=<optimized out>, bForceReset=<optimized out>)
     at /home/thomas/devel/hatari/git/src/change.c:504
#8  0x0000000000412796 in Dialog_DoProperty () at /home/thomas/devel/hatari/git/src/dialog.c:70
#9  0x0000000000444587 in ShortCut_ActKey ()
     at /home/thomas/devel/hatari/git/src/shortcut.c:297
#10 0x000000000044f6e8 in Video_InterruptHandler_VBL ()
     at /home/thomas/devel/hatari/git/src/video.c:4630
#11 0x0000000000412498 in CycInt_CallActiveHandler (Clock=<optimized out>)
     at /home/thomas/devel/hatari/git/src/cycInt.c:548
#12 0x00000000004823df in CycInt_Process_stop (stop_cond=0)
     at /home/thomas/devel/hatari/git/src/includes/cycInt.h:92
#13 m68k_run_1_ce () at /home/thomas/devel/hatari/git/src/cpu/newcpu.c:5587
#14 0x0000000000484404 in m68k_go (may_quit=may_quit@entry=1)
     at /home/thomas/devel/hatari/git/src/cpu/newcpu.c:7798
--Type <RET> for more, q to quit, c to continue without paging--
#15 0x0000000000430e9a in M68000_Start () at /home/thomas/devel/hatari/git/src/m68000.c:307
#16 0x00000000004325d3 in main (argc=<optimized out>, argv=<optimized out>)
     at /home/thomas/devel/hatari/git/src/main.c:983

Seems like something goes wrong in map_banks2() ?

  Thomas




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/