Linux: Cannot load foo.so: Invalid ELF Header. Observations -


trying run linux binary b loads shared library /lib/libfoo.so. getting error 'cannot load /lib/libfoo.so: invalid elf header. program ran fine while, failed. failures repeatable.

managed dd first block (512 bytes) of libfoo.so. apparently elf header starts 7f 45. file had first byte value 0 rather 7f. second byte fine 45.

upon reboot, program b ran fine, no complaints link loader locating libfoo.so. offset 0 of libfoo.so had reverted correct 7f. mod time of file 2012 throughout, suggesting no filesystem operation had changed byte.

at time, put down filesystem corruption suspicious of crazy linux kernel page cache bug, buffer overrun 1 byte, writing 0 unrelated cached file happens trash cached libfoo.so. reasons speculation of this:

1 dd result of 0 @ offset 0 in file may have got result page cache , not disk @ all? .so file heavily used in system have been cached.

2 issue went away on re-boot, page cache history.

3 many posts linux 'invalid elf header', different offending .so files. victims thought corrupt file on disk , did yum/apt re-install , fixed issue. system embedded system, , no apt/yum facility.

4 .so file had single byte trashed, , byte @ offset 0, v odd.

i should point out legacy 2.6.10 system on arm9 cpu. 32mb ram, no swap. numerous complaints bad elf headers when accessing .so files range 2003 present day.

hoping linux kernel guru reading.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -