Bug 43201 - kernel crashes when compiled with a modified keymap using GCC 4.6 or 4.7
Summary: kernel crashes when compiled with a modified keymap using GCC 4.6 or 4.7
Status: RESOLVED DUPLICATE of bug 15758
Alias: None
Product: Drivers
Classification: Unclassified
Component: Console/Framebuffers (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Alan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-03 22:01 UTC by Frédéric L. W. Meunier
Modified: 2012-06-18 21:12 UTC (History)
1 user (show)

See Also:
Kernel Version: 3.3.3
Subsystem:
Regression: No
Bisected commit-id:


Attachments
.config used with the kernel (66.18 KB, application/octet-stream)
2012-05-03 22:01 UTC, Frédéric L. W. Meunier
Details
kernel panic with the kernel (4.13 KB, text/plain)
2012-05-03 22:02 UTC, Frédéric L. W. Meunier
Details
modified defkeymap.c created with 'loadkeys --mktable br-latin1-abnt2' (21.93 KB, application/octet-stream)
2012-05-03 22:20 UTC, Frédéric L. W. Meunier
Details

Description Frédéric L. W. Meunier 2012-05-03 22:01:11 UTC
Created attachment 73175 [details]
.config used with the kernel

Recently, I installed Arch Linux and use their GCC 4.6.3 to compile the kernel. The first one I compiled on that Linux distribution was 3.3.1. I had no problems related to the kernel, but one. As soon as I started the Midnight Commander file manager, I got the attached kernel panic (while it was captured with VirtualBox, I can reproduce it under plain Linux).

After dozens of kernel recompilations using 'git bisect' and not being able to reproduce it, I noticed that what caused the kernel panic was a modified keymap I had on my other tree.

After more tests, I noticed that it only happens if I don't load another or the same keymap with 'loadkeys' while or after booting.

After more tests, I could reproduce it under Slackware Linux -current, compiling the kernel with their GCC 4.7.0.

Then, I decided to try GCC 4.5.2 from Slackware 13.37, because either the issue had started recently due to the additional 'loadkeys', or the new GCC was to blame (before Arch Linux, my most recent GCC had been 4.5.3). And yes, I couldn't reproduce it with 4.5.2.

While I have no idea if this is a GCC or kernel but, I think it's worth reporting.
https://bugzilla.kernel.org/show_bug.cgi?id=15758 looked similar, but is from 2010 and the user reported that it started in 2009, way before GCC 4.6.
Comment 1 Frédéric L. W. Meunier 2012-05-03 22:02:43 UTC
Created attachment 73176 [details]
kernel panic with the kernel
Comment 2 Frédéric L. W. Meunier 2012-05-03 22:09:20 UTC
(In reply to comment #0)
> After more tests, I noticed that it only happens if I don't load another or
> the
> same keymap with 'loadkeys' while or after booting.

Sorry, that should read:

"After more tests, I noticed that it only happens if I load another or the
same keymap with 'loadkeys' while or after booting."
Comment 3 Frédéric L. W. Meunier 2012-05-03 22:20:51 UTC
Created attachment 73177 [details]
modified defkeymap.c created with 'loadkeys --mktable br-latin1-abnt2'
Comment 4 Frédéric L. W. Meunier 2012-05-04 21:25:35 UTC
Just additional information and omission.

I can't reproduce it from a X terminal emulator nor connecting with ssh.

Also, Midnight Commander isn't involved in any way. While my first kernel panic manifested when I pressed the F3 key inside the file manager to read a file, the crash also happens from a bash shell.

And if you load another keymap, like "us", the crash occurs pressing an arrow key, what doesn't happen with "br-abnt2" nor "br-latin1-abnt2". It's just a matter of pressing keys until you get the crash.
Comment 5 Alan 2012-05-12 00:28:09 UTC
Can you attach the actual keymap file

Alan
Comment 6 Frédéric L. W. Meunier 2012-05-12 01:24:13 UTC
Alan, if you mean the one that crashes the kernel, I attached it earlier at https://bugzilla.kernel.org/attachment.cgi?id=73177 . It's the "br-latin1-abnt2". But I think it crashes with any keymap you generate to replace "defkeymap.c_shipped".

I noticed some apparent differences in defkeymap.o using GCC 4.5.2 and 4.6.3, but it's greek for me. I don't know if it's miscompiling the object, and if so, if it's causing the crash. It's just strange to me that the crash only happens if I also use 'loadkeys'. Without doing that, the modified keympap works as expected and all keys appear to be right.
Comment 7 Alan 2012-05-12 12:45:36 UTC
Ah ok.. now I understand.

The object file may well different, but the actual data loaded into the kernel via loadkeys isn't a .o file so that shouldn't matter.

No matter how broken the keymap file is using it with "loadkeys" shouldn't crash the kernel so I shall do some digging
Comment 8 Alan 2012-06-18 21:12:13 UTC

*** This bug has been marked as a duplicate of bug 15758 ***

Note You need to log in before you can comment on or make changes to this bug.