Skip to content

[DO NOT MERGE] [SOCK-DIAG] instrument the socket tests for the Mac Intel crash - #1824

Closed
pa-devbot wants to merge 3 commits into
mainfrom
mac-crash-diag-sock-timing
Closed

pa-devbot wants to merge 3 commits into
mainfrom
mac-crash-diag-sock-timing

Conversation

@pa-devbot

Copy link
Copy Markdown
Collaborator

Diagnostic branch for the Mac Intel CI crash - see #1822 and #1823 for the companion fixes. Do not merge.

What it measures (all on fd 2, so it survives the crash and the stdio buffering):

  • 3× suite loop per CI run (the crash is probabilistic; this triples the catch rate).
  • Per-send() event-thread delivery time in ClientSocket_Qt: [SOCK-DIAG] client send N bytes: event thread took X ms - a TIMED OUT line means the 5 s window in which the raw SendData* (queued to the event thread) can outlive its stack frame was hit.
  • Per-cycle marker in Test_Sockets_RapidReconnect: [SOCK-DIAG] rapid reconnect cycle N/50.
  • The fault-address/thread-id crash-handler line from Tests: report the fault address and thread in the crash backtrace #1823.

Reading a crash log: the last rapid reconnect cycle line says where the test was; any TIMED OUT line before it points at the client-send lifetime window; the [PA-CRASH] line's fault address says which memory region the bad pointer hit.

When the runner dies on SIGSEGV/SIGBUS, the signal's faulting address
(si_addr) tells us which memory region the bad pointer landed in
(stack, heap, a library), which narrows the corruption source far
more than the backtrace alone. The handler is now installed with
sigaction()/SA_SIGINFO and prints the signal number, the faulting
address (for SIGSEGV/SIGBUS), and the crashing thread's id on the
[PA-CRASH] line.
…crash

- Run the command-line suite 3x per CI run to raise the odds of
  catching the crash.
- Time every ClientSocket_Qt::send() from emit to completion and write
  it to fd 2: a wait reaching the 5 s timeout is the window in which
  the queued internal_send() (raw stack pointer) can later write
  through a dead stack pointer.
- Log each cycle of the Rapid reconnect test to fd 2, so a crash log
  shows exactly which cycle and which wait the process died in.
- Carry the fault-address/thread-id addition to the crash handler.

Remove all of this once the Mac Intel crash is root-caused.
@pa-devbot
pa-devbot force-pushed the mac-crash-diag-sock-timing branch from d2752b7 to 1d0aa82 Compare November 1, 2026 23:56
@Mysticial Mysticial closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants