Re: [hatari-devel] Problems with some FPU tests

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


Am Mon, 23 Apr 2018 15:18:00 +0200
schrieb Thorsten Otto <admin@xxxxxxxxxxx>:

> while trying to write some FPU related tests, i git some strange
> problems.
> 
> When running the test from cmake (via a script similar to the one of
> tests/ xbios/run_test.sh, that sets up a temporary test directory,
> set HOME to that directory etc.) i get following output (when setting
> --trace debug):

You mean "--log-level debug" instead of "--trace debug"? But below, you
use --log-level fatal? Also below you already use --cpulevel 3 ... not
--cpulevel 0 as you mention it later?

> HOME=/tmp/tmp.kfs1Fr1RDQ /home/sebilla/atari/hatari/src/hatari
> --log-level fatal --sound off --cpuclock 32 --tos none
> -d /tmp/tmp.kfs1Fr1RDQ --run-vbls 500 --bios-intercept on --cpulevel
> 3 /home/sebilla/atari/hatari/tests/cpu/ test-inf.ttp
> Sound OFF, frequency = 44100.
> Exit after 500 VBLs.
> XBIOS 11/20/255 Hatari versions enabled: Dbmsg(), Scrdmp(),
> HatariControl(). Hatari v2.1.0, compiled on:  Apr 20 2018, 16:24:00
> Video_SetSystemTimings 0 3 -> 2 (WS3) 503 503 64
> Configured max Hatari resolution = 832x588, optimal for ST = 832x588
> STMemory_RAM_SetBankSize total=1024 KB bank0=512 KB bank1=512 KB MMU=5
> update cyc speed 0 throttle 0.000000 clock_mult 512
> CPU cycleunit: 256 (0.500)
> CPU cycleunit: 256 (0.500)
> 1870 CPU functions
> Building CPU, 45926 opcodes (3 -2 1)
> CPU=68030, FPU=0, MMU=0, JIT=0. ~cycle-exact 24-bit
> Sound: Disabled
> Checking GEMDOS C: HDD: /home/sebilla/atari/hatari/tests/cpu
> GEMDOS HDD emulation, C: <-> /home/sebilla/atari/hatari/tests/cpu.
> memory_map_Standard_RAM total=1048576 ram0=524288 ram1=524288
> mmu0=131072 mmu1=131072
> Loaded TOS version 0.00, starting at $e00000, country code = 0, PAL
> Skipped TOS patches.
> Loading '/home/sebilla/atari/hatari/tests/cpu/test-inf.ttp' to 0x1100.
> Video_SetSystemTimings 0 3 -> 2 (WS3) 503 503 64
> Video_SetSystemTimings 0 3 -> 2 (WS3) 503 503 64
> NVRAM not found at '/tmp/tmp.kfs1Fr1RDQ/.config/hatari/hatari.nvram'
> Host system has accurate delays. (1)
> update cyc speed 0 throttle 0.000000 clock_mult 512
> CPU cycleunit: 256 (0.500)
> CPU cycleunit: 256 (0.500)
> m68k_run_2ce
> CPU reset PC=e00034 (ROM memory)..
> memory_map_Standard_RAM total=1048576 ram0=524288 ram1=524288
> mmu0=524288 mmu1=524288
> Illegal instruction: 19f3 at 00000422 -> 00000000
[...]
> Detected double bus/address error => CPU halted!
> exit m68k_run
> 
> At this point hatari (and the script) exits with status 0.

Exit status 0 sounds indeed wrong in this case ... I think we should
rather quit with non-zero status here.

> Not what i 
> expected. Note that the arguments incidently included --cpulevel 0,
> so no FPU support.

Well, that explains the ugly crash: The "--tos none" mode does not set
up any exception handlers, so if you get an exception, the CPU jumps to
address 0 and thus leads to this ugly list of illegal exceptions.

> When i try the same from the commandline (without setting HOME, so
> the default configuration is loaded first. which in my case is set to
> 030+fpu), i get:
> 
> SDL_AUDIODRIVER=dummy
> SDL_VIDEODRIVER=dummy /home/sebilla/atari/hatari/src/ hatari
> --log-level debug --sound off --cpuclock 32 --tos none --natfeats on
> -- bios-intercept on --vdi off - -run-vbls 500 --cpulevel
> 0 ./test-inf.ttp Sound OFF, frequency = 44100. 

Now --cpulevel 0 ? ... copy-n-paste bug?

> Native Features enabled. 
> XBIOS 11/20/255 Hatari versions enabled: Dbmsg(), Scrdmp(),
> HatariControl(). Exit after 500 VBLs. 
> FPU is not supported in 68000/010 configurations, disabling FPU 
> Hatari v2.1.0, compiled on:  Apr 20 2018, 16:24:00 
> Video_SetSystemTimings 4 3 -> 5 (TT) 500 500 68 
> Configured max Hatari resolution = 1280x960, optimal for ST = 832x588 
> Inserted disk '/home/sebilla/.stonx/new_disk.st' to drive A:. 
> update cyc speed 0 throttle 0.000000 clock_mult 512 
> CPU cycleunit: 256 (0.500) 
> 1870 CPU functions 
> Building CPU, 44274 opcodes (0 0 1) 
> CPU=68000, FPU=0, MMU=0, JIT=0. 24-bit 
> Sound: Disabled 
> Checking GEMDOS C: HDD: /home/sebilla/atari/hatari/tests/cpu 
> GEMDOS HDD emulation, C: <-> /home/sebilla/atari/hatari/tests/cpu. 
> memory_map_Standard_RAM total=14680064 ram0=0 ram1=0 mmu0=2097152
> mmu1=0 Loaded TOS version 0.00, starting at $e00000, country code =
> 0, PAL Skipped TOS patches. 
> Loading './test-inf.ttp' to 0x1100. 
> Video_SetSystemTimings 4 3 -> 5 (TT) 500 500 68 
> Video_SetSystemTimings 4 3 -> 5 (TT) 500 500 68 
> Host system has accurate delays. (1) 
> update cyc speed 0 throttle 0.000000 clock_mult 512 
> CPU cycleunit: 256 (0.500) 
> m68k_run_2 
> CPU reset PC=e00034 (ROM memory).. 
> memory_map_Standard_RAM total=14680064 ram0=0 ram1=0 mmu0=2097152
> mmu1=0 Illegal instruction: 00fa at 00000084 -> 00000000 
> Illegal instruction: 00fa at 00000084 -> 00000000 
[...]
> Illegal instruction: 00fa at 00000084 -> 00000000
> Segmentation fault

Hatari should certainly not segfault in this case. Could you attach a
gdb and get a backtrace? Or could you provide your test-inf.ttp so I
could have a try?

> At this point hatari gets a segmentation fault. Any ideas?

Please run Hatari with "--trace cpu_disasm" and pipe stderr into a file
(or into a pager like "less"). Then look for the place where the CPU
jumps to an address below 0x1000 - right before that point in time,
something must have went wrong.

 Thomas



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