Skip to contentSkip to conversation

Weird bug: system instability after cat /proc/kcore

DISCUSSION Michael Marineau 2 participants 3 messages Oct 3, 2007 – Oct 4, 2007

lore
Share & tools
lore
#0 lore raw

Ok, the existence of this bug just blew my mind. It appears that after coppying /proc/kcore to disk the system starts to behave strangely. Processes start to sometimes segfault randomly or die with a glibc double free error. The system is perfectly fine prior to catting /proc/kcore. I can reproduce this problem on the 2.6.18 kernel from xen 3.1.0 and 3.1.1-rc2. To trigger it I just have to run 'cat /proc/kcore >coredump' and then start hitting the system with something like a gdb compile. I usually see a segfault or some strange failure before the compile finishes.

Signature · 3 lines
Michael Marineau
Oregon State University
[email protected]
#1 lore raw

So the crashes you have been seeing only occur after accessing /proc/kcore?

-- Keir

Quoted 9 lines · Michael Marineau

Ok, the existence of this bug just blew my mind. It appears that after coppying /proc/kcore to disk the system starts to behave strangely. Processes start to sometimes segfault randomly or die with a glibc double free error. The system is perfectly fine prior to catting /proc/kcore. I can reproduce this problem on the 2.6.18 kernel from xen 3.1.0 and 3.1.1-rc2. To trigger it I just have to run 'cat /proc/kcore >coredump' and then start hitting the system with something like a gdb compile. I usually see a segfault or some strange failure before the compile finishes.

#2 lore raw
Quoted 3 lines · Keir Fraser

So the crashes you have been seeing only occur after accessing /proc/kcore?

-- Keir

There are no crashes associated with this kcore problem. I didn't even have kcore enabled until I made another attempt at digging into the oops I reported earlier. All that happens with this issue are some occasional segfaults and sometimes a glibc double free error. There isn't a kernel oops or other error message. The sagfaults can take some time to trigger so I don't have a lot of info yet but this is a quick rundown of what I was able to find today:

* I usually hit segfaults during an 'emerge gdb' but one time it took a second compile before I hit it. Other loads should also work, but I just stuck with one to keep things simple.
* If I do a compile round before reading kcore I had no problem (but that might be luck)
* I had to use cat /proc/kcore > somefile, cat /proc/kcore >/dev/null didn't trigger it as far as I could tell.
* This is on an x86 box w/ gcc 3.4. I haven't tried amd64 or other gcc versions yet.

This is pretty weird and obscure so unless someone has any ideas I'm not going to spend much time on it right now.

Quoted 12 lines · Michael Marineau
Quoted 10 lines

Ok, the existence of this bug just blew my mind. It appears that after coppying /proc/kcore to disk the system starts to behave strangely. Processes start to sometimes segfault randomly or die with a glibc double free error. The system is perfectly fine prior to catting /proc/kcore. I can reproduce this problem on the 2.6.18 kernel from xen 3.1.0 and 3.1.1-rc2. To trigger it I just have to run 'cat /proc/kcore >coredump' and then start hitting the system with something like a gdb compile. I usually see a segfault or some strange failure before the compile finishes.

Signature · 3 lines
Michael Marineau
Oregon State University
[email protected]