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

null pointer dereference during DMA in Star Wars Episode I Jedi Power Battles #74

Open
snickerbockers opened this issue Jan 2, 2020 · 1 comment

Comments

@snickerbockers
Copy link
Member

No time to look into this in-depth tonight, but it looks like somehow it's trying to do an empty DMA xfer?

This bug is not consistently reproducible, but it is common enough that it can be reproduced with patience. Happens right after the Lucas Arts logo at the beginning.

(gdb) p src_region
$2 = (struct memory_map_region *) 0x0
(gdb) bt
#0  0x000055b377ff8b2d in sh4_dmac_transfer_words (sh4=0x55b3785f7f60 <cpu>, transfer_src=0, transfer_dst=0, n_words=0)
    at /home/jay/programs/washingtondc/src/libwashdc/hw/sh4/sh4_dmac.c:382
#1  0x000055b37804a07a in g2_dma_ad_xfer (src_addr=0, dst_addr=0, n_bytes=0)
    at /home/jay/programs/washingtondc/src/libwashdc/hw/g2/g2_reg.c:347
#2  0x000055b378049bee in g2_dma_write_st (ch=0x55b37853ec20 <dma_ch_ad>, val=1)
    at /home/jay/programs/washingtondc/src/libwashdc/hw/g2/g2_reg.c:188
#3  0x000055b37804a0ee in adst_reg_write (region=0x55b37ac55060 <mmio_region_g2_reg_32>, idx=6, val=1, ctxt=0x0)
    at /home/jay/programs/washingtondc/src/libwashdc/hw/g2/g2_reg.c:357
#4  0x000055b3780497d1 in mmio_region_g2_reg_32_write (region=0x55b37ac55060 <mmio_region_g2_reg_32>, addr=6256664, val=1)
    at /home/jay/programs/washingtondc/src/libwashdc/hw/g2/g2_reg.c:130
#5  0x000055b378049ed1 in g2_reg_write_32 (addr=6256664, val=1, ctxt=0x0)
    at /home/jay/programs/washingtondc/src/libwashdc/hw/g2/g2_reg.c:299
#6  0x00007f0c1048e118 in ?? ()
#7  0x0000000000000001 in ?? ()
#8  0x00000000a05f7814 in ?? ()
#9  0x0000000000000005 in ?? ()
#10 0x00000000a05f7810 in ?? ()
#11 0x0000000000000000 in ?? ()
(gdb) 

@snickerbockers
Copy link
Member Author

G2: Write 0x00000000 to aden
G2: Read 0x00000000 from adst
G2: Write 0x00000000 to aden
G2: Write 0x00000000 to adstag
G2: Write 0x00000000 to adstar
G2: Write 0x00000000 to adlen
G2: Write 0x00000000 to addir
G2: Write 0x00000005 to adtsel
G2: Write 0x00000001 to aden
G2: Write 0x00000001 to adst

snickerbockers added a commit that referenced this issue Jan 2, 2020
this does not resolve issue #74, but it does give some proper error checking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant