Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
3.1.12
-
None
-
macOS 11.4 on M1, libmariadb installed with Vcpkg, clang-1205.0.22.9
Description
A simple program like this will cause SIGBUS:
MYSQL mysql;
|
mysql_init(&mysql);
|
auto r = mysql_options(&mysql, MYSQL_OPT_NONBLOCK, nullptr);
|
MYSQL *ret = nullptr;
|
mysql_real_connect_start(&ret,
|
&mysql,
|
"127.0.0.1", |
"root", |
"root", |
"mysql", |
3306,
|
nullptr,
|
0);
|
It actually won't produce any stack trace but with single step in IDE, the crash actually produced at swapcontext in my_context_continue.
Might related to MDEV-9112
Update: It's because _XOPEN_SOURCE macro caused stack struct change in macOS. But someone defined _XOPEN_SOURCE in the source file instead of in CMakefile.txt.
Ref: https://stackoverflow.com/questions/23852522/swapcontext-segfaults-when-swapping-to-a-ucontext-ts-uc-link