Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addprocs works in terminal, fails in Emacs #18818

Closed
danielmatz opened this issue Oct 6, 2016 · 7 comments · Fixed by #24190
Closed

addprocs works in terminal, fails in Emacs #18818

danielmatz opened this issue Oct 6, 2016 · 7 comments · Fixed by #24190
Labels
parallelism Parallel or distributed computation upstream The issue is with an upstream dependency, e.g. LLVM

Comments

@danielmatz
Copy link
Contributor

I have a script that runs fine in the terminal, but fails when I try to run it from Emacs.

I can reproduce this with a file that contains only addprocs(1).

Here's the error output:

signal (4): Illegal instruction: 4
while loading /Users/dmatz/Desktop/test.jl, in expression starting on line 1
abort at /usr/local/opt/llvm37-julia/lib/llvm-3.7/lib/libLLVM-3.7.dylib (unknown line)
uv_thread_create at /private/tmp/julia-20160920-99724-ulo33f/deps/srccache/libuv-8d5131b6c1595920dd30644cd1435b4f344b46c8/src/unix/thread.c:88
init_once at /private/tmp/julia-20160920-99724-ulo33f/deps/srccache/libuv-8d5131b6c1595920dd30644cd1435b4f344b46c8/src/threadpool.c:173
__pthread_once_handler at /usr/lib/system/libsystem_pthread.dylib (unknown line)
_os_once at /usr/lib/system/libsystem_platform.dylib (unknown line)
pthread_once at /usr/lib/system/libsystem_pthread.dylib (unknown line)
uv_once at /private/tmp/julia-20160920-99724-ulo33f/deps/srccache/libuv-8d5131b6c1595920dd30644cd1435b4f344b46c8/src/unix/thread.c:239
uv__work_submit at /private/tmp/julia-20160920-99724-ulo33f/deps/srccache/libuv-8d5131b6c1595920dd30644cd1435b4f344b46c8/src/threadpool.c:184
uv_getaddrinfo at /private/tmp/julia-20160920-99724-ulo33f/deps/srccache/libuv-8d5131b6c1595920dd30644cd1435b4f344b46c8/src/unix/getaddrinfo.c:186
jl_getaddrinfo at /private/tmp/julia-20160920-99724-ulo33f/src/jl_uv.c:725
getaddrinfo at ./socket.jl:574
jlcall_getaddrinfo_33144 at /usr/local/Cellar/julia/0.5.0/lib/julia/sys.dylib (unknown line)
getaddrinfo at ./socket.jl:589
connect! at ./socket.jl:686
connect at ./stream.jl:959 [inlined]
connect_to_worker at ./managers.jl:483
unknown function (ip: 0x317697039)
jl_call_method_internal at /private/tmp/julia-20160920-99724-ulo33f/src/./julia_internal.h:189 [inlined]
jl_apply_generic at /private/tmp/julia-20160920-99724-ulo33f/src/gf.c:1942
connect at ./managers.jl:425
jlcall_connect_23326 at /usr/local/Cellar/julia/0.5.0/lib/julia/sys.dylib (unknown line)
jl_call_method_internal at /private/tmp/julia-20160920-99724-ulo33f/src/./julia_internal.h:189 [inlined]
jl_apply_generic at /private/tmp/julia-20160920-99724-ulo33f/src/gf.c:1942
create_worker at ./multi.jl:1786
setup_launched_worker at ./multi.jl:1733
unknown function (ip: 0x317692b1d)
jl_call_method_internal at /private/tmp/julia-20160920-99724-ulo33f/src/./julia_internal.h:189 [inlined]
jl_apply_generic at /private/tmp/julia-20160920-99724-ulo33f/src/gf.c:1942
#649 at ./task.jl:360
unknown function (ip: 0x31769273f)
jl_call_method_internal at /private/tmp/julia-20160920-99724-ulo33f/src/./julia_internal.h:189 [inlined]
jl_apply_generic at /private/tmp/julia-20160920-99724-ulo33f/src/gf.c:1942
jl_apply at /private/tmp/julia-20160920-99724-ulo33f/src/./julia.h:1392 [inlined]
start_task at /private/tmp/julia-20160920-99724-ulo33f/src/task.c:253
Allocations: 1273026 (Pool: 1272116; Big: 910); GC: 0

signal (6): Abort trap: 6
while loading /Users/dmatz/Desktop/test.jl, in expression starting on line 1
sigprocmask at /usr/lib/system/libsystem_kernel.dylib (unknown line)
Allocations: 1273026 (Pool: 1272116; Big: 910); GC: 0

After it errors out, there is an orphaned julia process that has 100% CPU usage.

I'm on Mac OS X. I used homebrew to install Julia.

julia> versioninfo()
Julia Version 0.5.0
Commit 3c9d753* (2016-09-19 18:14 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin14.5.0)
  CPU: Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
  WORD_SIZE: 64
  BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, ivybridge)
@danielmatz danielmatz changed the title Adding a process works in terminal, fails in Emacs addproc works in terminal, fails in Emacs Oct 6, 2016
@danielmatz danielmatz changed the title addproc works in terminal, fails in Emacs addprocs works in terminal, fails in Emacs Oct 6, 2016
@kshyatt kshyatt added the parallelism Parallel or distributed computation label Oct 6, 2016
@vtjnash
Copy link
Member

vtjnash commented Oct 6, 2016

From looking at the codepath there, it looks like this should only happen if the parent process (in this case emacs), set RLIMIT_STACK to an invalid value? So this is probably an emacs bug, although we can probably be more robust against it.

@vtjnash
Copy link
Member

vtjnash commented Oct 6, 2016

min repro:

ulimit -S -s 7001
./julia -e 'getaddrinfo("localhost")'

@vtjnash vtjnash added the upstream The issue is with an upstream dependency, e.g. LLVM label Oct 6, 2016
@andreasnoack
Copy link
Member

@vtjnash This still segfaults. Was the fix ever applied to our libuv fork?

@vtjnash
Copy link
Member

vtjnash commented Jan 3, 2017

I don't think it was, no.

@jgorham
Copy link

jgorham commented Jan 10, 2017

Just stumbled over this thread as well- I'm guessing the precompiled dmg was compiled with this older version of libuv. Would be nice to get an updated version up if possible! I'm going to pull down the source now.

@swadey
Copy link
Contributor

swadey commented Jul 28, 2017

also seems to happen when JULIA_NUM_THREADS is set to > 1

@hawkish
Copy link

hawkish commented Oct 16, 2017

This looks like my issue. #24169

ararslan added a commit that referenced this issue Oct 18, 2017
This includes a fix from upstream libuv that ensures that the thread
stack size is set to a multiple of the page size.

Fixes #18818
Fixes #24169
ararslan added a commit that referenced this issue Oct 18, 2017
This includes a fix from upstream libuv that ensures that the thread
stack size is set to a multiple of the page size.

Fixes #18818
Fixes #24169
ararslan added a commit that referenced this issue Oct 18, 2017
This includes a fix from upstream libuv that ensures that the thread
stack size is set to a multiple of the page size.

Fixes #18818
Fixes #24169
ararslan added a commit that referenced this issue Nov 2, 2017
This includes a fix from upstream libuv that ensures that the thread
stack size is set to a multiple of the page size.

Fixes #18818
Fixes #24169
ararslan added a commit that referenced this issue Nov 11, 2017
This includes a fix from upstream libuv that ensures that the thread
stack size is set to a multiple of the page size.

Fixes #18818
Fixes #24169
ararslan added a commit that referenced this issue Nov 11, 2017
This includes a fix from upstream libuv that ensures that the thread
stack size is set to a multiple of the page size.

Fixes #18818
Fixes #24169
ararslan added a commit that referenced this issue Nov 11, 2017
This includes a fix from upstream libuv that ensures that the thread
stack size is set to a multiple of the page size.

Fixes #18818
Fixes #24169
ararslan added a commit that referenced this issue Nov 11, 2017
This includes a fix from upstream libuv that ensures that the thread
stack size is set to a multiple of the page size.

Fixes #18818
Fixes #24169

(cherry picked from commit 6a23e23)
ararslan added a commit that referenced this issue Nov 11, 2017
This includes a fix from upstream libuv that ensures that the thread
stack size is set to a multiple of the page size.

Fixes #18818
Fixes #24169

(cherry picked from commit 6a23e23)
ararslan added a commit that referenced this issue Nov 14, 2017
This includes a fix from upstream libuv that ensures that the thread
stack size is set to a multiple of the page size.

Fixes #18818
Fixes #24169

(cherry picked from commit 6a23e23)
ararslan added a commit that referenced this issue Nov 21, 2017
This includes a fix from upstream libuv that ensures that the thread
stack size is set to a multiple of the page size.

Fixes #18818
Fixes #24169

(cherry picked from commit 6a23e23)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parallelism Parallel or distributed computation upstream The issue is with an upstream dependency, e.g. LLVM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants