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

rm(force=true) clobbers exception #23150

Closed
maleadt opened this issue Aug 6, 2017 · 1 comment
Closed

rm(force=true) clobbers exception #23150

maleadt opened this issue Aug 6, 2017 · 1 comment
Labels
domain:error handling Handling of exceptions by Julia or the user

Comments

@maleadt
Copy link
Member

maleadt commented Aug 6, 2017

MWE:

main() = error("test")

try
    main()
catch ex
    rm("nonexisting"; force=true)
    rethrow(ex)
end

This reports a stacktrace pointing to the failed uv_error (because of nonexisting not existing), which should have been caught and discarded, and not to our ErrorException:

Stacktrace:
 [1] uv_error at ./libuv.jl:68 [inlined]
 [2] unlink(::String) at ./file.jl:500
 [3] #rm#7(::Bool, ::Bool, ::Function, ::String) at ./file.jl:145
 [4] (::Base.Filesystem.#kw##rm)(::Array{Any,1}, ::Base.Filesystem.#rm, ::String) at ./<missing>:0
 [5] include_from_node1(::String) at ./loading.jl:569
 [6] include(::String) at ./sysimg.jl:14
 [7] process_options(::Base.JLOptions) at ./client.jl:305
 [8] _start() at ./client.jl:371

Printing ex after the call to rm still reports the ErrorException, so I guess the nested try ... catch to implement rm's force mode clobbers whatever global state contains the current active exception.

Tested on 0.5, 0.6 and master.

@maleadt maleadt added the domain:error handling Handling of exceptions by Julia or the user label Aug 6, 2017
maleadt added a commit to maleadt/LLVM.jl that referenced this issue Aug 6, 2017
@yuyichao
Copy link
Contributor

yuyichao commented Aug 6, 2017

Dup of #19979 and related to #13947

@yuyichao yuyichao closed this as completed Aug 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:error handling Handling of exceptions by Julia or the user
Projects
None yet
Development

No branches or pull requests

2 participants