Skip to content

Julia print backtrace on SIGPIPE by default #9719

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

Closed
yuyichao opened this issue Jan 11, 2015 · 5 comments
Closed

Julia print backtrace on SIGPIPE by default #9719

yuyichao opened this issue Jan 11, 2015 · 5 comments
Labels
error handling Handling of exceptions by Julia or the user

Comments

@yuyichao
Copy link
Contributor

AFAIK most program either ignore SIGPIPE or silently quite on it...

yuyichao% LANG=C julia -f -e 'sleep(1); println()' | :

signal (13): Broken pipe
write at /usr/bin/../lib/libpthread.so.0 (unknown line)
unknown function (ip: 756400812)
uv_write2 at /usr/bin/../lib/julia/libjulia.so (unknown line)
jl_write_copy at /usr/bin/../lib/julia/libjulia.so (unknown line)
jl_putc_copy at /usr/bin/../lib/julia/libjulia.so (unknown line)
jl_pututf8_copy at /usr/bin/../lib/julia/libjulia.so (unknown line)
write at ./stream.jl:732
println at ./string.jl:5
jl_apply_generic at /usr/bin/../lib/julia/libjulia.so (unknown line)
println at ./string.jl:8
jl_apply_generic at /usr/bin/../lib/julia/libjulia.so (unknown line)
unknown function (ip: 756153688)
unknown function (ip: 756151199)
unknown function (ip: 756223645)
unknown function (ip: 756223783)
jl_toplevel_eval_in at /usr/bin/../lib/julia/libjulia.so (unknown line)
process_options at /usr/lib/julia/sys.so (unknown line)
_start at /usr/lib/julia/sys.so (unknown line)
jlcall__start_40944 at /usr/lib/julia/sys.so (unknown line)
jl_apply_generic at /usr/bin/../lib/julia/libjulia.so (unknown line)
unknown function (ip: 4200293)
unknown function (ip: 4199194)
__libc_start_main at /usr/bin/../lib/libc.so.6 (unknown line)
unknown function (ip: 4199269)
unknown function (ip: 0)
@yuyichao
Copy link
Contributor Author

On Linux with git master...

@tkelman
Copy link
Contributor

tkelman commented Jan 11, 2015

I'd rather not turn the backtrace off for this at this time - ref #9501, where we often were not getting backtraces on the Travis failures (possibly because they were running as parallel workers?).

@tkelman tkelman added the error handling Handling of exceptions by Julia or the user label Jan 11, 2015
@yuyichao
Copy link
Contributor Author

Hmmm, that does look like a nasty bug...
However, IMHO, the correct way to do handle this is

  1. Use the default handler on SIGPIPE by default
  2. Set the backgrace handler in runtest
  3. When running with multiple processes, detect in the exit state whether the process is killed with a signal.

@tkelman
Copy link
Contributor

tkelman commented Jan 11, 2015

That sounds like a reasonable plan to me.

@yuyichao
Copy link
Contributor Author

The current behavior is throwing a exception on SIGPIPE and IMHO it's one of the best ways to do it so I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error handling Handling of exceptions by Julia or the user
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants