-
Notifications
You must be signed in to change notification settings - Fork 0
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
--safe-crash-log-file flag #140
Conversation
…ia into dcn-safe-crash-log-file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jl_inside_signal_handler()
will return 1 for the mutator threads when they're stopped for GC... do they ever call jl_safe_printf
while they're waiting?
That's the only question I have about this... are there any other situations where we call jl_safe_printf
in signal handler context besides when we're emitting a stack trace.
…nix.c Co-authored-by: Kiran Pamnany <[email protected]>
…in.c Co-authored-by: Kiran Pamnany <[email protected]>
Comment for the future: Line 438 in ba5345f
void jl_critical_error(int sig, int si_code, bt_context_t *context, jl_task_t *ct) which calls https://github.com/RelationalAI/julia/blob/v1.10.2%2BRAI/src/stackwalk.c#L658 void jl_print_bt_entry_codeloc(int sig, jl_bt_element_t *bt_entry) JL_NOTSAFEPOINT
We could work up in the stack to emit a single JSON line that includes all backtrace lines if we want to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is okay. I don't much like the name --safe-crash-log-file
, but no need for bike-shedding atm. :)
* --safe-crash-log-file flag * Update init.c * json escape jl_safe_printf when safe crash log file * add timestamp to json logs * port it to aarch64 darwin * fix minor warning * missing double quote * Suggestion from code review: make sig_stack_size a const in signals-unix.c Co-authored-by: Kiran Pamnany <[email protected]> * Suggestion from code review: make sig_stack size a const in signals-win.c Co-authored-by: Kiran Pamnany <[email protected]> * more suggestions from Kiran's review * more suggestions from review --------- Co-authored-by: Malte Sandstede <[email protected]> Co-authored-by: Adnan Alhomssi <[email protected]> Co-authored-by: Kiran Pamnany <[email protected]>
* --safe-crash-log-file flag * Update init.c * json escape jl_safe_printf when safe crash log file * add timestamp to json logs * port it to aarch64 darwin * fix minor warning * missing double quote * Suggestion from code review: make sig_stack_size a const in signals-unix.c Co-authored-by: Kiran Pamnany <[email protected]> * Suggestion from code review: make sig_stack size a const in signals-win.c Co-authored-by: Kiran Pamnany <[email protected]> * more suggestions from Kiran's review * more suggestions from review --------- Co-authored-by: Malte Sandstede <[email protected]> Co-authored-by: Adnan Alhomssi <[email protected]> Co-authored-by: Kiran Pamnany <[email protected]>
* --safe-crash-log-file flag * Update init.c * json escape jl_safe_printf when safe crash log file * add timestamp to json logs * port it to aarch64 darwin * fix minor warning * missing double quote * Suggestion from code review: make sig_stack_size a const in signals-unix.c Co-authored-by: Kiran Pamnany <[email protected]> * Suggestion from code review: make sig_stack size a const in signals-win.c Co-authored-by: Kiran Pamnany <[email protected]> * more suggestions from Kiran's review * more suggestions from review --------- Co-authored-by: Malte Sandstede <[email protected]> Co-authored-by: Adnan Alhomssi <[email protected]> Co-authored-by: Kiran Pamnany <[email protected]>
* --safe-crash-log-file flag * Update init.c * json escape jl_safe_printf when safe crash log file * add timestamp to json logs * port it to aarch64 darwin * fix minor warning * missing double quote * Suggestion from code review: make sig_stack_size a const in signals-unix.c Co-authored-by: Kiran Pamnany <[email protected]> * Suggestion from code review: make sig_stack size a const in signals-win.c Co-authored-by: Kiran Pamnany <[email protected]> * more suggestions from Kiran's review * more suggestions from review --------- Co-authored-by: Malte Sandstede <[email protected]> Co-authored-by: Adnan Alhomssi <[email protected]> Co-authored-by: Kiran Pamnany <[email protected]>
* --safe-crash-log-file flag * Update init.c * json escape jl_safe_printf when safe crash log file * add timestamp to json logs * port it to aarch64 darwin * fix minor warning * missing double quote * Suggestion from code review: make sig_stack_size a const in signals-unix.c Co-authored-by: Kiran Pamnany <[email protected]> * Suggestion from code review: make sig_stack size a const in signals-win.c Co-authored-by: Kiran Pamnany <[email protected]> * more suggestions from Kiran's review * more suggestions from review --------- Co-authored-by: Malte Sandstede <[email protected]> Co-authored-by: Adnan Alhomssi <[email protected]> Co-authored-by: Kiran Pamnany <[email protected]>
* --safe-crash-log-file flag * Update init.c * json escape jl_safe_printf when safe crash log file * add timestamp to json logs * port it to aarch64 darwin * fix minor warning * missing double quote * Suggestion from code review: make sig_stack_size a const in signals-unix.c Co-authored-by: Kiran Pamnany <[email protected]> * Suggestion from code review: make sig_stack size a const in signals-win.c Co-authored-by: Kiran Pamnany <[email protected]> * more suggestions from Kiran's review * more suggestions from review --------- Co-authored-by: Malte Sandstede <[email protected]> Co-authored-by: Adnan Alhomssi <[email protected]> Co-authored-by: Kiran Pamnany <[email protected]>
* --safe-crash-log-file flag * Update init.c * json escape jl_safe_printf when safe crash log file * add timestamp to json logs * port it to aarch64 darwin * fix minor warning * missing double quote * Suggestion from code review: make sig_stack_size a const in signals-unix.c Co-authored-by: Kiran Pamnany <[email protected]> * Suggestion from code review: make sig_stack size a const in signals-win.c Co-authored-by: Kiran Pamnany <[email protected]> * more suggestions from Kiran's review * more suggestions from review --------- Co-authored-by: Malte Sandstede <[email protected]> Co-authored-by: Adnan Alhomssi <[email protected]> Co-authored-by: Kiran Pamnany <[email protected]>
* --safe-crash-log-file flag * Update init.c * json escape jl_safe_printf when safe crash log file * add timestamp to json logs * port it to aarch64 darwin * fix minor warning * missing double quote * Suggestion from code review: make sig_stack_size a const in signals-unix.c Co-authored-by: Kiran Pamnany <[email protected]> * Suggestion from code review: make sig_stack size a const in signals-win.c Co-authored-by: Kiran Pamnany <[email protected]> * more suggestions from Kiran's review * more suggestions from review --------- Co-authored-by: Malte Sandstede <[email protected]> Co-authored-by: Adnan Alhomssi <[email protected]> Co-authored-by: Kiran Pamnany <[email protected]>
* --safe-crash-log-file flag * Update init.c * json escape jl_safe_printf when safe crash log file * add timestamp to json logs * port it to aarch64 darwin * fix minor warning * missing double quote * Suggestion from code review: make sig_stack_size a const in signals-unix.c Co-authored-by: Kiran Pamnany <[email protected]> * Suggestion from code review: make sig_stack size a const in signals-win.c Co-authored-by: Kiran Pamnany <[email protected]> * more suggestions from Kiran's review * more suggestions from review --------- Co-authored-by: Malte Sandstede <[email protected]> Co-authored-by: Adnan Alhomssi <[email protected]> Co-authored-by: Kiran Pamnany <[email protected]>
* --safe-crash-log-file flag * Update init.c * json escape jl_safe_printf when safe crash log file * add timestamp to json logs * port it to aarch64 darwin * fix minor warning * missing double quote * Suggestion from code review: make sig_stack_size a const in signals-unix.c Co-authored-by: Kiran Pamnany <[email protected]> * Suggestion from code review: make sig_stack size a const in signals-win.c Co-authored-by: Kiran Pamnany <[email protected]> * more suggestions from Kiran's review * more suggestions from review --------- Co-authored-by: Malte Sandstede <[email protected]> Co-authored-by: Adnan Alhomssi <[email protected]> Co-authored-by: Kiran Pamnany <[email protected]>
* --safe-crash-log-file flag * Update init.c * json escape jl_safe_printf when safe crash log file * add timestamp to json logs * port it to aarch64 darwin * fix minor warning * missing double quote * Suggestion from code review: make sig_stack_size a const in signals-unix.c Co-authored-by: Kiran Pamnany <[email protected]> * Suggestion from code review: make sig_stack size a const in signals-win.c Co-authored-by: Kiran Pamnany <[email protected]> * more suggestions from Kiran's review * more suggestions from review --------- Co-authored-by: Malte Sandstede <[email protected]> Co-authored-by: Adnan Alhomssi <[email protected]> Co-authored-by: Kiran Pamnany <[email protected]>
* --safe-crash-log-file flag * Update init.c * json escape jl_safe_printf when safe crash log file * add timestamp to json logs * port it to aarch64 darwin * fix minor warning * missing double quote * Suggestion from code review: make sig_stack_size a const in signals-unix.c Co-authored-by: Kiran Pamnany <[email protected]> * Suggestion from code review: make sig_stack size a const in signals-win.c Co-authored-by: Kiran Pamnany <[email protected]> * more suggestions from Kiran's review * more suggestions from review --------- Co-authored-by: Malte Sandstede <[email protected]> Co-authored-by: Adnan Alhomssi <[email protected]> Co-authored-by: Kiran Pamnany <[email protected]>
PR Description
Creates a
--safe-crash-log-file
that is used to redirect crash logs created while we were running the signal handler.For now it's only x86_64 Linux but shouldn't be that hard to port it to MacOS.
Example usage:
Which leads to:
Checklist
Requirements for merging:
port-to-*
labels that don't apply.