Re: [] Kernel coredump to a pipe is failing

From: Paul Smith
Date: Tue May 26 2009 - 12:49:13 EST

Sorry for not following up to my previous message to get the threading
headers correct: the original is on another system I don't have access
to and I can't find a way to reply from any of the web archived
versions. Anyway, this is a link to the original FYI:

In that post I observed that my short cores were being caused by
dump_write() returning 0; taking another look at dump_write():

static int dump_write(struct file *file, const void *addr, int nr)
return file->f_op->write(file, addr, nr, &file->f_pos) == nr;

If the write operation returns an error of any kind, or it fails to
write the complete set of bytes (nr here is always PAGE_SIZE, as this
function is called when it fails), then dump_write() returns 0 and we
get a short core.

So I annotated dump_write() to printk() if this operation is false, and
I get:

file ffff8803b95d0180: dump_write: -512 < 4096

Well, -512 is ERESTARTSYS. That, to me, seems like a reasonable error
code to get when we're trying to dump core to a pipe. Yes? No?

Shouldn't we be doing some kind of error handling here, at least for
basic things like signals? Should a process that's dumping core be set
to ignore signals? Should dump_write() try again on ERESTARTSYS?

Any advice or comments would be greatly appreciated!

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at