Bad file descriptor error on High Sierra.

75 views
Skip to first unread message

mixtly

unread,
Oct 4, 2017, 8:09:13 AM10/4/17
to OSXFUSE
I'm developing a file sync client (kind of like Dropbox) and I noticed that on High Sierra app crashes (without any stacktrace) with message:
Message from debugger: Terminated due to signal 9

In system log, I see this:

10:24:44.026823 +0200 debugserver 2 +91.548922 sec [5b4d/0307]: error: ::thread_suspend (1a03) err = (os/kern) object terminated (0x00000025)
10:24:44.026914 +0200 debugserver 3 +0.000108 sec [5b4d/0307]: error: ::task_info ( target_task = 0x1503, flavor = TASK_BASIC_INFO, task_info_out => 0x7ffee9ce98c8, task_info_outCnt => 10 ) err = (os/kern) invalid argument (0x00000004)
10:24:44.042730 +0200 debugserver 4 +0.015787 sec [5b4d/1403]: error: ::read ( 4, 0x7000028c9a50, 1024 ) => -1 err = Bad file descriptor (0x00000009)
10:24:44.042837 +0200 debugserver Exiting.

The whole thing happens often when client needs to downsync (download) newly added files on the server.

I'm using NSURLSession with default configuration for file downloading.

Can't make any sense of this. Not sure if the error is related to NSURLSession or it happens in FUSE callbacks in some cases.

Interestingly, it happens only on High Sierra, on Sierra I never experienced this.

Did anyone encounter similar issue or does anyone have an idea what the problem might be?

mixtly

unread,
Oct 5, 2017, 7:59:51 AM10/5/17
to OSXFUSE
Solved. Problem was that releaseFileAtPath was called with invalid descriptor. Root cause was that in some cases createFileAtPath would return YES without assigning file descriptor to userData. The weird part is that this didn't cause problems on Sierra, just on High Sierra.
Reply all
Reply to author
Forward
0 new messages