joyrider
Active Member
Okay, i've been having some issues with my gp2x and a game i've written. The game uses SDL and SDL_Mixer nothing special about that. However whenever my game is running from within the cradle and i'm absolutely doing nothing (just letting it loop in the main menu) the game will crash after a random time and the gp2x will become unresponsive (no music, sound, joystick (external & the default one) will not react, usbnet stops working etc) basicly it seems as if the gp2x has frozen up on me. so i went out and bought a serial cable to use with the cradle and ive gotten more info about the problem. it seems i'm getting a kernel panic due to a dereference of a null pointer or sumthing. I've managed to log it all. (see further in thread) I've tested Squares from guyfawkes and it has a similar problem, when i let it run in the main menu after some time it will do the exact same thing, freezing up etc. but it doesn't give me the extended error information i'm getting like with my game. The only things i can see is that both games use SDL and SDL_Mixer (not sure if squares is actually using sdl_mixer but it is using SDL). Also i've let the game run outside the cradle for a whole night and it was still running when i woke up, it didn't crash, when running it from within the cradle it crashes almost instantly especially if tvout is on. (I'm using a power adaptor for both gp2x and cradle, the adaptor for cradle is the one from ed's shop )
here's the complete log from when the gp2x has started up, up until the crash (for the error, scroll all the way down).
CODE
U-Boot 1.0.0 (Apr 20 2006 - 12:51:09)
U-Boot code: 03E00000 -> 03E49610 BSS: -> 03E82208
IRQ Stack: 03ea3204
FIQ Stack: 03ea4204
DRAM Configuration:
Bank #0: 00100000 63 MB
Flash: 0 kB
NAND
robing at 0x9c000000
Flash chip found:
Manufacturer ID: 0xEC, Chip ID: 0x76 (Samsung K9F1208 64Mb)
1 flash chips found. Total nand_chip size: 64 MB
Get Environment from NAND offset 0x70000 ...
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
NAND read: device 0 offset 0x1a0000, size 0x40000 ... 262144 bytes read: OK
NAND read: device 0 offset 0x80000, size 0xb0000 ... 720896 bytes read: OK
### main_loop: bootcmd="bootm"
Hit any key to stop autoboot: 0
## Booting image at 01000000 ...
Image Name: MMSP2 Linux Kernel
Created: 2006-09-21 11:08:29 UTC
Image Type: ARM Linux Kernel Image (gzip compressed)
Data Size: 618206 Bytes = 603.7 kB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Starting kernel ...
MMC/SD Card Detected
MMC/SD Slot initialized
Partition check:
mmcsda: p1
Register SD: 1938MsB
mount...1
mount...2:
Reading data from NAND FLASH without ECC is not recommended
Freeing init memory: 280K
INIT: version 2.84 booting
<7>**>>ecc error unfixed on chunk 4708:0
Started device management daemon v1.3.25 for /dev
<7>**>>ecc error unfixed on chunk 5284:0
Mount image directory, if not mounted...
You must set heads sectors and cylinders.
You can do this from the extra functions menu.
You must set heads sectors and cylinders.
You can do this from the extra functions menu.
Partition table size is 4096
Loopback device setup...
losetup: ioctl: LOOP_CLR_FD: No such device or address
MSDOS FS: IO charset utf8
MSDOS FS: IO charset utf8
SDL_SYS_JoystickInit
Apply LCD Timing
Using /lib/modules/2.4.25/kernel/drivers/usb/gadget/net2272.o
net2272: Set 2272 bus timing
USB SUSPEND MODE
net2272: PLX NET2272 USB Peripheral Controller
net2272: irq 222, mapped mem c280c000, chip rev 0011
net2272: running in 16-bit, byte normal bus mode
net2272: version: 2006 April 5, v3
net2272: unbind
Using /lib/modules/2.4.25/kernel/drivers/usb/gadget/net2272.o
net2272: Set 2272 bus timing
net2272: PLX NET2272 USB Peripheral Controller
net2272: irq 222, mapped mem c280c000, chip rev 0011
net2272: running in 16-bit, byte normal bus mode
net2272: version: 2006 April 5, v3
Using /lib/modules/2.4.25/kernel/drivers/usb/gadget/g_ether.o
ooooooooooooooo
ooooooooooooooo
ooooooooooooooo
usb0: Ethernet Gadget, version: St Patrick's Day 2004
usb0: using net2272, OUT ep-b IN ep-a STATUS ep-c
usb0: MAC ba:74:21:8b:18:00
usb0: HOST MAC 3e:8a:23:22:d3:16
usb0: RNDIS ready
usb net 0...Using /lib/modules/2.4.25/kernel/drivers/usb/usbcore.o
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
usb0: high speed config #1: Ethernet Gadget, using CDC Ethernet
Using /lib/modules/2.4.25/kernel/arch/arm/mach-mmsp2/mmsp2_usbh.o
mmsp2_usbh.c: USB Host power on
mmsp2_usbh.c: initializing MMSP2 USB host PCI-DMA workaround
Using /lib/modules/2.4.25/kernel/drivers/usb/host/usb-ohci.o
Using /lib/modules/2.4.25/kernel/drivers/usb/host/usb-ohci-mmsp2.o
f_fact = 4, f_clk = 49766400, f_err = +1766400
a_fact = 3, a_clk = 49152000, a_err = +1152000
u_fact = 1, u_clk = 95846400, u_err = +47846400
usb-ohci.c: USB OHCI at membase 0xf0004300, IRQ 13
usb.c: new USB bus registered, assigned bus number 1
Product: USB OHCI Root Hub
SerialNumber: f0004300
hub.c: USB hub found
hub.c: 2 ports detected
kusbd_policy: /sbin/hotplug add 1, ret=0x0
loading usb host drivers...
Using /lib/modules/2.4.25/kernel/drivers/scsi/scsi_mod.o
SCSI subsystem driver Revision: 1.00
Using /lib/modules/2.4.25/kernel/drivers/scsi/sd_mod.o
hub.c: new USB device <NULL>-1, assigned address 2
Product: USB2.0 Hub
hub.c: USB hub found
hub.c: 4 ports detected
Using /lib/modules/2.4.25/kernel/drivers/usb/storage/usb-storage.o
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
kusbd_policy: /sbin/hotplug add 2, ret=0x0
Using /lib/modules/2.4.25/kernel/drivers/input/input.o
Using /lib/modules/2.4.25/kernel/drivers/usb/hid.o
usb.c: registered new driver hiddev
usb.c: registered new driver hid
hid-core.c: v1.8.1 Andreas Gal, Vojtech Pavlik <vojtech@suse.cz>
hid-core.c: USB HID support drivers
hub.c: new USB device <NULL>-2, assigned address 3
usb.c: USB device not accepting new address=3 (error=-110)
Using /lib/modules/2.4.25/kernel/drivers/input/keybdev.o
hub.c: new USB device <NULL>-2, assigned address 4
usb.c: USB device not accepting new address=4 (error=-110)
Using /lib/modules/2.4.25/kernel/drivers/input/mousedev.o
mice: PS/2 mouse device common for all mice
Using /lib/modules/2.4.25/kernel/drivers/input/evdev.o
hub.c: new USB device <NULL>-1.1, assigned address 5
input: USB HID v1.00 Joystick [6666:0667] on usb1:5.0
kusbd_policy: /sbin/hotplug add 5, ret=0x0
sleep oFF
CX25874 ID = c3
SDL_GP2X: Looking for a mouse
Last mouse mode: 0x0
Using PS2 mouse
MainValue:0xa0a
MainValue:0xa0a
Audio Succesfully initialised!
This is the error i'm getting over serial cable after some random time:
CODE
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c1f80000
[00000000] *pgd=00364801, *pmd = 00364801, *pte = 00000000, *ppte = 00000000
Internal error: Oops: 807
CPU: 0
pc : [<c2828270>] lr : [<c2829594>] Not tainted
sp : c197ff0c ip : c197ff2c fp : c197ff28
r10: 00000002 r9 : 000945c8 r8 : 00000002
r7 : 20000013 r6 : c17f9000 r5 : 00000000 r4 : 00000000
r3 : 017bf080 r2 : 007bf080 r1 : c17f9000 r0 : 00000000
Flags: nZCv IRQs off FIQs on Mode SVC_32 Segment user
Control: C000317F Table: 01F80000 DAC: 00000015
Process dynamate.gpe (pid: 119, stack limit = 0xc197e374)
Stack: (0xc197ff0c to 0xc1980000)
ff00: 00000002 c17f9000 f0004300 c197ffb0 c197ff50
ff20: c197ff2c c2829594 c2828218 c19e2c00 04000000 0000000d c197ffb0 c197ffb0
ff40: 00000002 c197ff70 c197ff54 c004f0c8 c28294f8 c0187710 c19e2c00 0000000d
ff60: c018739c c197ff94 c197ff74 c004f1b8 c004f088 c0194380 c197ffb0 00000001
ff80: c0003177 c197ffec c197ffac c197ff98 c004f318 c004f104 f0000800 000b68a4
ffa0: 00000000 c197ffb0 c004e5a8 c004f2fc dfffffff 000003eb 0067cd18 00000151
ffc0: 00000000 0065b020 00659040 00655e48 00000000 000945c8 00000002 00000200
ffe0: 000003eb bf7ff9d0 00000200 000b68a4 60000010 ffffffff 0000a88c 0000a88c
Backtrace:
Function entered at [<c2828208>] from [<c2829594>]
r7 = C197FFB0 r6 = F0004300 r5 = C17F9000 r4 = 00000002
Function entered at [<c28294e8>] from [<c004f0c8>]
Function entered at [<c004f078>] from [<c004f1b8>]
r7 = C018739C r6 = 0000000D r5 = C19E2C00 r4 = C0187710
Function entered at [<c004f0f4>] from [<c004f318>]
r8 = C197FFEC r7 = C0003177 r6 = 00000001 r5 = C197FFB0
r4 = C0194380
Function entered at [<c004f2ec>] from [<c004e5a8>]
r5 = 000B68A4 r4 = F0000800
Code: e5903004 e1530002 1afffff9 e3500000 (05800000)
Kernel panic: Aiee, killing interrupt handler!
In interrupt handler - not syncing
I tried using GDB but when this error happens i sometimes can not type anymore and (not sure if it's all the time) so i'm unable to get more information from it.
Please help
thanks
Update:
I have changed my hwsurfaces to software surfaces and the problem hasn't happend yet !!! And the game has been running like 30 minutes or so without a problem where it would normally crash within 5 minutes when it's in the cradle and using tvout and using HWSurfaces etc.
Also when i use hardware surfaces and the gp2x isn't in the cradle there is no problem what so ever ! i'm using the latest precompiled binary from paeryn's site now (with the 21 megs upper memory). (it did also happen with my own compiled SDL - 1.2.11 lib).
also, i believe only HW_Surfaces uses the upper memory area right ? could it be then that SDL is overwriting stuff in memory where it should not ?
here's the complete log from when the gp2x has started up, up until the crash (for the error, scroll all the way down).
CODE
U-Boot 1.0.0 (Apr 20 2006 - 12:51:09)
U-Boot code: 03E00000 -> 03E49610 BSS: -> 03E82208
IRQ Stack: 03ea3204
FIQ Stack: 03ea4204
DRAM Configuration:
Bank #0: 00100000 63 MB
Flash: 0 kB
NAND
Flash chip found:
Manufacturer ID: 0xEC, Chip ID: 0x76 (Samsung K9F1208 64Mb)
1 flash chips found. Total nand_chip size: 64 MB
Get Environment from NAND offset 0x70000 ...
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
NAND read: device 0 offset 0x1a0000, size 0x40000 ... 262144 bytes read: OK
NAND read: device 0 offset 0x80000, size 0xb0000 ... 720896 bytes read: OK
### main_loop: bootcmd="bootm"
Hit any key to stop autoboot: 0
## Booting image at 01000000 ...
Image Name: MMSP2 Linux Kernel
Created: 2006-09-21 11:08:29 UTC
Image Type: ARM Linux Kernel Image (gzip compressed)
Data Size: 618206 Bytes = 603.7 kB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Starting kernel ...
MMC/SD Card Detected
MMC/SD Slot initialized
Partition check:
mmcsda: p1
Register SD: 1938MsB
mount...1
mount...2:
Reading data from NAND FLASH without ECC is not recommended
Freeing init memory: 280K
INIT: version 2.84 booting
<7>**>>ecc error unfixed on chunk 4708:0
Started device management daemon v1.3.25 for /dev
<7>**>>ecc error unfixed on chunk 5284:0
Mount image directory, if not mounted...
You must set heads sectors and cylinders.
You can do this from the extra functions menu.
You must set heads sectors and cylinders.
You can do this from the extra functions menu.
Partition table size is 4096
Loopback device setup...
losetup: ioctl: LOOP_CLR_FD: No such device or address
MSDOS FS: IO charset utf8
MSDOS FS: IO charset utf8
SDL_SYS_JoystickInit
Apply LCD Timing
Using /lib/modules/2.4.25/kernel/drivers/usb/gadget/net2272.o
net2272: Set 2272 bus timing
USB SUSPEND MODE
net2272: PLX NET2272 USB Peripheral Controller
net2272: irq 222, mapped mem c280c000, chip rev 0011
net2272: running in 16-bit, byte normal bus mode
net2272: version: 2006 April 5, v3
net2272: unbind
Using /lib/modules/2.4.25/kernel/drivers/usb/gadget/net2272.o
net2272: Set 2272 bus timing
net2272: PLX NET2272 USB Peripheral Controller
net2272: irq 222, mapped mem c280c000, chip rev 0011
net2272: running in 16-bit, byte normal bus mode
net2272: version: 2006 April 5, v3
Using /lib/modules/2.4.25/kernel/drivers/usb/gadget/g_ether.o
ooooooooooooooo
ooooooooooooooo
ooooooooooooooo
usb0: Ethernet Gadget, version: St Patrick's Day 2004
usb0: using net2272, OUT ep-b IN ep-a STATUS ep-c
usb0: MAC ba:74:21:8b:18:00
usb0: HOST MAC 3e:8a:23:22:d3:16
usb0: RNDIS ready
usb net 0...Using /lib/modules/2.4.25/kernel/drivers/usb/usbcore.o
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
usb0: high speed config #1: Ethernet Gadget, using CDC Ethernet
Using /lib/modules/2.4.25/kernel/arch/arm/mach-mmsp2/mmsp2_usbh.o
mmsp2_usbh.c: USB Host power on
mmsp2_usbh.c: initializing MMSP2 USB host PCI-DMA workaround
Using /lib/modules/2.4.25/kernel/drivers/usb/host/usb-ohci.o
Using /lib/modules/2.4.25/kernel/drivers/usb/host/usb-ohci-mmsp2.o
f_fact = 4, f_clk = 49766400, f_err = +1766400
a_fact = 3, a_clk = 49152000, a_err = +1152000
u_fact = 1, u_clk = 95846400, u_err = +47846400
usb-ohci.c: USB OHCI at membase 0xf0004300, IRQ 13
usb.c: new USB bus registered, assigned bus number 1
Product: USB OHCI Root Hub
SerialNumber: f0004300
hub.c: USB hub found
hub.c: 2 ports detected
kusbd_policy: /sbin/hotplug add 1, ret=0x0
loading usb host drivers...
Using /lib/modules/2.4.25/kernel/drivers/scsi/scsi_mod.o
SCSI subsystem driver Revision: 1.00
Using /lib/modules/2.4.25/kernel/drivers/scsi/sd_mod.o
hub.c: new USB device <NULL>-1, assigned address 2
Product: USB2.0 Hub
hub.c: USB hub found
hub.c: 4 ports detected
Using /lib/modules/2.4.25/kernel/drivers/usb/storage/usb-storage.o
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
kusbd_policy: /sbin/hotplug add 2, ret=0x0
Using /lib/modules/2.4.25/kernel/drivers/input/input.o
Using /lib/modules/2.4.25/kernel/drivers/usb/hid.o
usb.c: registered new driver hiddev
usb.c: registered new driver hid
hid-core.c: v1.8.1 Andreas Gal, Vojtech Pavlik <vojtech@suse.cz>
hid-core.c: USB HID support drivers
hub.c: new USB device <NULL>-2, assigned address 3
usb.c: USB device not accepting new address=3 (error=-110)
Using /lib/modules/2.4.25/kernel/drivers/input/keybdev.o
hub.c: new USB device <NULL>-2, assigned address 4
usb.c: USB device not accepting new address=4 (error=-110)
Using /lib/modules/2.4.25/kernel/drivers/input/mousedev.o
mice: PS/2 mouse device common for all mice
Using /lib/modules/2.4.25/kernel/drivers/input/evdev.o
hub.c: new USB device <NULL>-1.1, assigned address 5
input: USB HID v1.00 Joystick [6666:0667] on usb1:5.0
kusbd_policy: /sbin/hotplug add 5, ret=0x0
sleep oFF
CX25874 ID = c3
SDL_GP2X: Looking for a mouse
Last mouse mode: 0x0
Using PS2 mouse
MainValue:0xa0a
MainValue:0xa0a
Audio Succesfully initialised!
This is the error i'm getting over serial cable after some random time:
CODE
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c1f80000
[00000000] *pgd=00364801, *pmd = 00364801, *pte = 00000000, *ppte = 00000000
Internal error: Oops: 807
CPU: 0
pc : [<c2828270>] lr : [<c2829594>] Not tainted
sp : c197ff0c ip : c197ff2c fp : c197ff28
r10: 00000002 r9 : 000945c8 r8 : 00000002
r7 : 20000013 r6 : c17f9000 r5 : 00000000 r4 : 00000000
r3 : 017bf080 r2 : 007bf080 r1 : c17f9000 r0 : 00000000
Flags: nZCv IRQs off FIQs on Mode SVC_32 Segment user
Control: C000317F Table: 01F80000 DAC: 00000015
Process dynamate.gpe (pid: 119, stack limit = 0xc197e374)
Stack: (0xc197ff0c to 0xc1980000)
ff00: 00000002 c17f9000 f0004300 c197ffb0 c197ff50
ff20: c197ff2c c2829594 c2828218 c19e2c00 04000000 0000000d c197ffb0 c197ffb0
ff40: 00000002 c197ff70 c197ff54 c004f0c8 c28294f8 c0187710 c19e2c00 0000000d
ff60: c018739c c197ff94 c197ff74 c004f1b8 c004f088 c0194380 c197ffb0 00000001
ff80: c0003177 c197ffec c197ffac c197ff98 c004f318 c004f104 f0000800 000b68a4
ffa0: 00000000 c197ffb0 c004e5a8 c004f2fc dfffffff 000003eb 0067cd18 00000151
ffc0: 00000000 0065b020 00659040 00655e48 00000000 000945c8 00000002 00000200
ffe0: 000003eb bf7ff9d0 00000200 000b68a4 60000010 ffffffff 0000a88c 0000a88c
Backtrace:
Function entered at [<c2828208>] from [<c2829594>]
r7 = C197FFB0 r6 = F0004300 r5 = C17F9000 r4 = 00000002
Function entered at [<c28294e8>] from [<c004f0c8>]
Function entered at [<c004f078>] from [<c004f1b8>]
r7 = C018739C r6 = 0000000D r5 = C19E2C00 r4 = C0187710
Function entered at [<c004f0f4>] from [<c004f318>]
r8 = C197FFEC r7 = C0003177 r6 = 00000001 r5 = C197FFB0
r4 = C0194380
Function entered at [<c004f2ec>] from [<c004e5a8>]
r5 = 000B68A4 r4 = F0000800
Code: e5903004 e1530002 1afffff9 e3500000 (05800000)
Kernel panic: Aiee, killing interrupt handler!
In interrupt handler - not syncing
I tried using GDB but when this error happens i sometimes can not type anymore and (not sure if it's all the time) so i'm unable to get more information from it.
Please help
thanks
Update:
I have changed my hwsurfaces to software surfaces and the problem hasn't happend yet !!! And the game has been running like 30 minutes or so without a problem where it would normally crash within 5 minutes when it's in the cradle and using tvout and using HWSurfaces etc.
Also when i use hardware surfaces and the gp2x isn't in the cradle there is no problem what so ever ! i'm using the latest precompiled binary from paeryn's site now (with the 21 megs upper memory). (it did also happen with my own compiled SDL - 1.2.11 lib).
also, i believe only HW_Surfaces uses the upper memory area right ? could it be then that SDL is overwriting stuff in memory where it should not ?