Skip to content

Support for DWARF-5 in in house DWARF parser#40710

Merged
alexey-milovidov merged 3 commits intoClickHouse:masterfrom
azat:DWARF-5
Aug 28, 2022
Merged

Support for DWARF-5 in in house DWARF parser#40710
alexey-milovidov merged 3 commits intoClickHouse:masterfrom
azat:DWARF-5

Conversation

@azat
Copy link
Copy Markdown
Member

@azat azat commented Aug 27, 2022

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Support for DWARF-5 in in house DWARF parser

I have to do this, since I have libraries compiled with DWARF5 (i.e.
glibc).

ClickHouse changes:

  • use camel_case
  • add NOLINT
  • avoid using folly:: (use std:: instead)
  • avoid using boost:: (use std:: instead)
Details
azat:.../ch/clickhouse-upstream (DWARF-5)$ readelf --debug-dump=info /lib/libc.so.6  | grep -A2 'Compilation Unit @' | head
  Compilation Unit @ offset 0x0:
   Length:        0x4d2 (32-bit)
   Version:       5
--
  Compilation Unit @ offset 0x4d6:
   Length:        0x23a1 (32-bit)
   Version:       5
--
  Compilation Unit @ offset 0x287b:
   Length:        0x39c3 (32-bit)

Refs: facebook/folly@490b287
Refs: #35405
Refs: #34777
Refs: #37479

@robot-ch-test-poll robot-ch-test-poll added the pr-improvement Pull request with some product improvements label Aug 27, 2022
@azat azat marked this pull request as draft August 27, 2022 19:22
azat added 2 commits August 27, 2022 22:28
I have to do this, since I have libraries compiled with DWARF5 (i.e.
glibc).

ClickHouse changes:
- use camel_case
- add NOLINT
- avoid using folly:: (use std:: instead)
- avoid using boost:: (use std:: instead)

Refs: facebook/folly@490b287
Signed-off-by: Azat Khuzhin <[email protected]>
@alexey-milovidov
Copy link
Copy Markdown
Member

BTW, We also include LLVM and can use DWARF parser and symbolizer directly from there.

@azat
Copy link
Copy Markdown
Member Author

azat commented Aug 28, 2022

BTW, We also include LLVM and can use DWARF parser and symbolizer directly from there.

Indeed. I though about this, but decided to update the folly's implementation for now, and separately look at llvm's, in the long-term I think it is good step, however I'm afraid that it may be slower (or will not have "fast" interface), but this should be verified first.

@azat
Copy link
Copy Markdown
Member Author

azat commented Aug 28, 2022

Basically it looks OK, parser works, and binary indeed uses DWARF-5:

$ llvm-dwarfdump-13 -r 1 clickhouse-debug | grep 'Compile Unit:' | grep -E -o 'version = 0x[0-9]{4}' | sort | uniq -c
   6376 version = 0x0005

P.S. readelf (readelf --debug-dump=info clickhouse-debug | grep -A2 'Compilation Unit @' | fgrep Version: | sort | uniq -c) enters a deadloop while processing the same...

Stress test (thread) — Killed by signal (in clickhouse-server.log)

SIGTRAP, and cannot reproduce.

Details
/var/log/clickhouse-server/clickhouse-server.err.log:2022.08.28 01:05:40.494222 [ 3952 ] {} <Fatal> BaseDaemon: ########################################
/var/log/clickhouse-server/clickhouse-server.err.log:2022.08.28 01:05:40.494532 [ 3952 ] {} <Fatal> BaseDaemon: (version 22.9.1.1, build id: CD78D142CE05E6500B0AA37F0BC1986580EFB8BD) (from thread 1750) (query_id: 4ae06517-cac9-4b59-9f39-e09d36465a70) (query: SELECT * FROM remote('ThisHostNameDoesNotExistSoItShouldFail', system, one)) Received signal Trace/breakpoint trap (5)
/var/log/clickhouse-server/clickhouse-server.err.log:2022.08.28 01:05:40.494673 [ 3952 ] {} <Fatal> BaseDaemon: 
/var/log/clickhouse-server/clickhouse-server.err.log:2022.08.28 01:05:40.494898 [ 3952 ] {} <Fatal> BaseDaemon: Stack trace: 0x7fb739cde09f 0x7fb739bfa928 0x7fb739cdd60a 0x7fb739bf98c1 0x7fb739bfa928 0x7fb739bfa9f3 0x7fb739bf99f5 0x7fb739bdd6ac 0x7fb739bddf59 0x7fb739b9e375 0x7fb739b9ff59 0xb505405 0x1fc60cec 0xb6899e6 0xb688905 0xb688c85 0xb689535 0x1ad1a080 0x1ad1b211 0x1ad302b8 0x1ad2fe61 0x1ad24d5b 0x19d608f4 0x19d5bfcb 0x1a103b60 0x1ad3faff 0x1b636f40 0x1b592a4b 0x1b5915c6 0x1b5f6b3f 0x1b5f49cb 0x1b53c4c9 0x1b53b54d 0x1b987014 0x1b984acc 0x1c9455c6 0x1c9590a8 0x1fcad803 0x1fcae073 0x1ff05a1a
/var/log/clickhouse-server/clickhouse-server.err.log:2022.08.28 01:05:40.495227 [ 3952 ] {} <Fatal> BaseDaemon: 5. ? in ?
/var/log/clickhouse-server/clickhouse-server.err.log:2022.08.28 01:05:40.495410 [ 3952 ] {} <Fatal> BaseDaemon: 6. _dl_catch_exception in ?
/var/log/clickhouse-server/clickhouse-server.err.log:2022.08.28 01:05:40.495520 [ 3952 ] {} <Fatal> BaseDaemon: 7. ? in ?
/var/log/clickhouse-server/clickhouse-server.err.log:2022.08.28 01:05:40.495631 [ 3952 ] {} <Fatal> BaseDaemon: 8. ? in ?
/var/log/clickhouse-server/clickhouse-server.err.log:2022.08.28 01:05:40.495766 [ 3952 ] {} <Fatal> BaseDaemon: 9. _dl_catch_exception in ?
/var/log/clickhouse-server/clickhouse-server.err.log:2022.08.28 01:05:40.495887 [ 3952 ] {} <Fatal> BaseDaemon: 10. _dl_catch_error in ?
/var/log/clickhouse-server/clickhouse-server.err.log:2022.08.28 01:05:40.496018 [ 3952 ] {} <Fatal> BaseDaemon: 11. __libc_dlopen_mode in ?
/var/log/clickhouse-server/clickhouse-server.err.log:2022.08.28 01:05:40.496136 [ 3952 ] {} <Fatal> BaseDaemon: 12. ? in ?
/var/log/clickhouse-server/clickhouse-server.err.log:2022.08.28 01:05:40.496228 [ 3952 ] {} <Fatal> BaseDaemon: 13. __nss_lookup_function in ?
/var/log/clickhouse-server/clickhouse-server.err.log:2022.08.28 01:05:40.496352 [ 3952 ] {} <Fatal> BaseDaemon: 14. ? in ?
/var/log/clickhouse-server/clickhouse-server.err.log:2022.08.28 01:05:40.496463 [ 3952 ] {} <Fatal> BaseDaemon: 15. getaddrinfo in ?
/var/log/clickhouse-server/clickhouse-server.err.log:2022.08.28 01:06:01.245890 [ 675 ] {} <Fatal> Application: Child process was terminated by signal 5.
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.08.28 01:05:40.494222 [ 3952 ] {} <Fatal> BaseDaemon: ########################################
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.08.28 01:05:40.494532 [ 3952 ] {} <Fatal> BaseDaemon: (version 22.9.1.1, build id: CD78D142CE05E6500B0AA37F0BC1986580EFB8BD) (from thread 1750) (query_id: 4ae06517-cac9-4b59-9f39-e09d36465a70) (query: SELECT * FROM remote('ThisHostNameDoesNotExistSoItShouldFail', system, one)) Received signal Trace/breakpoint trap (5)
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.08.28 01:05:40.494673 [ 3952 ] {} <Fatal> BaseDaemon: 
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.08.28 01:05:40.494898 [ 3952 ] {} <Fatal> BaseDaemon: Stack trace: 0x7fb739cde09f 0x7fb739bfa928 0x7fb739cdd60a 0x7fb739bf98c1 0x7fb739bfa928 0x7fb739bfa9f3 0x7fb739bf99f5 0x7fb739bdd6ac 0x7fb739bddf59 0x7fb739b9e375 0x7fb739b9ff59 0xb505405 0x1fc60cec 0xb6899e6 0xb688905 0xb688c85 0xb689535 0x1ad1a080 0x1ad1b211 0x1ad302b8 0x1ad2fe61 0x1ad24d5b 0x19d608f4 0x19d5bfcb 0x1a103b60 0x1ad3faff 0x1b636f40 0x1b592a4b 0x1b5915c6 0x1b5f6b3f 0x1b5f49cb 0x1b53c4c9 0x1b53b54d 0x1b987014 0x1b984acc 0x1c9455c6 0x1c9590a8 0x1fcad803 0x1fcae073 0x1ff05a1a
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.08.28 01:05:40.495227 [ 3952 ] {} <Fatal> BaseDaemon: 5. ? in ?
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.08.28 01:05:40.495410 [ 3952 ] {} <Fatal> BaseDaemon: 6. _dl_catch_exception in ?
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.08.28 01:05:40.495520 [ 3952 ] {} <Fatal> BaseDaemon: 7. ? in ?
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.08.28 01:05:40.495631 [ 3952 ] {} <Fatal> BaseDaemon: 8. ? in ?
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.08.28 01:05:40.495766 [ 3952 ] {} <Fatal> BaseDaemon: 9. _dl_catch_exception in ?
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.08.28 01:05:40.495887 [ 3952 ] {} <Fatal> BaseDaemon: 10. _dl_catch_error in ?
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.08.28 01:05:40.496018 [ 3952 ] {} <Fatal> BaseDaemon: 11. __libc_dlopen_mode in ?
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.08.28 01:05:40.496136 [ 3952 ] {} <Fatal> BaseDaemon: 12. ? in ?
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.08.28 01:05:40.496228 [ 3952 ] {} <Fatal> BaseDaemon: 13. __nss_lookup_function in ?
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.08.28 01:05:40.496352 [ 3952 ] {} <Fatal> BaseDaemon: 14. ? in ?
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.08.28 01:05:40.496463 [ 3952 ] {} <Fatal> BaseDaemon: 15. getaddrinfo in ?
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.08.28 01:06:01.245890 [ 675 ] {} <Fatal> Application: Child process was terminated by signal 5.

Stateless tests (debug) [1/3] — fail: 0, passed: 1470, skipped: 13, unknown: 1

  • 02346_position_countsubstrings_zero_byte timeout on CREATE DATABASE - and this is confirmed by logs

Stress test (undefined) — Backward compatibility check: Error message in clickhouse-server.log (see bc_check_error_messages.txt)

  • Real OOM

ClickHouse special build check — 6/7 artifact groups are OK

Expected failure of clang-tidy, fixed.

@azat azat marked this pull request as ready for review August 28, 2022 13:53
@alexey-milovidov alexey-milovidov self-assigned this Aug 28, 2022
@alexey-milovidov alexey-milovidov merged commit ae97e88 into ClickHouse:master Aug 28, 2022
@azat azat deleted the DWARF-5 branch August 28, 2022 22:42
@tavplubix
Copy link
Copy Markdown
Member

The failure with SIGTRAP was probably related, there are tons of similar failures in master since this PR was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-improvement Pull request with some product improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants