public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/35176]  New: SIGXFSZ in filebuf
@ 2008-02-13  2:43 sebor at roguewave dot com
  2008-02-13  3:16 ` [Bug libstdc++/35176] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: sebor at roguewave dot com @ 2008-02-13  2:43 UTC (permalink / raw)
  To: gcc-bugs

When compiled with gcc 4.1.2 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++.

$ cat u.cpp && g++ u.cpp && ./a.out || echo $?
#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 == fb.open ("testfile.text", std::ios::out))
        return -1;

    for (rlim_t i = 0; i != rl.rlim_cur + 1; ++i)
        fb.sputc ('*');

}
File size limit exceeded
153


-- 
           Summary: SIGXFSZ in filebuf
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sebor at roguewave dot com
 GCC build triplet: x86_64-redhat-linux
  GCC host triplet: x86_64-redhat-linux
GCC target triplet: x86_64-redhat-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35176


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-02-13 19:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-13  2:43 [Bug libstdc++/35176] New: SIGXFSZ in filebuf sebor at roguewave dot com
2008-02-13  3:16 ` [Bug libstdc++/35176] " pinskia at gcc dot gnu dot org
2008-02-13 14:33 ` rguenth at gcc dot gnu dot org
2008-02-13 15:47 ` sebor at roguewave dot com
2008-02-13 16:09 ` schwab at suse dot de
2008-02-13 16:37 ` sebor at roguewave dot com
2008-02-13 16:57 ` rguenth at gcc dot gnu dot org
2008-02-13 18:16 ` sebor at roguewave dot com
2008-02-13 19:06 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).