Skip to content
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

CONC-553: Fix SIGBUS when calling mysql_real_connect_start on ARM64 macOS #172

Closed
wants to merge 2 commits into from

Conversation

kotori2
Copy link

@kotori2 kotori2 commented Jun 6, 2021

From this stack overflow question

Evidently, that macro changes the layout of the relevant structures to match what those functions expect and require.

So I moved the _XOPEN_SOURCE macro to CMakefile.txt.

@kotori2 kotori2 marked this pull request as draft June 6, 2021 18:56
…acOS

Co-authored-by: LoveSy <shana@zju.edu.cn>
@kotori2 kotori2 marked this pull request as ready for review June 6, 2021 20:08
@@ -4,6 +4,9 @@ INCLUDE_DIRECTORIES(${CC_SOURCE_DIR}/include
ADD_DEFINITIONS(-D HAVE_COMPRESS)
ADD_DEFINITIONS(-D LIBMARIADB)
ADD_DEFINITIONS(-D THREAD)
IF(APPLE)
ADD_DEFINITIONS(-D _XOPEN_SOURCE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be _XOPEN_SOURCE=600 ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea why it was 600 as I checked ucontext.h:

#ifdef _XOPEN_SOURCE
...
#else /* !_XOPEN_SOURCE */
#error The deprecated ucontext routines require _XOPEN_SOURCE to be defined
#endif /* _XOPEN_SOURCE */

Also it seems it was producing compilation errors if I set _XOPEN_SOURCE to 600. Setting -D _XOPEN_SOURCE just works fine.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, fair enough

@kotori2
Copy link
Author

kotori2 commented Jan 4, 2022

CI seems passing now.

@0rangeFox
Copy link

@vuvova This is really necessary for M1 working when creating MySQL Client through code, and I confirm it's working perfectly with this simple changes.

@9EOR9 9EOR9 changed the base branch from 3.2 to 3.1 March 3, 2022 05:39
@9EOR9 9EOR9 changed the base branch from 3.1 to 3.2 March 3, 2022 05:40
@9EOR9
Copy link
Collaborator

9EOR9 commented Mar 3, 2022

Manually merged into 3.1 branch

@9EOR9 9EOR9 closed this Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants