LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Kernel BUG at fs/sysfs/file.c:552
@ 2008-04-09 14:07 Marcus Nutzinger
2008-04-12 4:31 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Marcus Nutzinger @ 2008-04-09 14:07 UTC (permalink / raw)
To: linux-kernel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi!
I wrote a little kernel module (a "virtual char-device") and wanted to
create a sysfs entry for my device under /sys/devices. When using
"device_register" and "device_create_file", I get the following kernel
BUG message (and the module stops loading): (Kernel is 2.6.24.4)
- ------------[ cut here ]------------
kernel BUG at fs/sysfs/file.c:552!
invalid opcode: 0000 [#1] SMP
Modules linked in: vdd nvidia(P) fuse kqemu snd_hda_intel snd_pcm_oss
snd_mixer_oss snd_pcm i2c_i801 snd_timer snd_page_alloc snd_hwdep
i2c_core usb_storage rtc snd intel_agp agpgart evdev
Pid: 22769, comm: modprobe Tainted: P (2.6.24.4 #1)
EIP: 0060:[<c0195c9d>] EFLAGS: 00010246 CPU: 0
EIP is at sysfs_create_file+0xf/0x1d
EAX: 00000000 EBX: f8875a08 ECX: c048663d EDX: f8875b28
ESI: f8875b28 EDI: 00000000 EBP: f8875b40 ESP: e2981e9c
DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Process modprobe (pid: 22769, ti=e2980000 task=e28caff0 task.ti=e2980000)
Stack: c026c66f 00000000 00000001 00000001 f8ddf0ee f88752a8 0fd00000
e2968540
c013d930 00000000 00000000 00000000 00000000 000008c6 000000d7
b7e7c000
00000348 00000200 00000000 f8ddc798 f8ddc794 00000000 00000000
00000000
Call Trace:
[<c026c66f>] device_create_file+0x1c/0x2b
[<f8ddf0ee>] vdd_init+0xee/0x100 [vdd]
[<c013d930>] sys_init_module+0x154d/0x1605
[<c026c307>] device_remove_file+0x0/0x25
[<c0103df6>] sysenter_past_esp+0x5f/0x85
=======================
Code: 11 f0 ff 0e 0f 94 c0 84 c0 74 07 89 f0 e8 5e 06 00 00 83 c4 10 89
f8 5b 5e 5f 5d c3 85 c0 74 0b 8b 40 1c 85 c0 74 04 85 d2 75 04 <0f> 0b
eb fe b9 02 00 00 00 e9 79 ff ff ff 57 89 cf 56 89 d6 53
EIP: [<c0195c9d>] sysfs_create_file+0xf/0x1d SS:ESP 0068:e2981e9c
- ---[ end trace 4f3d020112c37b18 ]---
I also have another question according to module loading/unloading:
I've set the kernel option 'CONFIG_MODULE_FORCE_UNLOAD', but after above
mentioned bug, the module stopped loading and it's use count (according
to lsmod) is 1 and I cannot unload it (and I thought "forced unloading"
does just that) - are there other any "tricks" how I can unload such a
"stuck in loading" module?
regards
Marcus Nutzinger
PS: please CC answers to me since I'm not subscribed to this list.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFH/M22eEFjZ1Jaui4RAt9/AKC9AV3Jp5UZvGi7oiGeYPWAXbfMvACcDp5y
wWylWxgtOLcShw8+rlkbApE=
=2NzF
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Kernel BUG at fs/sysfs/file.c:552
2008-04-09 14:07 Kernel BUG at fs/sysfs/file.c:552 Marcus Nutzinger
@ 2008-04-12 4:31 ` Greg KH
2008-04-12 15:12 ` Marcus Nutzinger
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2008-04-12 4:31 UTC (permalink / raw)
To: Marcus Nutzinger; +Cc: linux-kernel
On Wed, Apr 09, 2008 at 04:07:51PM +0200, Marcus Nutzinger wrote:
> Hi!
>
> I wrote a little kernel module (a "virtual char-device") and wanted to
> create a sysfs entry for my device under /sys/devices. When using
> "device_register" and "device_create_file", I get the following kernel
> BUG message (and the module stops loading): (Kernel is 2.6.24.4)
>
>
> ------------[ cut here ]------------
> kernel BUG at fs/sysfs/file.c:552!
> invalid opcode: 0000 [#1] SMP
> Modules linked in: vdd nvidia(P) fuse kqemu snd_hda_intel snd_pcm_oss
> snd_mixer_oss snd_pcm i2c_i801 snd_timer snd_page_alloc snd_hwdep
> i2c_core usb_storage rtc snd intel_agp agpgart evdev
>
> Pid: 22769, comm: modprobe Tainted: P (2.6.24.4 #1)
With the nvidia driver, you're not going to get much help on this list
:(
> EIP: 0060:[<c0195c9d>] EFLAGS: 00010246 CPU: 0
> EIP is at sysfs_create_file+0xf/0x1d
Hm, did you create two files with the same name?
Care to post your code?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Kernel BUG at fs/sysfs/file.c:552
2008-04-12 4:31 ` Greg KH
@ 2008-04-12 15:12 ` Marcus Nutzinger
0 siblings, 0 replies; 3+ messages in thread
From: Marcus Nutzinger @ 2008-04-12 15:12 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg KH
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> With the nvidia driver, you're not going to get much help on this list
> :(
Well I don't like the driver either but the problem is really totally
unrealted I think..
> Hm, did you create two files with the same name?
No I only wanted to create one file on the first try, just to test the
sysfs interface. It should only give an attribute under /sys/devices,
called "writer_pid", which prints 0 or an actual PID of a process
writing to my virtual device.
I've just tried some other stuff just this minute and now it seems to
work, I get a directory under /sys/devices! Unfortunately I can't say
what the real problem was and why this kernel bug occured...
But I've another question: This directory doesn't only contain the
attribute ("writer_pid") which I've created in the code, but also a
subdirectory "power" and another attribute "uevent".. Could you explain
to me what's this all about? Are these just standard attributes which
are added to every device which registers there? (Sounds obviousely
because other directories under my /sys/devices tree contain them too..).
> Care to post your code?
I've uploaded it to http://www.nuuz.at/temp/vdd.c. I didn't want to post
the whole code here, I hope that's ok!
thanks for replying,
regards
Marcus Nutzinger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFIANFMeEFjZ1Jaui4RAlbfAJ9XzbidhogUUMexqhuc/YPMzIaAjgCdGEtA
0NtTj7FkOfpaYdXQZklTlf0=
=FmIo
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-04-12 15:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-09 14:07 Kernel BUG at fs/sysfs/file.c:552 Marcus Nutzinger
2008-04-12 4:31 ` Greg KH
2008-04-12 15:12 ` Marcus Nutzinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).