Skip to content

Conversation

@vtjnash
Copy link
Member

@vtjnash vtjnash commented Oct 11, 2019

Fixes for internal (and sometimes external) handling of error codes. This should fix most of the cases where we report the wrong error code, although some cases might still be hanging around (with the most likely culprits now being any sort of logging code).

@vtjnash vtjnash added system:windows Affects only Windows error handling Handling of exceptions by Julia or the user backport 1.0 labels Oct 11, 2019
base/error.jl Outdated
## system error handling ##
"""
systemerror(sysfunc, iftrue)
windowserror(sysfunc[, errno::Cint=Libc.errno()])
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
windowserror(sysfunc[, errno::Cint=Libc.errno()])
systemerror(sysfunc[, errno::Cint=Libc.errno()])

DWORD *plast_error = (DWORD*)(__readfsdword(0x18) + 0x34);
DWORD last_error = *plast_error;
#else
DWORD last_error = GetLastError();
Copy link
Member

Choose a reason for hiding this comment

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

Ouch this is an unfortunate design in the windows API...

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, and this is not a good place to be having lots of extra function calls, so I'm inlining just the real meat of it (when possible). OTOH, wasn't it great to know that the operation of loading the gc-frame was always successful?

@vtjnash
Copy link
Member Author

vtjnash commented Oct 16, 2019

@Keno can you fix the analyzegc pass for https://build.julialang.org/#/builders/146/builds/3029/steps/3/logs/stdio

@Keno
Copy link
Member

Keno commented Oct 16, 2019

@vtjnash vtjnash force-pushed the jn/error branch 2 times, most recently from a408578 to e9ae67d Compare October 24, 2019 20:03
@vtjnash
Copy link
Member Author

vtjnash commented Oct 28, 2019

@JeffBezanson could you review 3905102 (now squashed into here)?

@vtjnash
Copy link
Member Author

vtjnash commented Oct 28, 2019

I also dropped the clipboard fixes from here, since the buildbots are having trouble. Will revive that from https://github.com/JuliaLang/julia/tree/jn/error-clipboard once this is merged.

and simplify some of the code and makefile rules
This is helpful when doing proper cleanup, which might otherwise clear the error code.
Previously, we were returning the error code from `stat` instead (success) in some cases.
Also make it unicode text, while we're here.

Fix #15117
@vtjnash vtjnash merged commit f0772c5 into master Oct 30, 2019
@vtjnash vtjnash deleted the jn/error branch October 30, 2019 23:21
@KristofferC KristofferC mentioned this pull request Nov 7, 2019
19 tasks
@KristofferC KristofferC mentioned this pull request Nov 29, 2019
18 tasks
@KristofferC
Copy link
Member

Is this really feasible to backport?

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 system:windows Affects only Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants