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

Disable DwarfFDECache in libunwind #7838

Merged

Conversation

filimonov
Copy link
Contributor

@filimonov filimonov commented Nov 19, 2019

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Bug Fix

Changelog entry (up to few sentences, required except for Non-significant/Documentation categories):

Fix rare deadlock which can happen when trace_log is in enabled.

Detailed description (optional):

Fixes #7383
See details in ClickHouse/libunwind#1
I was not able to reproduce the issue in any synthetic case, it happened on production cluster 3 times during a month.

P.S. kudos to @laplab for the help.

@filimonov
Copy link
Contributor Author

filimonov commented Nov 19, 2019

gcc-9 failure - looks the same as #7114

It seems like the reason is pthread is not linked into protoc directly, and protoc works only when one of the libraries it links (for example libunwind) requires pthread.

That dirty hack fixes the gcc-9 build:

  diff --git a/cmake/protoc.cmake b/cmake/protoc.cmake
index 5777b16..49aa106 100644
--- a/cmake/protoc.cmake
+++ b/cmake/protoc.cmake
@@ -3,5 +3,5 @@ set(protoc_files
 )
 
 add_executable(protoc ${protoc_files})
-target_link_libraries(protoc libprotobuf libprotoc)
+target_link_libraries(protoc libprotobuf libprotoc pthread)
 add_executable(protobuf::protoc ALIAS protoc)

Unused var warning fixed here:
filimonov/libunwind@214ead8

Those things:

2019-11-19 12:44:06 ../contrib/libunwind/src/AddressSpace.hpp:547:63: warning: 'object_length' may be used uninitialized in this function [-Wmaybe-uninitialized]
2019-11-19 12:44:06   547 |           cbdata->sects->dwarf_section_length = object_length - (cbdata->sects->dwarf_section - cbdata->sects->dso_base);
2019-11-19 12:44:06       |                                                 ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


==199==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x1c807f31 in __cxxabiv1::__getExceptionClass(_Unwind_Exception const*) /build/obj-x86_64-linux-gnu/../contrib/libcxxabi/src/cxa_exception.cpp:101:2
    #1 0x1c782c37 in __cxxabiv1::get_thrown_object_ptr(_Unwind_Exception*) /build/obj-x86_64-linux-gnu/../contrib/libcxxabi/src/cxa_personality.cpp:504:9
    #2 0x1c782c37 in __cxxabiv1::scan_eh_tab(__cxxabiv1::(anonymous namespace)::scan_results&, _Unwind_Action, bool, _Unwind_Exception*, _Unwind_Context*) /build/obj-x86_64-linux-gnu/../contrib/libcxxabi/src/cxa_personality.cpp:734
    #3 0x1c780cd2 in __gxx_personality_v0 /build/obj-x86_64-linux-gnu/../contrib/libcxxabi/src/cxa_personality.cpp:969:9
    #4 0x1c8198f0 in unwind_phase1 /build/obj-x86_64-linux-gnu/../contrib/libunwind/src/UnwindLevel1.c:99:11
    #5 0x1c8198f0 in _Unwind_RaiseException /build/obj-x86_64-linux-gnu/../contrib/libunwind/src/UnwindLevel1.c:363
    #6 0x1c808435 in __cxa_throw /build/obj-x86_64-linux-gnu/../contrib/libcxxabi/src/cxa_exception.cpp:280:5
    #7 0x1b01efc6 in DB::parseQueryAndMovePosition(DB::IParser&, char const*&, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, unsigned long) /build/obj-x86_64-linux-gnu/../dbms/src/Parsers/parseQuery.cpp:308:5

existed already in master:

@alexey-milovidov alexey-milovidov merged commit 9b25e47 into ClickHouse:master Nov 20, 2019
@tavplubix tavplubix added the pr-bugfix Pull request with bugfix, not backported by default label Nov 21, 2019
tavplubix pushed a commit that referenced this pull request Nov 21, 2019
tavplubix pushed a commit that referenced this pull request Nov 21, 2019
tavplubix pushed a commit that referenced this pull request Nov 21, 2019
vitlibar pushed a commit that referenced this pull request Dec 26, 2019
Disable DwarfFDECache in libunwind

(cherry picked from commit 9b25e47)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix Pull request with bugfix, not backported by default
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deadlock leading to unresponsive server
4 participants