Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Elf errors on a broken machine - tracking down the cause
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
haven
Tux's lil' helper
Tux's lil' helper


Joined: 19 Nov 2003
Posts: 141
Location: Belfast, Uk

PostPosted: Fri Apr 27, 2012 7:29 am    Post subject: Elf errors on a broken machine - tracking down the cause Reply with quote

Hi All,

I had a home system die on me this week. I had a cron job set to do world updates nightly and one night the system simply stopped working. When rebooting I got the following:
http://haven.thehavennet.org.uk/files/Elf.jpg

Once I chrooted from a recovery disk I saw a lot of "is not an ELF file - it has the wrong magic bytes at the start." warnings on many different applications (htop, bash, cp, echo and others).

What I'm looking for is simply to understand what these errors are related too in package terms - I assume this is a package issue and not disk corruption although I'm open to suggestions. Unfortunately on this issue I hit a wall of lack of understanding and would like to know more so I can fix without a re-install in the future.

If its any help here's the emerge log from the last day of the systems working life:
http://haven.thehavennet.org.uk/files/emerge.log.txt

Thanks

Haven
Back to top
View user's profile Send private message
eccerr0r
Advocate
Advocate


Joined: 01 Jul 2004
Posts: 2998
Location: USA

PostPosted: Fri Apr 27, 2012 2:28 pm    Post subject: Reply with quote

ELF is a file format. If there's an ELF error, it means corruption.

Normally when you build executables on a modern system, it will be ELF of the architecture of your machine by default. If it's not, it's crosscompiling which you're not doing...

This looks like hardware failure to me. I've never seen something this drastic before other than if the machine was failing such as bad RAM...

Try moving the disk to another computer and see if anything is still usable? This will narrow the problem down a bit. The worry is that bad ram/bad chipset causes bad data be written onto the disk. If lucky, it's just having trouble reading from your disk and the hard drive data is intact.
_________________
Core-i7-2700K@4.1GHz/8GB RAM/180GB SSD/Intel HD3000 graphics
What the heck am I advocating?
Back to top
View user's profile Send private message
haven
Tux's lil' helper
Tux's lil' helper


Joined: 19 Nov 2003
Posts: 141
Location: Belfast, Uk

PostPosted: Mon Apr 30, 2012 8:06 am    Post subject: Reply with quote

Thanks eccerr0r,

Unfortunately I never did find out the cause and had to do a full re-install. I was using btrfs as the root file system so I may have been burned by that - back to ext4 for now just in-case.

I did find a useful utility that may help others in the future: readelf will show you the magic bits at the start of your file and may help tracking down whats broken and whats not i.e:

Code:
readelf -h /bin/cp


Regards

Haven
Back to top
View user's profile Send private message
eccerr0r
Advocate
Advocate


Joined: 01 Jul 2004
Posts: 2998
Location: USA

PostPosted: Mon Apr 30, 2012 2:29 pm    Post subject: Reply with quote

Yes, probably should have reinstalled anyway, when there's one corrupt file there's bound to be another somewhere.

I suppose you could readelf to figure out what's bad and what's not, but it doesn't rootcause the issue, hope the problem does not show up again...
_________________
Core-i7-2700K@4.1GHz/8GB RAM/180GB SSD/Intel HD3000 graphics
What the heck am I advocating?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum