bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

stdio write(2) error handling bug?


From: Érsek László
Subject: stdio write(2) error handling bug?
Date: Sat, 13 Apr 2002 00:31:40 +0000 (GMT)

Dear Developers,

this is not necessarily a bug report, I am just curious if I am doing
something wrong. The attached program behaves differently on my system
(linux 2.4.18 i686, glibc-2.2.4, gcc-3.0.2) and on another system
(AIX 4.3, gcc-2.95.2). On AIX, it does what I expect (fprintf fails due
to EAGAIN in write(2)), on mine it doesn't (the parent gets a segfault).

I had the same results when I used socketpair instead of pipe and
5 x SO_SNDBUF instead of PIPE_BUF.

gdb output:

-----------------------------------------------------

Program received signal SIGSEGV, Segmentation fault.
0x40038488 in __errno_location () from /lib/libc.so.6
(gdb) bt
#0  0x40038488 in __errno_location () from /lib/libc.so.6
#1  0x4008e422 in _IO_do_write () from /lib/libc.so.6
#2  0x4008efb7 in _IO_file_xsputn () from /lib/libc.so.6
#3  0x40070c71 in vfprintf () from /lib/libc.so.6
#4  0x4008f6a4 in __overflow () from /lib/libc.so.6
#5  0x40070c8f in vfprintf () from /lib/libc.so.6

------------------------------------------------------

and so on, the last two lines are repeated for more than 14,000 times
so I think it's a stack overrun because of infinite recursion.


Thank you in advance


Laszlo Ersek

Attachment: stdio-try.c
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]