Lisp HUG Maillist Archive

Error reading image header on macOS

Hello,

I just started getting the following error when running my deployed application:

   Error reading image header  errno 2: No such file or directory

Has anybody else encountered this?  

I thought it might my my system and gave it a reboot, but no luck.  

--
Burton Samograd
BusFactor1@gmail.com
http://BusFactor1.ca

Re: Error reading image header on macOS

how about printing out the full path of file you are requesting? or maybe you have relative path used, and started the program from different path than expected.

On Mon, Mar 20, 2017 at 4:37 AM, BusFactor1 Inc. <busfactor1@gmail.com> wrote:
Hello,

I just started getting the following error when running my deployed application:

   Error reading image header  errno 2: No such file or directory

Has anybody else encountered this?  

I thought it might my my system and gave it a reboot, but no luck.  

--
Burton Samograd
BusFactor1@gmail.com
http://BusFactor1.ca


Re: Error reading image header on macOS

Normally I would trace down a problem like this using 'strace on Linux, and I found that macOS has 'dtruss' which gives the following information:

Ringmap2:Personal Text Encryptor burton$ sudo dtruss "./Personal\ Text\ Encryptor.app/Contents/MacOS/Personal\ Text\ Encryptor" 
dtrace: system integrity protection is on, some features will not be available

SYSCALL(args)            = return
open("/dev/dtracehelper\0", 0x2, 0x7FFF5FBFE860)                 = 3 0
ioctl(0x3, 0x80086804, 0x7FFF5FBFE7E8)           = 0 0
close(0x3)               = 0 0
thread_selfid(0x3, 0x80086804, 0x7FFF5FBFE7E8)           = 487681 0
bsdthread_register(0x7FFFE6E1A1F0, 0x7FFFE6E1A1E0, 0x2000)               = 1073741919 0
ulock_wake(0x1, 0x7FFF5FBFCFEC, 0x0)             = -1 Err#2
issetugid(0x1, 0x7FFF5FBFCFEC, 0x0)              = 0 0
mprotect(0x10003F000, 0x88, 0x1)                 = 0 0
mprotect(0x100041000, 0x1000, 0x0)               = 0 0
mprotect(0x100057000, 0x1000, 0x0)               = 0 0
mprotect(0x100058000, 0x1000, 0x0)               = 0 0
mprotect(0x10006E000, 0x1000, 0x0)               = 0 0
mprotect(0x10006F000, 0x1000, 0x1)               = 0 0
mprotect(0x10003F000, 0x88, 0x3)                 = 0 0
mprotect(0x10003F000, 0x88, 0x1)                 = 0 0
getpid(0x10003F000, 0x88, 0x1)           = 4935 0
stat64("/AppleInternal/XBS/.isChrooted\0", 0x7FFF5FBFCEA8, 0x1)          = -1 Err#2
stat64("/AppleInternal\0", 0x7FFF5FBFCF40, 0x1)          = -1 Err#2
csops(0x1347, 0x7, 0x7FFF5FBFC9D0)               = 0 0
csops(0x1347, 0x7, 0x7FFF5FBFC2B0)               = 0 0
geteuid(0x1347, 0x7, 0x7FFF5FBFC2B0)             = 0 0

--
Burton Samograd
BusFactor1@gmail.com
http://BusFactor1.ca/


On Mon, Mar 20, 2017 at 5:43 AM, Ladislav Koščo <laci.kosco@gmail.com> wrote:
how about printing out the full path of file you are requesting? or maybe you have relative path used, and started the program from different path than expected.

On Mon, Mar 20, 2017 at 4:37 AM, BusFactor1 Inc. <busfactor1@gmail.com> wrote:
Hello,

I just started getting the following error when running my deployed application:

   Error reading image header  errno 2: No such file or directory

Has anybody else encountered this?  

I thought it might my my system and gave it a reboot, but no luck.  

--
Burton Samograd
BusFactor1@gmail.com
http://BusFactor1.ca



Re: Error reading image header on macOS

Further thoughts:

I think this might have to do with app Sandboxing but I’m not positive, as I’ve had the sandbox on for testing for quite a long time and haven’t changed it’s configuration.  Here is my sandbox.entitlements file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
       <key>com.apple.security.app-sandbox</key>
       <true/>
       <key>com.apple.security.files.user-selected.read-write</key>
       <true/>
</dict>
</plist>

One thing I am doing is trying to read/write files in “~/Library/Application Support/Personal Text Encryptor/” by default, which I thought was an area that can be written during sandboxing but I might be incorrect. I took a look over the sandboxing keys and didn’t find anything relevant to this area.

Sound plausible?

—
Burton Samograd
BusFactor1@gmail.com
http://BusFactor1.ca/


On Mar 20, 2017, at 6:19 AM, BusFactor1 Inc. <busfactor1@gmail.com> wrote:

Normally I would trace down a problem like this using 'strace on Linux, and I found that macOS has 'dtruss' which gives the following information:

Ringmap2:Personal Text Encryptor burton$ sudo dtruss "./Personal\ Text\ Encryptor.app/Contents/MacOS/Personal\ Text\ Encryptor" 
dtrace: system integrity protection is on, some features will not be available

SYSCALL(args)            = return
open("/dev/dtracehelper\0", 0x2, 0x7FFF5FBFE860)                 = 3 0
ioctl(0x3, 0x80086804, 0x7FFF5FBFE7E8)           = 0 0
close(0x3)               = 0 0
thread_selfid(0x3, 0x80086804, 0x7FFF5FBFE7E8)           = 487681 0
bsdthread_register(0x7FFFE6E1A1F0, 0x7FFFE6E1A1E0, 0x2000)               = 1073741919 0
ulock_wake(0x1, 0x7FFF5FBFCFEC, 0x0)             = -1 Err#2
issetugid(0x1, 0x7FFF5FBFCFEC, 0x0)              = 0 0
mprotect(0x10003F000, 0x88, 0x1)                 = 0 0
mprotect(0x100041000, 0x1000, 0x0)               = 0 0
mprotect(0x100057000, 0x1000, 0x0)               = 0 0
mprotect(0x100058000, 0x1000, 0x0)               = 0 0
mprotect(0x10006E000, 0x1000, 0x0)               = 0 0
mprotect(0x10006F000, 0x1000, 0x1)               = 0 0
mprotect(0x10003F000, 0x88, 0x3)                 = 0 0
mprotect(0x10003F000, 0x88, 0x1)                 = 0 0
getpid(0x10003F000, 0x88, 0x1)           = 4935 0
stat64("/AppleInternal/XBS/.isChrooted\0", 0x7FFF5FBFCEA8, 0x1)          = -1 Err#2
stat64("/AppleInternal\0", 0x7FFF5FBFCF40, 0x1)          = -1 Err#2
csops(0x1347, 0x7, 0x7FFF5FBFC9D0)               = 0 0
csops(0x1347, 0x7, 0x7FFF5FBFC2B0)               = 0 0
geteuid(0x1347, 0x7, 0x7FFF5FBFC2B0)             = 0 0

--
Burton Samograd
BusFactor1@gmail.com
http://BusFactor1.ca/


On Mon, Mar 20, 2017 at 5:43 AM, Ladislav Koščo <laci.kosco@gmail.com> wrote:
how about printing out the full path of file you are requesting? or maybe you have relative path used, and started the program from different path than expected.

On Mon, Mar 20, 2017 at 4:37 AM, BusFactor1 Inc. <busfactor1@gmail.com> wrote:
Hello,

I just started getting the following error when running my deployed application:

   Error reading image header  errno 2: No such file or directory

Has anybody else encountered this?  

I thought it might my my system and gave it a reboot, but no luck.  

--
Burton Samograd
BusFactor1@gmail.com
http://BusFactor1.ca




Re: Error reading image header on macOS

Further thoughts:

I am pretty sure this has to do with macOS app Sandboxing.  I’ve had the sandbox on for testing for quite a long time and haven’t changed it’s configuration in a while, but something seems to have changed.  Here is my sandbox.entitlements file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
       <key>com.apple.security.app-sandbox</key>
       <true/>
       <key>com.apple.security.files.user-selected.read-write</key>
       <true/>
</dict>
</plist>

One thing I am doing is trying to read/write files in “~/Library/Application Support/Personal Text Encryptor/” by default, which I thought was an area that can be written during sandboxing but I might be incorrect.  I'll continue investigating.

—
Burton Samograd
BusFactor1@gmail.com
http://BusFactor1.ca/


On Mar 20, 2017, at 6:19 AM, BusFactor1 Inc. <busfactor1@gmail.com> wrote:

Normally I would trace down a problem like this using 'strace on Linux, and I found that macOS has 'dtruss' which gives the following information:

Ringmap2:Personal Text Encryptor burton$ sudo dtruss "./Personal\ Text\ Encryptor.app/Contents/MacOS/Personal\ Text\ Encryptor" 
dtrace: system integrity protection is on, some features will not be available

SYSCALL(args)            = return
open("/dev/dtracehelper\0", 0x2, 0x7FFF5FBFE860)                 = 3 0
ioctl(0x3, 0x80086804, 0x7FFF5FBFE7E8)           = 0 0
close(0x3)               = 0 0
thread_selfid(0x3, 0x80086804, 0x7FFF5FBFE7E8)           = 487681 0
bsdthread_register(0x7FFFE6E1A1F0, 0x7FFFE6E1A1E0, 0x2000)               = 1073741919 0
ulock_wake(0x1, 0x7FFF5FBFCFEC, 0x0)             = -1 Err#2
issetugid(0x1, 0x7FFF5FBFCFEC, 0x0)              = 0 0
mprotect(0x10003F000, 0x88, 0x1)                 = 0 0
mprotect(0x100041000, 0x1000, 0x0)               = 0 0
mprotect(0x100057000, 0x1000, 0x0)               = 0 0
mprotect(0x100058000, 0x1000, 0x0)               = 0 0
mprotect(0x10006E000, 0x1000, 0x0)               = 0 0
mprotect(0x10006F000, 0x1000, 0x1)               = 0 0
mprotect(0x10003F000, 0x88, 0x3)                 = 0 0
mprotect(0x10003F000, 0x88, 0x1)                 = 0 0
getpid(0x10003F000, 0x88, 0x1)           = 4935 0
stat64("/AppleInternal/XBS/.isChrooted\0", 0x7FFF5FBFCEA8, 0x1)          = -1 Err#2
stat64("/AppleInternal\0", 0x7FFF5FBFCF40, 0x1)          = -1 Err#2
csops(0x1347, 0x7, 0x7FFF5FBFC9D0)               = 0 0
csops(0x1347, 0x7, 0x7FFF5FBFC2B0)               = 0 0
geteuid(0x1347, 0x7, 0x7FFF5FBFC2B0)             = 0 0

--
Burton Samograd
BusFactor1@gmail.com
http://BusFactor1.ca/


On Mon, Mar 20, 2017 at 5:43 AM, Ladislav Koščo <laci.kosco@gmail.com> wrote:
how about printing out the full path of file you are requesting? or maybe you have relative path used, and started the program from different path than expected.

On Mon, Mar 20, 2017 at 4:37 AM, BusFactor1 Inc. <busfactor1@gmail.com> wrote:
Hello,

I just started getting the following error when running my deployed application:

   Error reading image header  errno 2: No such file or directory

Has anybody else encountered this?  

I thought it might my my system and gave it a reboot, but no luck.  

--
Burton Samograd
BusFactor1@gmail.com
http://BusFactor1.ca




Updated at: 2020-12-10 08:31 UTC