Opened 10 years ago

Closed 5 years ago

#4608 closed bug (fixed)

Removing USB stick without unmounting causes trip to kernel debug land

Reported by: peterm1561 Owned by: axeld
Priority: normal Milestone: R1
Component: Drivers/USB Version: R1/alpha3
Keywords: Cc: umccullough
Blocked By: Blocking:
Has a Patch: no Platform: All

Description (last modified by mmlr)

When I remove an usb stick without unmounting it first (I know it's rude) Haiku crashes with the message:

PANIC: vm_page_fault:unhandled page fault in kernel space at 0x8382228c, ip 0x8382228c

Welcome to Kernel Debugging land...
Thread 282 "device event" running on CPU 0.

This happens on both my haiku laptops with several sticks.

It seems that this causes an unhandled exception.

Change History (13)

comment:1 by mmlr, 10 years ago

Description: modified (diff)

Unplugging a mounted USB stick getting you to KDL is not too unexpected, although it shouldn't actually crash, but panic stating that something couldn't be written back (i.e. indicating data loss). If you can still reproduce this unhandled page fault, then please run the "bt" command in KDL and attach the output here.

comment:2 by peterm1561, 10 years ago

I use a nightly build GCC4 (35546). I am unable to reproduce this problem. I tried removing the usb stick right after mounting it and I also removed te stick with a few files open. No crash anymore!

comment:3 by axeld, 10 years ago

That doesn't mean this one has been fixed, but it might be given its age and the number of changes that happened since then.

From the panic, it looks like some module/driver has been unloaded but was still in use.

comment:4 by umccullough, 9 years ago

Cc: umccullough added

comment:5 by axeld, 9 years ago

Owner: changed from mmlr to axeld
Status: newin-progress

comment:6 by axeld, 9 years ago

Fixed in hrev41119. Note however, there is an open bug about disconnecting a file descriptor, and this might still kick in - it will just happen very rarely now (could not trigger a crash again while testing, at least).

comment:7 by luroh, 9 years ago

Resolution: fixed
Status: in-progressclosed

comment:8 by michielkeuterman@…, 8 years ago

Resolution: fixed
Status: closedreopened
Version: R1/alpha1R1/alpha3

comment:9 by luroh, 8 years ago

michielkeuterman: By your changes, you are indicating that this bug is present in Haiku's R1/alpha3 release. In view of the fact that alpha3 is now quite old, could you please test with a nightly build?

comment:10 by pulkomandy, 6 years ago

Well, we indeed go to KDL when an USB stick is removed. It would be preferable to allow the user to plug it back, and resume writing. Even more annoying, the KDL is not continuable, because it will panic for each block it tries to write back, and there may be a lot of those.

Should we open a separate bugreport for that?

comment:11 by axeld, 6 years ago

No need to. These kind of panics should only ever happen in alpha/beta releases, but should be removed for the release candidates.

comment:12 by pulkomandy, 6 years ago

Removing the panic is only the first step to solving this. We still want to warn the user that there is some data left in the cache and not written back to the volume yet, and allow the user to plug the volume back and flush it. This could be handled in the mount_server, maybe?

comment:13 by luroh, 5 years ago

Resolution: fixed
Status: reopenedclosed

Bug fixed in hrev41119, remaining issue tracked in #6683.

Note: See TracTickets for help on using tickets.