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

Use require(pkgid, ...) instead of relative require #29770

Merged
merged 1 commit into from
Oct 31, 2018
Merged

Conversation

vchuravy
Copy link
Member

Should fix #29234 and supersedes #29252

Copy link
Sponsor Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add test that JULIA_PROJECT= ./julia -p 1 works?

@bjarthur

This comment has been minimized.

@vchuravy
Copy link
Member Author

Does anyone have a good test for this? JULIA_PROJECT= ./julia -p 1 is not sufficient, and my attempts launching through ssh didn't suffice either. Maybe @jameshclrk or @bjarthur?

@vchuravy
Copy link
Member Author

The error here seems unrelated, but also quite odd on both Win32 and Linux32 we are getting an error the BigInt is an undefined variable.

record_backtrace at /cygdrive/c/projects/julia/src\task.c:217
jl_throw at /cygdrive/c/projects/julia/src\task.c:410
jl_undefined_var_error at /cygdrive/c/projects/julia/src\rtutils.c:129
jl_get_binding_or_error at /cygdrive/c/projects/julia/src\module.c:290
div at .\int.jl:774
tryparse_internal at .\parse.jl:110
#parse#330 at .\parse.jl:225
unknown function (ip: 0762F579)
jl_fptr_trampoline at /cygdrive/c/projects/julia/src\gf.c:1843
jl_apply_generic at /cygdrive/c/projects/julia/src\gf.c:2198 [inlined]
jl_apply at /cygdrive/c/projects/julia/src\julia.h:1560 [inlined]
jl_invoke at /cygdrive/c/projects/julia/src\gf.c:56
parse at .\parse.jl:225
unknown function (ip: 0762F263)
jl_fptr_trampoline at /cygdrive/c/projects/julia/src\gf.c:1843
jl_apply_generic at /cygdrive/c/projects/julia/src\gf.c:2198
@uint128_str at .\int.jl:575
jl_fptr_args at /cygdrive/c/projects/julia/src\gf.c:1853
jl_fptr_trampoline at /cygdrive/c/projects/julia/src\gf.c:1843
jl_invoke_julia_macro at /cygdrive/c/projects/julia/src\ast.c:1030
jl_expand_macros at /cygdrive/c/projects/julia/src\ast.c:1092
jl_expand_macros at /cygdrive/c/projects/julia/src\ast.c:1135
jl_expand_macros at /cygdrive/c/projects/julia/src\ast.c:1135
jl_expand_macros at /cygdrive/c/projects/julia/src\ast.c:1135
jl_expand_macros at /cygdrive/c/projects/julia/src\ast.c:1135
jl_expand_macros at /cygdrive/c/projects/julia/src\ast.c:1135
jl_expand_macros at /cygdrive/c/projects/julia/src\ast.c:1135
jl_expand_macros at /cygdrive/c/projects/julia/src\ast.c:1135
jl_expand_macros at /cygdrive/c/projects/julia/src\ast.c:1135
jl_expand_macros at /cygdrive/c/projects/julia/src\ast.c:1135
jl_expand_macros at /cygdrive/c/projects/julia/src\ast.c:1135
jl_parse_eval_all at /cygdrive/c/projects/julia/src\ast.c:865
jl_load at /cygdrive/c/projects/julia/src\toplevel.c:834 [inlined]
jl_load_ at /cygdrive/c/projects/julia/src\toplevel.c:841
jl_get_ptls_states at /cygdrive/c/projects/julia/src\threading.c:131
include at .\sysimg.jl:36
jl_fptr_args at /cygdrive/c/projects/julia/src\gf.c:1853
jl_apply_generic at /cygdrive/c/projects/julia/src\gf.c:2198
do_call at /cygdrive/c/projects/julia/src\interpreter.c:323
eval_value at /cygdrive/c/projects/julia/src\interpreter.c:411
eval_stmt_value at /cygdrive/c/projects/julia/src\interpreter.c:362 [inlined]
eval_body at /cygdrive/c/projects/julia/src\interpreter.c:754
jl_interpret_toplevel_thunk_callback at /cygdrive/c/projects/julia/src\interpreter.c:880
unknown function (ip: FFFFFFFE)
unknown function (ip: 0352FA2F)
unknown function (ip: FFFFFFFF)
jl_interpret_toplevel_thunk at /cygdrive/c/projects/julia/src\interpreter.c:889
jl_toplevel_eval_flex at /cygdrive/c/projects/julia/src\toplevel.c:772
jl_eval_module_expr at /cygdrive/c/projects/julia/src\toplevel.c:180
jl_toplevel_eval_flex at /cygdrive/c/projects/julia/src\toplevel.c:610
jl_parse_eval_all at /cygdrive/c/projects/julia/src\ast.c:881
jl_load at /cygdrive/c/projects/julia/src\toplevel.c:834
exec_program at /cygdrive/c/projects/julia/ui\repl.c:36
true_main at /cygdrive/c/projects/julia/ui\repl.c:124
wmain at /cygdrive/c/projects/julia/ui\repl.c:233
__tmainCRTStartup at /usr/src/debug/mingw64-i686-runtime-5.0.4-1/crt\crtexe.c:329
BaseThreadInitThunk at C:\windows\SYSTEM32\KERNEL32.DLL (unknown line)
RtlInitializeExceptionChain at C:\windows\SYSTEM32\ntdll.dll (unknown line)
RtlInitializeExceptionChain at C:\windows\SYSTEM32\ntdll.dll (unknown line)
LoadError("sysimg.jl", 330, LoadError("stream.jl", 219, LoadError("<macrocall>", 0, UndefVarError(:BigInt))))

@jameshclrk
Copy link

This is the most minimal test case I've found to trigger the missing Sockets package bug.

$ nc -l 12345 &
$ exec 3<>/dev/tcp/localhost/12345
$ ./julia <&3

julia 1.0.0 and 1.0.1 crash and with this pull request they don't crash.

However, if/when julia successfully initialises, the program will wait for input from the port nc is listening on. To work around this I came up with:

$ timeout 5 nc -l 12345 &
$ exec 3<>/dev/tcp/localhost/12345
$ ./julia <&3

I'm not sure of your test environment, but this needs a netcat implementation, timeout (in coreutils) and bash compiled with "--enable-net-redirections".

@bjarthur

This comment has been minimized.

@vchuravy
Copy link
Member Author

@bjarthur Comments like this are not productive, and do not make it more likely for me or someone else to do something.

@jameshclrk Thanks!

timeout 5 nc -l 12345 &
exec 3<>/dev/tcp/localhost/12345
./julia -e "exit()" -i <&3

Seems to do what I want. I was trying to make run(pipeline(julia -e "exit()" -i, stdin=TCPSocket())) work but I get a EINVAL from that. @vtjnash Do you have an idea how to write this in pure Julia? I should note that the scipt above requires obenbsd netcat, and gnu netcat doesn't work, so I am hesitant to add a new dependency for this test.

@vtjnash
Copy link
Sponsor Member

vtjnash commented Oct 29, 2018

TCPSocket() -- you need to initialize this socket (perhaps use uv_socketpair)

@bjarthur
Copy link
Contributor

sorry. i could've worded that better. but i thought it would be good for the core developers to know the feedback i'm getting about the 1.0 release. i get tired of having to explain that in julia-land, 1.0 just means a feature freeze, and not that everything works. people just don't get it, because nothing else works that way.

at any rate, thanks for working on this. it's way beyond my familiarity with base. i look forward to introducing this colleague to julia once it lands.

@jameshclrk
Copy link

run(pipeline(julia -e "exit()" -i, stdin=TCPSocket()))

You got it! If you call TCPSocket() with delay=false, it causes the crash.

julia> run(pipeline(`julia -e "exit()" -i`, stdin=TCPSocket(delay=false)))
fatal: error thrown and no exception handler available.
InitError(mod=:Base, error=ArgumentError(msg="Package Sockets not found in current path:
- Run `Pkg.add("Sockets")` to install the Sockets package.
"))
...

@vchuravy
Copy link
Member Author

Ok, this should be good to go and I will merge once CI is green.

@KristofferC KristofferC merged commit 6ae6551 into master Oct 31, 2018
@KristofferC KristofferC deleted the vc/require branch October 31, 2018 00:33
KristofferC pushed a commit that referenced this pull request Oct 31, 2018
Co-authored-by: Jameson Nash <[email protected]>
(cherry picked from commit 6ae6551)
KristofferC pushed a commit that referenced this pull request Oct 31, 2018
Co-authored-by: Jameson Nash <[email protected]>
(cherry picked from commit 6ae6551)
KristofferC pushed a commit that referenced this pull request Nov 2, 2018
Co-authored-by: Jameson Nash <[email protected]>
(cherry picked from commit 6ae6551)
KristofferC pushed a commit that referenced this pull request Feb 11, 2019
Co-authored-by: Jameson Nash <[email protected]>
(cherry picked from commit 6ae6551)
KristofferC pushed a commit that referenced this pull request Feb 20, 2020
Co-authored-by: Jameson Nash <[email protected]>
(cherry picked from commit 6ae6551)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Julia fails to launch when stdin is a TCP Socket
5 participants