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

Fix undefined __pthread_mutex_lock/unlock for glibc 2.34+/DISABLE_HERMETIC_BUILD #34771

Merged
merged 2 commits into from Mar 11, 2022

Conversation

azat
Copy link
Collaborator

@azat azat commented Feb 20, 2022

Right now it fails with:

ld.lld: error: undefined symbol: __pthread_mutex_lock
>>> referenced by ThreadFuzzer.cpp:300 (./src/Common/ThreadFuzzer.cpp:300)
>>> src/CMakeFiles/clickhouse_common_io.dir/Common/ThreadFuzzer.cpp.o:(pthread_mutex_lock)
>>> did you mean: __pthread_mutex_lock@GLIBC_2.2.5
>>> defined in: /usr/lib/libc.so.6

Here is the list of matched symbols for 2.35:

$ nm -D /lib/libc.so.6 | fgrep pthread_mutex_lock
00000000000908a0 T __pthread_mutex_lock@GLIBC_2.2.5
00000000000908a0 T pthread_mutex_lock@@GLIBC_2.2.5

$ nm -D /lib/libpthread.so.0 | fgrep -c pthread_mutex_lock
0

And this is for 2.33:

$ nm -D /lib/x86_64-linux-gnu/libc.so.6 | fgrep pthread_mutex_lock
0000000000083eb0 T pthread_mutex_lock@@GLIBC_2.2.5

$ nm -D /lib/x86_64-linux-gnu/libpthread.so.0 | fgrep pthread_mutex_lock
000000000000af00 T __pthread_mutex_lock@@GLIBC_2.2.5
000000000000af00 W pthread_mutex_lock@@GLIBC_2.2.5

Because "likely" starting from 27a448223cb2d3bab191c61303db48cee66f871c
("nptl: Move core mutex functions into libc") 1, __pthread_mutex_lock
is not exported anymore.

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

@robot-clickhouse robot-clickhouse added the pr-not-for-changelog This PR should not be mentioned in the changelog label Feb 20, 2022
Copy link
Member

@alexey-milovidov alexey-milovidov left a comment

Choose a reason for hiding this comment

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

.

src/Common/ThreadFuzzer.cpp Show resolved Hide resolved
@alexey-milovidov alexey-milovidov self-assigned this Feb 20, 2022
…METIC_BUILD

Right now it fails with:

    ld.lld: error: undefined symbol: __pthread_mutex_lock
    >>> referenced by ThreadFuzzer.cpp:300 (./src/Common/ThreadFuzzer.cpp:300)
    >>> src/CMakeFiles/clickhouse_common_io.dir/Common/ThreadFuzzer.cpp.o:(pthread_mutex_lock)
    >>> did you mean: __pthread_mutex_lock@GLIBC_2.2.5
    >>> defined in: /usr/lib/libc.so.6

Here is the list of matched symbols for 2.35:

    $ nm -D /lib/libc.so.6 | fgrep pthread_mutex_lock
    00000000000908a0 T __pthread_mutex_lock@GLIBC_2.2.5
    00000000000908a0 T pthread_mutex_lock@@GLIBC_2.2.5

    $ nm -D /lib/libpthread.so.0 | fgrep -c pthread_mutex_lock
    0

And this is for 2.33:

    $ nm -D /lib/x86_64-linux-gnu/libc.so.6 | fgrep pthread_mutex_lock
    0000000000083eb0 T pthread_mutex_lock@@GLIBC_2.2.5

    $ nm -D /lib/x86_64-linux-gnu/libpthread.so.0 | fgrep pthread_mutex_lock
    000000000000af00 T __pthread_mutex_lock@@GLIBC_2.2.5
    000000000000af00 W pthread_mutex_lock@@GLIBC_2.2.5

Because "likely" starting from 27a448223cb2d3bab191c61303db48cee66f871c
("nptl: Move core mutex functions into libc") [1], __pthread_mutex_lock
is not exported anymore.

  [1]: https://sourceware.org/git/?p=glibc.git;a=commit;h=27a448223cb2d3bab191c61303db48cee66f871c

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
@azat
Copy link
Collaborator Author

azat commented Mar 5, 2022

@alexey-milovidov friendly ping

@alexey-milovidov alexey-milovidov merged commit 003619b into ClickHouse:master Mar 11, 2022
@azat azat deleted the fix-glibc2.34-build branch March 11, 2022 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-not-for-changelog This PR should not be mentioned in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants