On 2008-09-23 11:21, Peter Steele wrote:
/mnt: write failed, filesystem is full
terminate called after throwing an instance of
'log4cxx::helpers::IOException'
  what():  IO Exception : status code = 28
Abort trap: 6 (core dumped)


I'm stumped here. The only places I see an IOException thrown in 0.9.7 code are:

* datagramsocket.cpp
* properties.cpp

There are some child classes, InterruptedIOException and SocketTimeoutException, and then children of those all defined in socketimpl.h. Since my sample app was using a FileAppender, I don't get how an IOException is thrown.

Unfortunately, despite it saying a core was dumped, there doesn't seem
to be a core file. Not sure how to proceed from here.

Probably a limit you can configure with your shell. In bash it's ulimit -c unlimited to get full core dumps and ulimit -a to see the settings (0 bytes by default on my shell.) It and gdb might not be helpful anyway if your log4cxx library is stripped of debugging symbols. If you do pursue getting a core, please don't send it to me :). Install gdb and get the stack trace.

I'm hoping someone else chimes in with ideas. I guess as a second test, you could try my non-log4cxx program against that full filesystem. Maybe modify a copy of it to try with an fstream. Both should fail gracefully.

--
Jacob Anawalt
Gecko Software, Inc.
[EMAIL PROTECTED]
435-752-8026
// 2008-Sep-22 18:00
// Simple test application to see how stdc libraries
// react to a full filesystem.
// gcc -ofullfs-c fullfs.c
#include <sys/stat.h> /* open */
#include <fcntl.h> /* open */
#include <stdio.h> /* printf */
#include <unistd.h> /* write */
#include <errno.h> /* errno */

int 
main(void)
{
        int i;
        int estat;
        int status;
        int fd;
        ssize_t bytes;
        const size_t bufSz = 8096;
        char buf[bufSz];
        estat = 0;
        i = 0;
        fd = open("/mnt/test",O_WRONLY|O_TRUNC|O_CREAT);
        if(fd != -1) {
                printf("Opened file fd %d\n",fd);
                while(1)
                {
                bytes = write(fd,buf,bufSz);
                if(bytes == bufSz) {
                        ++i;
                        printf("Write block, filesize now %d\n",i*bufSz);
                }
                else if( bytes == -1 ) {
                        status = errno;
                        perror("write()");
                        printf("errno: %d\n");
                        estat = 1;
                        break;
                }
                else {
                        printf("Partial write of %d bytes\n",bytes);
                }
                };

        }
        else {
                perror("open()");
                estat = 1; /* failure */
        }
        return estat;
}

Reply via email to