NFC: Add fprint variants of internal print functions#54835
NFC: Add fprint variants of internal print functions#54835topolarity merged 7 commits intomasterfrom
fprint variants of internal print functions#54835Conversation
9f57800 to
37ce01c
Compare
fprint variants of internal print functionsfprint variants of internal print functions
fprint variants of internal print functionsfprint variants of internal print functions
fprint variants of internal print functionsfprint variants of internal print functions
|
I started to try to rebase this, but then noticed that it changed |
|
Is that not covered by:
|
|
Ah, I guess that is true. But you're assuming that ios_t is async-signal-safe, which is only true in bm_none mode or if locally created. Do you want to rebase it then, but use |
|
I guess actually |
No complaints here, but isn't that how it's already configured? Lines 1074 to 1076 in f0ece4a |
|
It is initialized that way, but that isn't the same as being configured that way arbitrarily later in the program. (and yes, that is where I copied that code from haha) |
37ce01c to
377554f
Compare
This is not exposed to flisp and is intended for safe printing in an async-signal context. Accordingly, it must be configured to write to an `fd` with `bm_none`.
This allows backtraces to be printed somewhere other than stderr
This is similar to `jl_static_show` but is wrapped in a setjmp() for error tolerance.
377554f to
d4137f1
Compare
This change adds a small dialog (disabled by default) for fatal errors on Windows with a corresponding entry in the `Application` log (in Event Viewer, enabled by default) This is intended primarily for users of PackageCompiler.jl, who might be using Julia in a GUI application. If a Julia-compiled library fails in a GUI application, users currently have no good way to know why/how their application crashed if, e.g., an exception was accidentally left unhandled in their Julia code. Depends on #54835
|
@topolarity I am now seeing this in "build x86_64-linux-gnummtk |
This adds/changes a number of `fprint_*` variants to internal debug
functions:
- rename + new `ios_t *` argument:
- `jl_critical_error` -> `jl_fprint_critical_error`
- `jl_print_native_codeloc` -> `jl_fprint_native_codeloc`
- `jl_print_bt_entry_codeloc` -> `jl_fprint_bt_entry_codeloc`
- `jl_gc_debug_print_status` -> `jl_gc_debug_fprint_status`
- `jl_gc_debug_critical_error` -> `jl_gc_debug_fprint_critical_error`
- new `fprint_*` variants:
- `jl_safe_fprintf`
- `jl_safe_static_show`
- `jl_fprint_backtrace(t)`
Note that care needs to be taken w.r.t. what `ios_t *` value is passed
into these functions from within a signal handler on Unix. Memory
allocation is not async-signal-safe, so the ios_t needs to wrap a raw
`fd_t` handle.
Immediate motivation is JuliaLang#54836
This change adds a small dialog (disabled by default) for fatal errors on Windows with a corresponding entry in the `Application` log (in Event Viewer, enabled by default) This is intended primarily for users of PackageCompiler.jl, who might be using Julia in a GUI application. If a Julia-compiled library fails in a GUI application, users currently have no good way to know why/how their application crashed if, e.g., an exception was accidentally left unhandled in their Julia code. Depends on JuliaLang#54835
This adds/changes a number of
fprint_*variants to internal debug functions:ios_t *argument:jl_critical_error->jl_fprint_critical_errorjl_print_native_codeloc->jl_fprint_native_codelocjl_print_bt_entry_codeloc->jl_fprint_bt_entry_codelocjl_gc_debug_print_status->jl_gc_debug_fprint_statusjl_gc_debug_critical_error->jl_gc_debug_fprint_critical_errorfprint_*variants:jl_safe_fprintfjl_safe_static_showjl_fprint_backtrace(t)Note that care needs to be taken w.r.t. what
ios_t *value is passed into these functions from within a signal handler on Unix. Memory allocation is not async-signal-safe, so the ios_t needs to wrap a rawfd_thandle.Immediate motivation is #54836