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

Precompiling exits early using --inline=no -O0 #16398

Closed
Keno opened this issue May 16, 2016 · 5 comments · Fixed by #17824
Closed

Precompiling exits early using --inline=no -O0 #16398

Keno opened this issue May 16, 2016 · 5 comments · Fixed by #17824
Labels
compiler:precompilation Precompilation of modules regression Regression in behavior compared to a previous version upstream The issue is with an upstream dependency, e.g. LLVM

Comments

@Keno
Copy link
Member

Keno commented May 16, 2016

E.g.:

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.5.0-dev+4118 (2016-05-16 19:15 UTC)
 _/ |\__'_|_|_|\__'_|  |  master/5f22ab8* (fork: 4 commits, 0 days)
|__/                   |  x86_64-apple-darwin15.3.0

julia> using TerminalExtensions; using Gadfly; using Gallium
INFO: Recompiling stale cache file /Users/kfischer/.julia/lib/v0.5/DataStructures.ji for module DataStructures.
Process 17829 exited with status = 1 (0x00000001)
@kshyatt kshyatt added the compiler:precompilation Precompilation of modules label Jul 28, 2016
@vtjnash vtjnash added the upstream The issue is with an upstream dependency, e.g. LLVM label Aug 4, 2016
@vtjnash
Copy link
Member

vtjnash commented Aug 4, 2016

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap11.html#tag_11_01_03

it's unspecified in POSIX whether we will be terminated and unspecified if there's any way to prevent it. There's a chance we can work around this though.

@vtjnash
Copy link
Member

vtjnash commented Aug 4, 2016

simpler repro:

julia> p = spawn(detach(`./julia -e nothing`), (DevNull, STDOUT, DevNull))

@vtjnash vtjnash added the regression Regression in behavior compared to a previous version label Aug 4, 2016
@vtjnash
Copy link
Member

vtjnash commented Aug 4, 2016

hm, it seems there is of course a flag to change this behavior, if we don't like it:

diff --git a/src/unix/tty.c b/src/unix/tty.c
index 32fa37e..3727a83 100644
--- a/src/unix/tty.c
+++ b/src/unix/tty.c
@@ -87,7 +87,7 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, int fd, int readable) {
      * slave device.
      */
     if (uv__tty_is_slave(fd) && ttyname_r(fd, path, sizeof(path)) == 0)
-      r = uv__open_cloexec(path, O_RDWR);
+      r = uv__open_cloexec(path, O_RDWR | O_NOCTTY);
     else
       r = -1;

(adding regression flag since this code path was not present in the v0.4 releases)

@Keno
Copy link
Member Author

Keno commented Aug 4, 2016

Some of the tests rely on a detach process getting its own controlling terminal.

@vtjnash
Copy link
Member

vtjnash commented Aug 4, 2016

Which ones? That sounds like a bug in the test.

vtjnash added a commit to vtjnash/libuv that referenced this issue Jan 10, 2020
Since this re-open logic is supposed to be transparent to the parent
program, this flag helps ensure that there are no unintended
side-effects. This flag is already the default (and only possible
option) on FreeBSD. Normally, Linux will also act as if you passed
NOCTTY. However, it appears that mac OS sometimes strips the parent
process of its controlling terminal if you don't pass this flag.

Fixes: libuv#973
Fixes: JuliaLang/julia#16398
cjihrig pushed a commit to libuv/libuv that referenced this issue Jan 12, 2020
Since this re-open logic is supposed to be transparent to the parent
program, this flag helps ensure that there are no unintended
side-effects. This flag is already the default (and only possible
option) on FreeBSD. Normally, Linux will also act as if you passed
NOCTTY. However, it appears that mac OS sometimes strips the parent
process of its controlling terminal if you don't pass this flag.

Fixes: #973
Fixes: JuliaLang/julia#16398
PR-URL: #2619
Reviewed-By: Ben Noordhuis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:precompilation Precompilation of modules regression Regression in behavior compared to a previous version upstream The issue is with an upstream dependency, e.g. LLVM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants