Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: rump core on module load



On Sat, 6 May 2017, Patrick Welche wrote:

On Sat, May 06, 2017 at 06:01:36AM +0800, Paul Goyette wrote:
On Fri, 5 May 2017, Patrick Welche wrote:

Toying with a kernel module,

export RUMP_SERVER=unix:///tmp/sock
rump_allserver -svm /usr/src/sys/modules/abt/obj.amd64/abt.kmod ${RUMP_SERVER}

dumps core. The odd thing is that modload is happy!

#0  0x00000000e5405e57 in ?? ()
#1  0x00007f7fe48b0efb in module_do_load (name=0x7f7ff7bccc00 "/module.mod",
   isdep=false, flags=0, props=0x0, modp=0x0, modclass=MODULE_CLASS_ANY,
   autoload=false)
   at /usr/src/lib/librump/../../sys/rump/../kern/kern_module.c:1127
#2  0x00007f7fe48afd0b in module_load (filename=0x7f7ff7bccc00 "/module.mod",
   flags=0, props=0x0, modclass=MODULE_CLASS_ANY)
   at /usr/src/lib/librump/../../sys/rump/../kern/kern_module.c:593
#3  0x00007f7fe484e78c in handle_modctl_load (
   ml_filename=0x204297 "/module.mod", ml_flags=0, ml_props=0x0,
   ml_propslen=0)
   at /usr/src/lib/librump/../../sys/rump/../kern/sys_module.c:103

The address in traceback #1 appears to be the retrun from calling the
module's xxx_modcmd(MODULE_CMD_INIT, ...) so I would add some printf()s into
the module to see why it is dying.

Agreed that my lashed together module is probably to blame, but
why would modload be happy, but not rump? What is the difference?
(I would expect both to break.) ((Re #1, /module.mod is ETFSKEY
and not mine))

Well, not everything in rump acts the same as a real kernel. Without seeing the source code of the module in question, I can't give you a definitive answer. But you might see if you can figure out what the address in stack frame #0 corresponds to...

(Note that that address is not in the 0x07f7xxxxxx range that you would expect for "kernel stuff" such as the other stack frames. This is one part of the "rump is different than real kernel" I mentioned!)




+------------------+--------------------------+----------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:          |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+------------------+--------------------------+----------------------------+


Home | Main Index | Thread Index | Old Index