Strange Problem (SDL apps will no longer run)

I am having a very strange problem with SDL. For the past two days I have
been unable to use any SDL apps and everything I have tried thus far has
failed to fix the problem. It should be noted that all SDL apps I have
compile without a problem but executing them gives me this error:

lt-showimage: error in loading shared libraries: libc.so.6: invalid ELF
header

So far I have tried installing an updated version of libc (rpm)
e2fsck -cv /dev/hda6 (check for bad blocks in /usr partition)
Reinstalled SDL 1.1.7 (from source)
rebuilding SDL apps

None of this has worked and I just can’t think of anything else besides
maybe trying a CVS of SDL. I am also including a strace of a simple sdl
app (that worked before something got FUBAR) in case that might help. The
problem is just with sdl apps as everything else seems to be working fine

Thanks,
James Danilowicz

execve("./sdl_setup1", ["./sdl_setup1"], [/* 47 vars /]) = 0
brk(0) = 0x8049910
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/i686/mmx/libSDL-1.1.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/lib/i686/mmx", 0xbffff1cc) = -1 ENOENT (No such file or directory)
open("/usr/lib/i686/libSDL-1.1.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/lib/i686", 0xbffff1cc) = -1 ENOENT (No such file or directory)
open("/usr/lib/mmx/libSDL-1.1.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/lib/mmx", 0xbffff1cc) = -1 ENOENT (No such file or directory)
open("/usr/lib/libSDL-1.1.so.0", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=1112764, …}) = 0
read(3, “\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@\276\0”…, 4096) = 4096
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40014000
old_mmap(NULL, 454668, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40015000
mprotect(0x40064000, 131084, PROT_NONE) = 0
old_mmap(0x40064000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x4e000) = 0x40064000
old_mmap(0x40068000, 114700, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40068000
close(3) = 0
open("/usr/lib/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=20886, …}) = 0
old_mmap(NULL, 20886, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40085000
close(3) = 0
open("/lib/libpthread.so.0", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=290918, …}) = 0
read(3, “\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200@\0”…, 4096) = 4096
old_mmap(NULL, 76408, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4008b000
mprotect(0x40097000, 27256, PROT_NONE) = 0
old_mmap(0x40097000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xb000) = 0x40097000
close(3) = 0
open("/usr/lib/libc.so.6", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=178, …}) = 0
read(3, "/
GNU ld script\n Use the shar"…, 4096) = 178
close(3) = 0
write(2, “./sdl_setup1”, 12./sdl_setup1) = 12
write(2, “: error in loading shared librar”…, 37: error in loading shared libraries: ) = 37
write(2, “libc.so.6”, 9libc.so.6) = 9
write(2, ": ", 2: ) = 2
write(2, “invalid ELF header”, 18invalid ELF header) = 18
write(2, “”, 0) = 0
write(2, “”, 0) = 0
write(2, “\n”, 1
) = 1
_exit(127)

Looks like a text file (specifically the source to ld)
where an ELF library should be:

Normal library:

open("/usr/lib/libSDL-1.1.so.0", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=1112764,
…}) = 0
read(3,

“\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@\276\0”…,

  1. = 4096

Your copy of /usr/lib/libc.so.6:

open("/usr/lib/libc.so.6", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=178, …}) =
0
read(3, “/* GNU ld script\n Use the shar”…,
4096) = 178

Did something perhaps copy over it?

Best regards,

-Loren__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/

You have a file /usr/lib/libc.so.6 which is corrupt somehow.
As far as I know, it shouldn’t even exist.

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Some how the symlink from /usr/lib/libc.so.6 to /usr/lib/libc.so got
messed up. In any event once /usr/lib/libc.so.6 was removed all sdl apps
worked again. I would like to thank you all for your help.

Thanks,
James Danilowicz

In article , “Sam Lantinga”
wrote:> You have a file /usr/lib/libc.so.6 which is corrupt somehow. As far as I

know, it shouldn’t even exist.

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software