# BUG in Kernel - What to do? [SOLVED]

## gmetal

Suddenly my kicker crashed (KDE 3.5.5) and I restarted it. After checking dmesg if found this:

```
----------- [cut here ] --------- [please bite here ] ---------

Kernel BUG at fs/sysfs/file.c:92

invalid opcode: 0000 [1] SMP

CPU 0

Modules linked in: snd_pcm_oss snd_mixer_oss snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_hda_intel snd_hda_codec snd_pcm snd_timer snd soundcore snd_page_alloc pcspkr i2c_i801 i2c_core ehci_hcd uhci_hcd rtc usbcore fglrx(P) aes crypto_algapi intel_agp airo_cs airo loop pcmcia yenta_socket rsrc_nonstatic pcmcia_core hdaps tp_smapi thinkpad_ec

Pid: 8545, comm: kicker Tainted: P      2.6.19-gentoo-r4 #2

RIP: 0010:[<ffffffff802aef87>]  [<ffffffff802aef87>] sysfs_read_file+0xb5/0x13a

RSP: 0018:ffff810036a09ec8  EFLAGS: 00010206

RAX: 00000000fffffffa RBX: ffff81003d257340 RCX: 0000000000000000

RDX: 00000000fffffffa RSI: 0000000000000000 RDI: ffffffff88001dc0

RBP: ffff81003dc95a00 R08: ffffffff8025b5e8 R09: ffff810036a09f50

R10: ffffffff804ce390 R11: 0000000000000000 R12: ffff81003d257360

R13: ffff810036a09f50 R14: ffffffff804ce390 R15: ffff81003d6e9100

FS:  00002ba52d810780(0000) GS:ffffffff80520000(0000) knlGS:0000000000000000

CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033

CR2: 00002ba52f14a000 CR3: 00000000369e9000 CR4: 00000000000006e0

Process kicker (pid: 8545, threadinfo ffff810036a08000, task ffff81003ec5f790)

Stack:  0000000000001000 00002ba52f14a000 ffffffff8800ad00 ffff81001b2bb1c0

 0000000000001000 00002ba52f14a000 ffff810036a09f50 0000000000000001

 00007fff8129bd50 ffffffff80275a12 0000000000000000 ffff81001b2bb1c0

Call Trace:

 [<ffffffff80275a12>] vfs_read+0xaa/0x14f

 [<ffffffff80275dea>] sys_read+0x45/0x6e

 [<ffffffff802097ee>] system_call+0x7e/0x83

Code: 0f 0b 68 46 1a 45 80 c2 5c 00 48 85 c0 78 05 48 89 03 eb 09

RIP  [<ffffffff802aef87>] sysfs_read_file+0xb5/0x13a

 RSP <ffff810036a09ec8>

```

What do I do with it? Where do I post this?

I am running Kernel 2.6.19-gentoo-r4 on a Core2Duo machine, using the amd64 architecture.

Thanks.Last edited by gmetal on Sat Jan 20, 2007 10:46 am; edited 1 time in total

----------

## matja

'invalid opcode' would suggest to me - bad compiler output, a kernel module corrupting the kernel heap, or bad memory producting memory errors.

Code shouldn't ever even get compiled by GCC to invalid opcodes, even buggy code.

Do you get kernel crashes often? Are they similar crashes in the same file?

----------

## gmetal

I had this same crash a few times now. It seems however that it is only produced once per session (i.e. until the next time I boot). I don't think it's bad memory, because this is a brand new laptop (1 week old). I haven't seen any other kernel crashes. The system seems to be pretty stable. My CHOST and CFLAGS are the following:

```

CFLAGS="-O2 -march=nocona -pipe"

CHOST="x86_64-pc-linux-gnu"

```

----------

## nielchiano

 *gmetal wrote:*   

> My CHOST and CFLAGS are the following:
> 
> ```
> 
> CFLAGS="-O2 -march=nocona -pipe"
> ...

 

Doesn't matter... the kernel doesn't use them.

 *gmetal wrote:*   

> Core2Duo machine, using the amd64 architecture

 

This might matter... maybe the kernel uses some 3DNow! features that amd DOES support, but your Intel does NOT?

----------

## gmetal

 *nielchiano wrote:*   

> 
> 
>  *gmetal wrote:*   Core2Duo machine, using the amd64 architecture 
> 
> This might matter... maybe the kernel uses some 3DNow! features that amd DOES support, but your Intel does NOT?

 

How would that be passed into the kernel configuration? As far as I can remember you don't enable things like that in the kernel (correct me if I am wrong). Another thing to note, is that the system is very usable after this appears in my dmesg. The only thing that is affected is kicker, which after being restarted works fine. 

BTW, I have a feeling that this whole issue is associated with kthinkbat  (shows a battery icon in the kicker) and tp_smapi (allows you to control several power-related characteristics on IBM thinkpad laptops).

----------

## nielchiano

 *gmetal wrote:*   

>  *nielchiano wrote:*   
> 
>  *gmetal wrote:*   Core2Duo machine, using the amd64 architecture 
> 
> This might matter... maybe the kernel uses some 3DNow! features that amd DOES support, but your Intel does NOT? 
> ...

 

By selecting the wrong CPU-type, for example.

 *gmetal wrote:*   

> BTW, I have a feeling that this whole issue is associated with kthinkbat  (shows a battery icon in the kicker) and tp_smapi (allows you to control several power-related characteristics on IBM thinkpad laptops).

 

Which would make sense... Is that an official kernel module? How did you compile it?

----------

## gmetal

 *nielchiano wrote:*   

> 
> 
> By selecting the wrong CPU-type, for example.
> 
> 

 

Yeah, fair enough. However I have selected the correct architecture (Intel EMT64).

 *nielchiano wrote:*   

> 
> 
> Which would make sense... Is that an official kernel module? How did you compile it?

 

It's not in the official kernel tree. And it's not available in the amd64 arch in the gentoo portage

tree. However, I emerged it just fine. It loads ok. And apart from that glitch, I haven't noticed

any other instabilities.

----------

## nielchiano

 *gmetal wrote:*   

>  *nielchiano wrote:*   
> 
> By selecting the wrong CPU-type, for example.
> 
>  
> ...

 

Ok then... just to make sure, because:

 *gmetal wrote:*   

> I am running Kernel 2.6.19-gentoo-r4 on a Core2Duo machine, using the amd64 architecture. 

 

----------

## gmetal

 *nielchiano wrote:*   

>  *gmetal wrote:*    *nielchiano wrote:*   
> 
> By selecting the wrong CPU-type, for example.
> 
>  
> ...

 

Yeah, this can be quite confusing. If you want to build an Intel EMT64 system, you have to set the architecture to amd64 (x86_64). If you set it to x86, it will run in 32-bit. It doesn't seem that Gentoo has (or needs) a separate portage tree for emt64.

----------

## bLUEbYTE84

emt64=amd64

Only different naming. Only very slight differences which as far as I know has no effect on end-user, programmer or binaries.

And, even if the architectures were different, there would not be another portage tree, actually we have several different architectures (ppc, x86 etc) and a single portage tree. There is and will be only one portage tree. Since Gentoo is a source distro, it doesn't need seperate repositories unlike other (binary) distros, since everything gets compiled from source for your architecture.

----------

## jmbsvicetto

Hi.

Have you opened a bug in Bugzilla for this?

----------

## gmetal

 *bLUEbYTE84 wrote:*   

> emt64=amd64
> 
> Only different naming. Only very slight differences which as far as I know has no effect on end-user, programmer or binaries.
> 
> And, even if the architectures were different, there would not be another portage tree, actually we have several different architectures (ppc, x86 etc) and a single portage tree. There is and will be only one portage tree. Since Gentoo is a source distro, it doesn't need seperate repositories unlike other (binary) distros, since everything gets compiled from source for your architecture.

 

Just to make it clear, I was not advocating the need for a separate architecture or anything like that!

 *jmbsvicetto wrote:*   

> 
> 
> Have you opened a bug in Bugzilla for this?
> 
> 

 

No I haven't, because I am not sure where this bug should go! I am not sure this is a Gentoo-related bug and the program that I suspect is causing this is not in the official portage tree. I was thinking that this might be going to a kernel-related bug list, but I've got no clue which one to use! Can you point me to such a list?

----------

## jmbsvicetto

I've asked the Gentoo kernel team to look at this thread and check whether your problem should be reported as a bug to the kernel team.

Whenever you want to reach them, you can use the #gentoo-kernel channel of the freenode IRC network. You can look in their homepage for more info.

----------

## salahx

Your kernel is tanited by the "fglrx". This effectively makes the oops information useless. 

If you can repeat this without the tainted modules, capture the oops for that.

----------

## gmetal

 *jmbsvicetto wrote:*   

> I've asked the Gentoo kernel team to look at this thread and check whether your problem should be reported as a bug to the kernel team.
> 
> Whenever you want to reach them, you can use the #gentoo-kernel channel of the freenode IRC network. You can look in their homepage for more info.

 

Thanks for the information! I'll have a go at this.

 *salahx wrote:*   

> 
> 
> Your kernel is tanited by the "fglrx". This effectively makes the oops information useless.
> 
> If you can repeat this without the tainted modules, capture the oops for that.
> ...

 

I'll try using the vesa driver and see if it works, and if I can reproduce this.

----------

## gmetal

Same problem without the fglrx module loaded. I'll use the #gentoo-kernel channel.

Thanks

```

----------- [cut here ] --------- [please bite here ] ---------

Kernel BUG at fs/sysfs/file.c:92

invalid opcode: 0000 [1] SMP

CPU 1

Modules linked in: drm snd_pcm_oss snd_mixer_oss snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_hda_intel snd_hda_codec snd_pcm snd_timer snd soundcore snd_page_alloc pcspkr i2c_i801 i2c_core ehci_hcd uhci_hcd aes crypto_algapi rtc usbcore airo_cs airo intel_agp loop pcmcia yenta_socket rsrc_nonstatic pcmcia_core hdaps tp_smapi thinkpad_ec joydev

Pid: 9528, comm: kicker Not tainted 2.6.19-gentoo-r4 #5

RIP: 0010:[<ffffffff802aef87>]  [<ffffffff802aef87>] sysfs_read_file+0xb5/0x13a

RSP: 0018:ffff810030ea3ec8  EFLAGS: 00010202

RAX: 00000000fffffffb RBX: ffff81003b62ab40 RCX: 0000000000000000

RDX: 0000000000000000 RSI: 0000000000000092 RDI: ffffffff88006dc0

RBP: ffff81003d6606e0 R08: 0000000000000001 R09: 00000000fffedb09

R10: 0000000000000046 R11: 0000000000000000 R12: ffff81003b62ab60

R13: ffff810030ea3f50 R14: ffffffff804ce390 R15: ffff81003e302900

FS:  00002b0d124cb780(0000) GS:ffff81003f03ef40(0000) knlGS:0000000000000000

CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033

CR2: 00002b0d13e06000 CR3: 000000003957d000 CR4: 00000000000006e0

Process kicker (pid: 9528, threadinfo ffff810030ea2000, task ffff81003ec22830)

Stack:  0000000000001000 00002b0d13e06000 ffffffff8800f7c0 ffff81003e0590c0

 0000000000001000 00002b0d13e06000 ffff810030ea3f50 0000000000000001

 00007fff9c5e0130 ffffffff80275a12 0000000000000000 ffff81003e0590c0

Call Trace:

 [<ffffffff80275a12>] vfs_read+0xaa/0x14f

 [<ffffffff80275dea>] sys_read+0x45/0x6e

 [<ffffffff802097ee>] system_call+0x7e/0x83

Code: 0f 0b 68 06 1b 45 80 c2 5c 00 48 85 c0 78 05 48 89 03 eb 09

RIP  [<ffffffff802aef87>] sysfs_read_file+0xb5/0x13a

 RSP <ffff810030ea3ec8>

```

----------

## desultory

For future reference, please post how this problem was resolved.

----------

## gmetal

 *desultory wrote:*   

> For future reference, please post how this problem was resolved.

 

The problem is not solved, but I got an answer into who to contact about this problem so I marked it as solved.

----------

