![]() It was, however, proposed that it might make more sense for Ruby on macOS High Sierra and onward to implicitly initialise the Objective-C framework itself, so that forked processes work roughly as expected even if they intend to use Objective-C APIs. dlopen '/System/Library/Frameworks/amework/Foundation' end endĪ similar fix has now been included in Passenger ( ). The workaround (specific to Puma’s DSL) was: # Work around macOS 10.13 and later being very picky about # `fork` usage and interactions with Objective-C code # see: if /darwin/ =~ RUBY_PLATFORM before_fork do require 'fiddle' # Dynamically load amework, ~implicitly~ initialising # the Objective-C runtime before any forking happens in Puma Fiddle. This causes forked processes using other Objective-C APIs to not crash. ![]() This includes Puma, Unicorn, iodine and Passenger.Ī workaround I proposed for Puma was to implicitly load the Objective-C runtime before performing any forks ( ). This means that many applications which use forking to process concurrently will forcibly crash if the forked process calls out to any Objective-C library when Objective-C was not already initialised in the host process. MacOS High Sierra has changed the behaviour of the fork syscall such that initialising Objective-C APIs in forked processes are treated as errors. This was originally discussed on the issue tracker for Puma ( ), however, it is possible that it would make more sense for inclusion in the Ruby implementation itself.
0 Comments
Leave a Reply. |