Opened 16 years ago

Closed 16 years ago

#2284 closed bug (fixed)

Page Fault on boot (25717)

Reported by: dustin howett Owned by: axeld
Priority: blocker Milestone: R1/alpha1
Component: - General Version: R1/pre-alpha1
Keywords: Cc: anevilyak, luroh
Blocked By: Blocking: #2464
Platform: x86

Description

I get a page fault at 0x0 when booting Haiku (compiled with GCC2 or GCC4), before the "rocketship" icon lights up. The stack crawl does not provide any useful information; it starts in int_bottom, and goes directly to the page fault interrupt handler.

Hardware: AMD64 X2, SATA Drive in SATA mode, Synaptics touchpad, Firewire (though the module is not in the image), nVIDIA 6150 integrated graphics and nforce 430 chipset.

Attachments (5)

P1010005.JPG (171.3 KB ) - added by tonestone57 16 years ago.
vm_page_fault screenshot
P1010007.JPG (160.1 KB ) - added by tonestone57 16 years ago.
SATA bug
tonestone57-sysinfo.txt (1.3 KB ) - added by tonestone57 16 years ago.
legacy_sata.c.patch (1.4 KB ) - added by donn 16 years ago.
tonestone57-listdev.txt (2.1 KB ) - added by tonestone57 16 years ago.

Download all attachments as: .zip

Change History (33)

comment:1 by axeld, 16 years ago

Milestone: R1R1/alpha1
Priority: normalblocker

Can you turn on on-screen-debug output in the boot loader's safe mode menu, and see where it stops? Also, you may want to try with a revision somewhere before hrev25660 and see if that helps.

comment:2 by bga, 16 years ago

It may or may not be the same bug, but I an getting a crash during boot in the ahci driver (actually, the ahci driver calls up on the pci bus and pci crashes). I am not at home now so can't provide a backtrace, but this seems to be obviously related to the new driver model. I will capture the kdl screen later today.

comment:3 by dustin howett, 16 years ago

Legacy SATA: controller found! vendor 0x10de, device 0x0266
Legacy SATA: controller_probe
PCI-IDE: Controller in native mode: cmd 0x30c0, ctrl 0x30b6, irq 5
PCI-IDE: init channel...
PCI-IDE: channel index 0
PCI-IDE: bus master base 0x3090
PCI-IDE: init channel done
vm_soft_fault: kernel thread accessing invalud user memory!
vm_page_fault: vm_soft_fault returned error 'Bad address' on fault at 0x0, ip 0x0, write 0, user 0, thread 0xb

I find it odd that legacy_sata is being used... ahci used to work properly for me.

comment:4 by dustin howett, 16 years ago

22659 works.

comment:5 by dustin howett, 16 years ago

That is.. hrev25659 works. Oops.

comment:6 by anevilyak, 16 years ago

Cc: anevilyak added

comment:7 by anevilyak, 16 years ago

fyi, that trace just indicates that legacy sata found a controller that it could potentially handle...in the new driver architecture, each driver returns a float between 0 and 1.0 indicating how well it can handle the chip, the one with the highest rating wins. the 'dm' KDL command will print the device manager's tree, including what driver is loaded for what device. There should also have been a message in the log regarding which driver it loaded based off rating.

comment:8 by dustin howett, 16 years ago

Figured it was related to the crash and nope, it never got as far as telling which driver it chose, given their ratings.

comment:9 by dustin howett, 16 years ago

Removing legacy_sata fixes the issue; dm shows that generic_ide_pci took over. When it pagefaulted, eax and edx held the address of the second instance of the legacy_sata driver as reported by dm.

comment:10 by mmlr, 16 years ago

This bug might be affected/fixed by hrev25867, please retest.

comment:11 by dustin howett, 16 years ago

Still pagefaults with hrev25867.

comment:12 by donn, 16 years ago

If it helps, same problem here as of June 10, also with Athlon dual core and nVIDIA "nForce4 Ultra" chipset. Including the "Legacy SATA" bit. Newest working archived raw hdd is hrev25633.

by tonestone57, 16 years ago

Attachment: P1010005.JPG added

vm_page_fault screenshot

comment:13 by tonestone57, 16 years ago

Latest revision gives me a vm_page_fault at boot too. Attached jpg of "sc". Not sure if this issue relates to my add-in SATA card ( VIA VT6421 )? Will look into it further & report back any new information.

comment:14 by scottmc, 16 years ago

Can you also attach the output of listdev and sysinfo: listdev > mypcname-listdev.txt sysinfo > mypcname-sysinfo.txt This can sometimes help give further details on the specific hardware in question.

comment:15 by tonestone57, 16 years ago

*This bug relates to a SATA issue*

My computer has onboard PATA connectors ( 80GB drive ) and an add-in PCI SATA card ( 250GB drive ). Once I removed the SATA card from the PCI slot, Haiku booted up and was working well. When I put the SATA card back in the PCI slot, Haiku gave the page fault.

Something is going on with with either ahci and/or legacy sata. SATA conflict? I *think* ahci & legacy sata are both trying to support the controller. Look at my new screenshot.

SATA card is VIA VT6421, vendor id=0x1106, device id=0x3249

by tonestone57, 16 years ago

Attachment: P1010007.JPG added

SATA bug

comment:16 by luroh, 16 years ago

Cc: luroh added; anevilyak removed

comment:17 by luroh, 16 years ago

Cc: anevilyak added

oops, sorry.

comment:18 by tonestone57, 16 years ago

Ok, with further testing it looks like the problem has to do with legacy_sata.

My PATA drive /dev/hda1 = BeOS /dev/hda3 = Haiku

I booted into BeOS, mounted Haiku, deleted ahci, rebooted, tried to boot Haiku and it crashed with page fault error. I restored/undeleted ahci, then deleted legacy_sata, rebooted the computer & Haiku boots up & works.

With legacy_sata driver removed, I'm able to boot into and use Haiku ( off my PATA ) but I don't have any access to my SATA drive.

comment:19 by donn, 16 years ago

OK! Same here: without system/add-ons/kernel/boot/legacy_sata, hrev25969 works great on a PATA disk. SATA & PATA controllers both on nForce4 motherboard. SATA still semi-working - can detect partitions and read a little data, but eventually crashes or locks up. (I don't have listdev on hrev25969, and an older copy doesn't list anything.)

by tonestone57, 16 years ago

Attachment: tonestone57-sysinfo.txt added

comment:20 by tonestone57, 16 years ago

added listdev & sysinfo output. sysinfo was run off Haiku, listdev off of BeOS. Not sure why, but listdev seems to be missing from Haiku build.

@donn, if you deleted legacy_sata then your SATA drive shouldn't even show up ( what I get ); Unless ahci is somehow able to access it? Maybe this is the case for you and why SATA is semi-working? In any case, at least we know this bug relates to SATA ( legacy_sata ).

comment:21 by _be, 16 years ago

I can confirm that the problem persists with hrev26056, tried to boot from a usb-stick here; the sc is exactly the same as the posted.I do have a SATA-disk in the pc; i'll try to switch the sata-controller off next

comment:22 by ekdahl, 16 years ago

Platform: x64x86

Same problem here. Also using Athlon 64 X2, Nforce chipset, legacy_sata.

comment:23 by scottmc, 16 years ago

hrev26126 fixed the listdev, so if you still see this issue after hrev26126 use listdev to get the list of devices in your pc and attach it to this ticket.

comment:24 by donn, 16 years ago

legacy_sata.c:sChannelInterface {} needs an implementation for set_channel().

I added one, modelled after generic_ide_pc.c, and that allows boot to complete without page fault.

I actually re-coded the struct initial value per generic_ide_pc.c, with order-dependent struct member values rather than assignments, and so added some NULL initializers that weren't there before. Don't know if this made any difference, but it's an advantage of this classic initializer code - static type analysis will notice some cases where a new member isn't initialized in an old module.

comment:25 by stippi, 16 years ago

Cool, can you provide this as a patch and attach it to this ticket?

by donn, 16 years ago

Attachment: legacy_sata.c.patch added

comment:26 by donn, 16 years ago

Note that this patch only resolves my page fault problem. SATA is still not usable due to other problems.

by tonestone57, 16 years ago

Attachment: tonestone57-listdev.txt added

comment:27 by axeld, 16 years ago

Blocking: 2464 added

(In #2464) Thanks, that made it clear - it's a duplicate of bug #2284.

comment:28 by axeld, 16 years ago

Resolution: fixed
Status: newclosed

Applied in hrev26163, thanks a lot!

Note: See TracTickets for help on using tickets.