This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Partial cores using Linux "pipe" core_pattern


On Mon, 2009-05-18 at 15:49 +0200, Andreas Schwab wrote:
> Apparently the ELF core dumper cannot handle short writes (see
> dump_write in fs/binfmt_elf.c).  You should probably use a read buffer
> of at least a page, which is the most the kernel tries to write at once.

This is good info; thanks.  But, my read buffer is 256K:

    const int bufsize = 1024 * 256;
    char *buf = (char *)malloc(bufsize);
    if (!buf) {
        _vlog(LOG_ERR, "Failed to allocate read buffer size %d\n", bufsize);
        exit(1);
    }

(this is compiled with g++ for hysterical raisins, in case that wasn't
obvious).  I didn't check to see what the "normal" read sizes are.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@gnu.org>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.us
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]