Bug 54359 - perror prints bogus error (Illegal seek)
perror prints bogus error (Illegal seek)
Status: CLOSED RAWHIDE
Product: Red Hat Public Beta
Classification: Retired
Component: glibc (Show other bugs)
roswell
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-10-04 14:19 EDT by Tobias Ringstrom
Modified: 2007-04-18 12:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-10-04 14:19:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tobias Ringstrom 2001-10-04 14:19:20 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20010917

Description of problem:
The following program:

#include <stdio.h>
#include <errno.h>
int main() {
	errno = ECONNREFUSED;
	perror("");
	return 0;
}

should print "Connection refused", but prints "Illegal seek".

Version-Release number of selected component (if applicable):
glibc-2.2.4-11

How reproducible:
Always

Steps to Reproduce:
1. Run the program above.


Additional info:

Strace of the program:

...
open("/lib/i686/libc.so.6", O_RDONLY)   = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320\305"..., 1024)
= 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=5771848, ...}) = 0
old_mmap(NULL, 1289832, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40091000
mprotect(0x401c3000, 36456, PROT_NONE)  = 0
old_mmap(0x401c3000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0x131000) = 0x401c3000
old_mmap(0x401c8000, 15976, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x401c8000
close(3)                                = 0
munmap(0x40017000, 79310)               = 0
dup(2)                                  = 3
fcntl64(0x3, 0x3, 0x3, 0)               = 2
brk(0)                                  = 0x80497c0
brk(0x8049940)                          = 0x8049940
brk(0x804a000)                          = 0x804a000
fstat64(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x40017000
_llseek(3, 0, 0xbfffeb30, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
write(3, "Illegal seek\n", 13Illegal seek
)          = 13
close(3)                                = 0
munmap(0x40017000, 4096)                = 0
_exit(0)                                = ?
Comment 1 Bill Nottingham 2001-10-04 15:56:22 EDT
Fixed in glibc-2.2.4-13 and later.

Note You need to log in before you can comment on or make changes to this bug.