Project

General

Profile

Actions

Bug #174

closed

Unloading md module causes a panic

Added by swildner almost 18 years ago. Updated about 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Hi,

the following sequence of commands easily make my box (running HEAD) panic:

  1. kldload md
  2. kldunload md

Backtrace and dump available.

Sascha


Files

md_module.jpg (118 KB) md_module.jpg tuxillo, 01/22/2009 12:20 AM
Actions #1

Updated by justin about 18 years ago

Still present on 1.6.2-RELEASE, as I just found out.

Actions #2

Updated by corecode about 18 years ago

md does not have any means to be unloaded. we should either prevent that or add
unload code.

Actions #3

Updated by aix-d about 18 years ago

how to reproduce kernel panic on 1.9.0-DEVEL:

cd /dev
sh MAKEDEV md0
disklabel md0

Actions #4

Updated by tuxillo about 18 years ago

Still happening on 2.0.1
See attached image.

Actions #5

Updated by nthery about 18 years ago

2009/1/22 Antonio Huete Jimenez (via DragonFly issue tracker)
<>:

Antonio Huete Jimenez <> added the comment:

Still happening on 2.0.1
See attached image.

I can reproduce it if and only if md is already compiled in the kernel.

What happens is that when kldloading md, the kernel tries to register
the debug.mddebug sysctl a second time (as md is already in the
kernel). It complains (the "can't re-use a leaf" msg) and stops the
registration but carries on loading the module.

When kldunloading, the kernel tries to unregister the module instance
of debug.mddebug and panics because it was not registered in the first
place.

Is there a way to detect during kldload that the module is already
part of the kernel?

I propose to close this bug as it is caused by incorrect user manipulation.

Actions #6

Updated by nthery about 18 years ago

Well, actually as Simon mentioned earlier, md has not been updated to
work as a module and it leaks memory when unloaded. I'm looking into
it.

Actions #7

Updated by alexh about 18 years ago

Any news about this? If not, disabling the option to unload should be trivial
and would offer a quick fix.

Cheers,
Alex Hornung

Actions #8

Updated by tuxillo about 18 years ago

Hi,

I think what is happening here is , despite md is already included in the
kernel, the module is not registered and thus modlist_lookup2() doesn't find it,
so kldload() syscall succeeds instead of failing in EEXIST as it should be.

I'm going to try to provide a patch to fix this based on some recommendatiosn
given by Alex.

Cheers,
Antonio Huete

Actions #9

Updated by tuxillo about 18 years ago

Committed a fix on 89adea1539ab67184124a82cc811031f3334024f

Actions

Also available in: Atom PDF