stdcxx-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <>
Subject [jira] Created: (STDCXX-724) SIGXFSZ in filebuf
Date Wed, 13 Feb 2008 02:54:07 GMT
SIGXFSZ in filebuf

                 Key: STDCXX-724
             Project: C++ Standard Library
          Issue Type: Bug
          Components: 27. Input/Output
    Affects Versions: 4.2.0
         Environment: Fedora release 8 (Werewolf)
            Reporter: Martin Sebor
            Priority: Minor

The program below dies with SIGXFSZ on Linux. I don't think the standard allows filebuf to
report errors using signals (since it describes file I/O in terms of C stdio), nor does a
signal seem desirable in C++. We might need to suspend signals while calling POSIX [write()|].

gcc's libstdc++ fails in a similar way. I filed [bug 35176|].

$ cat u.cpp && make u && ./u
#include <fstream>
#include <sys/resource.h>

int main ()
    rlimit rl;
    getrlimit (RLIMIT_FSIZE, &rl);

    rl.rlim_cur = 32;
    setrlimit (RLIMIT_FSIZE, &rl);

    std::filebuf fb;
    if (0 == ("testfile.text", std::ios::out))
        return -1;

    for (rlim_t i = 0; ; ++i)
        if (-1 == fb.sputc ('*'))
gcc -c -I/home/sebor/stdcxx/include/ansi -D_RWSTDDEBUG   -pthread -I/home/sebor/stdcxx/include
-I/build/sebor/stdcxx-gcc-4.1.2-15D/include -I/home/sebor/stdcxx/tests/include  -pedantic
-nostdinc++ -g   -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long -Wcast-align
gcc u.o -o u -L/build/sebor/stdcxx-gcc-4.1.2-15D/rwtest -lrwtest15D -pthread  -L/build/sebor/stdcxx-gcc-4.1.2-15D/lib
 -Wl,-R/build/sebor/stdcxx-gcc-4.1.2-15D/lib:/build/sebor/stdcxx-gcc-4.1.2-15D/rwtest -lstd15D
-lsupc++ -lm 
File size limit exceeded

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message