An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Previous Thread
Next Thread
Print Thread
chasing ghosts
#21663 04/20/12 08:33 PM
Joined: Aug 2009
OP Offline

Joined: Aug 2009
Mac Mini (server, dual hdds) checked in for os trashed. (Server os, yay) After wasting several days' time to find out that apple had a bug in their service diagnostics that hangs during memory checks, i finally got to checking the hdd, which ALSO hangs the new ASD. So pull both hdds and scan them. One dumps out from my script with what is usually an io error.

But it wasn't. DD had terminated without reading the data AND without causing an IO error to show up in the logs. And when I tried to rerun the dd block read that returned the error, it worked fine.

After running the script several more times it appeared that dd was dumping out for no apparent reason at a random points on the hard drive. OK time to upgrade the script and tell me what DD is returning if not zero. DD's man page was unhelpful, saying the exit code is "0 for success, nonzero for an error". So I had just been checking for 0 or not 0. Now that I have it reporting, I get exit code 137.

All attempts to track down the meaning of code 137 have proved fruitless. I even found the source code (I think here) and that appears to only be able to return 0 or 1. Considering the number, I assume 137 isn't being generated by dd, but instead is being generated by something that dd calls, that's not supposed to return nonzero, and is causing dd to halt and return that as its return code.

All of this is probably a waste of time on my part, the hard drive is at the very least possessed and needs to be replaced, but this has me very curious. Someone else pointed out that return codes over 127 may be a passed code, indicating the return code from the upper level is 9 (128+9=137) but I don't know where to look for that. I'm not kill (signal -9)'ing it. it's stopping on its own afaik.


I work for the Department of Redundancy Department
Re: chasing ghosts
Virtual1 #21664 04/21/12 05:39 AM
Joined: Aug 2009
Likes: 1
Offline

Joined: Aug 2009
Likes: 1
dd is a BSD/POSIX native command; it shouldn't call any underlying commands for its operation. If it's returning an error above 127, it should be generating that error natively, rather than passing along an error from an underlying process.

I also can't find any documentation for specific dd error codes. The drive is clearly flakey, but beyond that? You got me.


Photo gallery, all about me, and more: www.xeromag.com/franklin.html

Moderated by  alternaut, cyn 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.4.33 Page Time: 0.015s Queries: 18 (0.011s) Memory: 0.5721 MB (Peak: 0.6242 MB) Data Comp: Zlib Server Time: 2024-04-25 16:52:11 UTC
Valid HTML 5 and Valid CSS