libvips / libvips/ruby-vips

OS X 10.13.3 exposes bad fork() issue

Open
#155 26 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
904
Forks
64
PR merge metrics
No merged PRs in 30d

Description

After updating to OS X 10.13.3, I received the following error trying to require 'vips':

objc[25602]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[25602]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.

Some googling took me to this post, which explains that the error comes from “incorrect code that happened to work most of the time in the past.” I have no way of knowing whether the issue is in ruby-vips or ffior libvips itself, and I don't really have the time or knowledge to track it down. Using one of that page's suggested workarounds – setting OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES in the environment – allowed me to load ruby-vips without issue and get on with my work, though I realize I'm just asking OS X to hang later if it encounters a deadlock instead of crashing the process now.

I'm reporting it here so there's both an issue to track and a concise explanation and workaround for anyone else who happens to google this error in a vips context.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure at require 'vips' on OS X 10.13.3, with and without OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES. Trace whether the fork failure belongs to ruby-vips, ffi, or libvips; done means identifying the responsible component and providing a safe fix or documented workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.