Comments (6)
It looks to me like a combination of how parallel is implemented (fork
without exec
), and something that libuv is using in CoreServices. I don't know what libuv actually uses but I know it wouldn't build on Mac until I linked in the CoreServices framework.
This explains the general problem: http://objectivistc.tumblr.com/post/16187948939/you-must-exec-a-core-foundation-fork-safety-tale
Sooner or later (probably within 2 months?) I am going to add a daemonize option to httpuv, it is needed for gigvis.
from httpuv.
Interesting. Thanks.
from httpuv.
What I don't understand is why it also happens when httpuv is only loaded in the forked child process, not in the parent process. So in this case, the CF process is not forked.
Also the error only appears when used in Rstudio. When running the above code snippet in a regular R session in the console on the same machine, I don't get to see this warning.
from httpuv.
The problem seems to occur whenever CF has been loaded in the parent process (whether by httpuv or anything else). So the Mac R GUI also triggers this problem; the reason it doesn't occur at the command line must be because no CF code is being loaded (which would not be very surprising).
Another link (the referenced Apple docs are instructive):
http://stackoverflow.com/questions/2707572/fork-within-cocoa-application
If you could exec the child process then it would be fine.
from httpuv.
Hmm alright. I asked @s-u for his 2ct, hope he can have a look.
from httpuv.
gdb is your friend:
#0 0x00007fff842a84f4 in __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__ ()
#1 0x00007fff841f46f5 in CFRunLoopSourceCreate ()
#2 0x0000000103d85b61 in uv__platform_loop_init (loop=0x103dae2c0, default_loop=0) at darwin.c:69
#3 0x0000000103d7b5da in uv__loop_init (loop=0x103dae2c0, default_loop=0) at loop.c:62
#4 0x0000000103d78c51 in uv_default_loop () at core.c:222
#5 0x0000000103d62c2c in makeServer (host=@0x7fff5fbf7908, port=1606383360, onHeaders=@0x0, onBodyData=@0x0, onRequest=@0x0, onWSOpen=@0x7fff5fbf7930, onWSMessage=@0x7fff5fbf7920, onWSClose=@0x7fff5fbf7910) at httpuv.cpp:327
as you can see httpuv is trying to run the CF event loop despite R_isForkedChild being set. Ideally, it should not be running the event loop itself but add a hook into the R event loop -- that would work, because R suspends the event loop when unsafe (e.g. while forked).
from httpuv.
Related Issues (20)
- Random crashes on MacOS HOT 16
- Unable to install httput - R 4.2.2 HOT 3
- Warning with clang 16 HOT 2
- Possible to use multiple worker threads? HOT 2
- Unable to install httpuv - R 3.5.3 HOT 2
- macOS: Assertion fails when closing `{httpuv}` server HOT 2
- CRAN firedrill 2023-05 HOT 4
- clang-ASAN: "runtime error: applying zero offset to null pointer"
- httpuv v1.6.11 release checklist HOT 1
- httpuv 1.6.10 crashes with "uv__finish_close: Assertion `handle->flags & UV_HANDLE_CLOSING' failed" HOT 4
- Don't dynamically link to libuv on macOS
- CI workflows for sanitizers HOT 1
- Simple server API HOT 1
- Heartbeat in discord HOT 1
- Compile error with clang on WIndows HOT 1
- Release httpuv 1.6.12
- warning: format string is not a string literal
- Release httpuv 1.6.13
- testunit fails: "runStaticServer() throws an error if the requested port is used --" HOT 13
- no response in linux HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from httpuv.