lxdream.org :: Issues
lxdream 0.9.1
released Jun 29
Download Now

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000068lxdreamSH4public2009-05-14 08:482009-05-24 01:31
Assigned Tonkeynes 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000068: sh4_finalize_instruction: Assertion `(sh4_icache.page_vma == ((sh4r.pc) & sh4_icache.mask))' failed.
DescriptionRan into this while trying a test:
gdb --args ./lxdream /usr/local/dc/kos/examples/dreamcast/hello/hello.elf
GNU gdb 6.8-debian
Copyright (C) 2008 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 "x86_64-linux-gnu"...
(gdb) r
Starting program: /home/harley/Downloads/lxdream/src/lxdream /usr/local/dc/kos/examples/dreamcast/hello/hello.elf
[Thread debugging using libthread_db enabled]
[New Thread 0x7f877b7e5810 (LWP 8389)]
[New Thread 0x7f8766f42950 (LWP 8399)]
[Thread 0x7f8766f42950 (LWP 8399) exited]
[New Thread 0x7f8766f42950 (LWP 8400)]
[New Thread 0x7f8766741950 (LWP 8401)]
10:24:32 A0000000 WARN Unable to load file 'IP.BIN': No such file or directory

KallistiOS ##version##: Wed May 13 13:39:27 CDT 2009
thd: pre-emption enabled, HZ=100
10:24:32 8C021B6E WARN ARM Halted: BRANCH to invalid address FFFFFFE8 at 00000004
maple: active drivers:
    Dreameye (Camera): Camera
    Sound Input Peripheral: Microphone
    PuruPuru (Vibration) Pack: JumpPack
    VMU Driver: Clock, LCD, MemoryCard
    Mouse Driver: Mouse
    Keyboard Driver: Keyboard
    Controller Driver: Controller
  DMA Buffer at ac0923c0
vid_set_mode: 640x480IL NTSC
fs_romdisk: mounting image at 0x8c0489d4 at /rd
dc-load console support enabled
maple: attached devices:
  A0: Dreamcast Controller (01000000: Controller)

Hello world!

fs_iso9660: disc change detected
arch: shutting down kernel
net_unreg_device: 'bba' isn't registered
maple: final stats -- device count = 1, vbl_cntr = 4, dma_cntr = 4
vid_set_mode: 640x480IL NTSC
fs_romdisk: unmounting image at 0x8c0489d4 from /rd
max system bytes = 147908
system bytes = 147908
in use bytes = 5852
KM_DBG: Still-allocated memory blocks:
  INUSE 8c0ac578: size 12, thread 1, addr 8c0104d8, type malloc
  INUSE 8c0abf70: size 1024, thread 1, addr 8c03f594, type malloc
  INUSE 8c091280: size 2, thread 1, addr 8c040a82, type malloc
  INUSE 8c090be8: size 12, thread 1, addr 8c0104d8, type malloc
  INUSE 8c0909c0: size 12, thread 1, addr 8c02dd94, type malloc
  INUSE 8c08ebf0: size 12, thread 1, addr 8c01e8f2, type malloc
  INUSE 8c08e5e8: size 1024, thread 1, addr 8c03f594, type malloc
lxdream: ./sh4/sh4core.in:242: sh4_finalize_instruction: Assertion `(sh4_icache.page_vma == ((sh4r.pc) & sh4_icache.mask))' failed.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7f877b7e5810 (LWP 8389)]
0x00007f8777b27fb5 in raise () from /lib/libc.so.6
(gdb) bt
#0 0x00007f8777b27fb5 in raise () from /lib/libc.so.6
0000001 0x00007f8777b29bc3 in abort () from /lib/libc.so.6
0000002 0x00007f8777b20f09 in __assert_fail () from /lib/libc.so.6
0000003 0x000000000041d8a8 in sh4_finalize_instruction () at ./sh4/sh4core.in:242
0000004 0x00000000004189b5 in sh4_core_exit (exit_code=2) at sh4/sh4.c:306
0000005 0x0000000000416f2e in dreamcast_stop () at dreamcast.c:255
0000006 0x0000000000410793 in dcload_syscall (syscall_id=8389) at dcload.c:151
0000007 0x00000000004509fd in sh4_translate_run_slice (nanosecs=1000000) at sh4/sh4trans.c:50
0000008 0x0000000000418b39 in sh4_run_slice (nanosecs=1000000) at sh4/sh4.c:271
0000009 0x000000000041728f in dreamcast_run () at dreamcast.c:233
0000010 0x0000000000456cfd in gui_main_loop (run=1) at gtkui/gtkui.c:251
0000011 0x000000000040c9f0 in main (argc=2, argv=0x7fff8392de68) at main.c:270

and here's the code (don't laugh since I was just doing a quick test) that causes the crash:
cat hello.c
#include <kos.h>
extern uint8 romdisk[];

int main(int argc, char **argv) {
    printf("\nHello world!\n\n");
    file_t cd = fs_open("/cd", O_DIR);
        return 1;

    dirent_t *cddir;
    while((cddir = fs_readdir(cd)))
        printf("%s\n", cddir->name);

    return 0;

I'm not currently able to test it on real hardware, but it /should/ work. When I get home from work tonight I'll give it a try. Attached is the crash log in case this butchers the formatting of the code and backtrace.
Additional InformationThis was against SVN Rev 1033
TagsNo tags attached.
Attached Files? file icon lxdream.crash [^] (3,983 bytes) 2009-05-14 08:48

- Relationships

-  Notes
nkeynes (administrator)
2009-05-24 00:50

D'oh. Yeah your code is fine, it's crashing when it tries to halt after program completion. Stupid bug on my part, will fix shortly.
nkeynes (administrator)
2009-05-24 01:31

Fixed in r1034

- Issue History
Date Modified Username Field Change
2009-05-14 08:48 losinggeneration New Issue
2009-05-14 08:48 losinggeneration File Added: lxdream.crash
2009-05-24 00:50 nkeynes Note Added: 0000077
2009-05-24 01:31 nkeynes Status new => resolved
2009-05-24 01:31 nkeynes Resolution open => fixed
2009-05-24 01:31 nkeynes Assigned To => nkeynes
2009-05-24 01:31 nkeynes Note Added: 0000078