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 error in "extractAllGroups" function #14889

Merged
merged 1 commit into from
Sep 17, 2020

Conversation

alexey-milovidov
Copy link
Member

Changelog category (leave one):

  • Bug Fix

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix the issue when some invocations of extractAllGroups function may trigger "Memory limit exceeded" error. This fixes #13383

@robot-clickhouse robot-clickhouse added the pr-bugfix Pull request with bugfix, not backported by default label Sep 16, 2020
@alesapin alesapin self-assigned this Sep 17, 2020
@alesapin
Copy link
Member

AST Fuzzer:

 56 Aborted                 (core dumped) ./clickhouse-server --config-file db/config.xml -- --path db 2>&1

But no errors in the server log and in the fuzzer log.

@akuzm
Copy link
Contributor

akuzm commented Sep 17, 2020

AST Fuzzer:

 56 Aborted                 (core dumped) ./clickhouse-server --config-file db/config.xml -- --path db 2>&1

But no errors in the server log and in the fuzzer log.

No errors would be bad, better investigate. But I found the error in server log:

2020.09.17 03:44:13.654828 [ 71 ] {} <Trace> SystemLog (system.trace_log): Flushing system log, 24 entries to flush
<jemalloc>: ../contrib/jemalloc/include/jemalloc/internal/arena_inlines_a.h:45: Failed assertion: "newarena != NULL"
2020.09.17 03:44:13.657126 [ 63 ] {} <Trace> BaseDaemon: Received signal 6

It also looks very bad...

@akuzm
Copy link
Contributor

akuzm commented Sep 17, 2020

It also looks very bad...

  1. jemalloc shouldn't have an assertion in this place -- a creation of new arena can return null in case we are out of memory
  2. there are a lot of messages like these:
It looks like that the process is near the limit on number of virtual memory mappings.
Current number of mappings (/proc/self/maps): 1048566.
Limit on number of mappings (/proc/sys/vm/max_map_count): 1048576.
You should increase the limit for vm.max_map_count in /etc/sysctl.conf

But why would we be out of memory mappings on a server that is basically idle? Looks like a memory leak.

@alexey-milovidov alexey-milovidov merged commit 2413caa into master Sep 17, 2020
@alexey-milovidov alexey-milovidov deleted the extract-all-groups-empty-match branch September 17, 2020 13:02
alexey-milovidov added a commit that referenced this pull request Sep 17, 2020
Backport #14889 to 20.7: Fix error in "extractAllGroups" function
alexey-milovidov added a commit that referenced this pull request Sep 17, 2020
Backport #14889 to 20.8: Fix error in "extractAllGroups" function
alexey-milovidov added a commit that referenced this pull request Sep 17, 2020
Backport #14889 to 20.9: Fix error in "extractAllGroups" function
alexey-milovidov added a commit that referenced this pull request Sep 17, 2020
Backport #14889 to 20.6: Fix error in "extractAllGroups" function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-docs-needed pr-bugfix Pull request with bugfix, not backported by default
Projects
None yet
Development

Successfully merging this pull request may close these issues.

extactAllGroups[Horizonta|Vertical] stuck and high memory usage with specific regexp expression
5 participants