Skip to content

test: Reproducer for the server lost after the interrupt test on macOS - #652

Draft
krlmlr wants to merge 2 commits into
mainfrom
claude/repro-651
Draft

krlmlr wants to merge 2 commits into
mainfrom
claude/repro-651

Conversation

@krlmlr

@krlmlr krlmlr commented Nov 29, 2026

Copy link
Copy Markdown
Member

Reproducer record for #651. This PR adds no package code.

.github/workflows/repro-651.yaml runs only on pushes to this branch. It reproduces the setup of the "macos-latest (release) mysql_config" CI job: a MariaDB 11.8 server, and the package built against Homebrew's mysql-client through mysql_config. It then runs the #621 interrupt scenario from test-dbDisconnect.R in a loop, once per action ("send", "disconnect"), and checks after each iteration whether the server is still alive. At the end it prints the server's error log. The job summary gives one verdict per variant. The workflow and its script are a harness to drop before any fix merges.

Status: the first runs are in progress. Findings, the error log excerpt, and what the cache and runs cost will follow here.

https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ


Generated by Claude Code

Runs the scenario of the #621 interrupt test in a loop on macOS and Linux,
checks after each iteration that the MariaDB server still accepts connections,
and prints the server error log.
This is a reproducer to drop before any fix merges.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ
The first run showed a mariadbd crash with libmysqlclient over TCP,
and none with libmariadb over the Unix socket.
Run both clients over both transports on macOS,
and count crashes instead of stopping at the first one.
This is a reproducer to drop before any fix merges.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ

krlmlr commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

First result, from run 46294940142 (4d0b19f): it reproduces, and mariadbd crashes; it doesn't just stop listening. Only the variant "macOS mysql_config: disconnect" failed, with the server gone at iteration 4 of 50. The other seven variants got through all 50 iterations: "send" with each client on macOS, "disconnect" with libmariadb on macOS, and both actions with libmariadb and with libmysqlclient on Linux.

The server error log:

[Warning] Could not write packet: fd: 47 state: 1 errno: 32 (EPIPE) length: 16384
... Got an error writing communication packets
mariadbd got signal 11
my_net_write+180 <- Protocol::write <- select_send::send_data <- end_send <- JOIN_CACHE ... <- Prepared_statement::execute

The server is MariaDB 11.8.10 (rev d04ba7c6) from Homebrew. A macOS crash report (mariadbd-*.ips) says EXC_CRASH SIGSEGV. mysqld_safe restarts the server about a second later ("Recovering after a crash"). The tests that connect in that window get ECONNREFUSED, which explains the CI signature in #651.

The libmariadb variant on macOS hits the same EPIPE write error in all 50 iterations without crashing. So the crash is in the server's handling of a failed network write, while rows of a prepared statement are still streaming and the client closes the connection. The client is RMariaDB's dbDisconnect() from an interrupt handler, which calls mysql_close(). Hypothesis, not yet confirmed: the trigger needs TCP. The libmysqlclient job connects to 127.0.0.1, while the libmariadb one may use the socket. Run 2 (46295776150, 3d1f1b5) runs both clients over both transports, 100 iterations each, and counts crashes.

Cost so far: one run without any cache, a few minutes per job.


Generated by Claude Code

krlmlr commented Nov 29, 2026 •

Copy link
Copy Markdown
Member Author

Question: Report the server crash to MariaDB, and how to keep CI green meanwhile

A MariaDB 11.8.10 server segfaults in my_net_write() after an EPIPE, when a client closes the connection while a prepared statement's result is still streaming (finding above). This is a server bug: no client should be able to crash the server. It hits CI intermittently on main through the #621 interrupt test (#651).

  • Report it at jira.mariadb.org with the stack, the error log and a minimal plain-C reproducer, once run 2 shows whether it needs TCP. Meanwhile, in a separate PR, print the server error log in CI with if: always() and drain the result before dbDisconnect() in the test's "disconnect" iteration (recommended)
  • Report it upstream, and skip the "disconnect" iteration on the macOS libmysqlclient job until MariaDB fixes it
  • Don't report it; only de-flake the test

Reporting means posting on an external tracker in Kirill's name, so Kirill decides. If nobody decides, I'll prepare the CI-log PR and the reproducer, and leave the report undone.


Generated by Claude Code

@krlmlr

krlmlr commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

We need green CI now.

krlmlr commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

For green CI on main, three test-only PRs, each from main:

Together they cover every failure I've seen on main today. #655's run will show whether anything else is left.


Generated by Claude Code

krlmlr pushed a commit that referenced this pull request Nov 29, 2026
The reproducer in #652 crashes the server over TCP with libmariadb too,
and never over the socket.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ
krlmlr added a commit that referenced this pull request Nov 29, 2026
… macOS (#655)

* test: Leave out the disconnect iteration of the #621 test with libmysqlclient on macOS (#651)

A MariaDB server on macOS can crash when libmysqlclient closes the
connection while rows are still streaming, and every later test then
can't connect.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ

* test: Leave out the disconnect iteration on macOS with any client (#651)

The reproducer in #652 crashes the server over TCP with libmariadb too,
and never over the socket.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ

---------

Co-authored-by: Claude <[email protected]>

krlmlr commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

Run 2 (46295776150, 3d1f1b5, 100 iterations per variant, crashes counted) confirms that the crash needs TCP, and happens with both clients:

  • macOS, libmariadb (mariadb_config), TCP, disconnect: SERVER_GONE 41 times in 100 iterations, first at iteration 6
  • macOS, libmysqlclient (mysql_config), TCP, disconnect: SERVER_GONE 23 times in 100 iterations, first at iteration 3
  • Both clients over the Unix socket, disconnect: OK (100 iterations)
  • Both clients and both transports, send: OK (100 iterations)

So a client closing a TCP connection while the server streams the rows of a prepared statement crashes MariaDB 11.8.10 on macOS. That is a server bug, independent of the client library. #655 now leaves out the "disconnect" iteration on macOS for any client.


Generated by Claude Code

krlmlr commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

Handover: #655 and its siblings are merged. A full-matrix run on main e5943fc (run 46296803620) passed every job, and its logs show [ FAIL 0 in each job that prints a test summary, both macOS server jobs included. This reproducer stays a draft, for the upstream-report question. Nothing was reported to MariaDB. This session is being archived, so nobody is watching this PR any more.


Generated by Claude Code

This branch has not been deployed

No deployments
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