Skip to content

MDEV-37136 : sql/wsrep_allowlist_service.cc:40:27: runtime error: mem… #4173

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

Open
wants to merge 1 commit into
base: 10.11
Choose a base branch
from

Conversation

janlindstrom
Copy link
Contributor

…ber call on null pointer of type 'Wsrep_schema'

  • The Jira issue number for this PR is: MDEV-37136

Description

Problem was that we used wsrep_schema pointer before it was initialized. Fix is to allow all connections when wsrep_schema is not yet initialized and check allowed connections only when wsrep_schema has been initialized.

Release Notes

TODO: What should the release notes say about this change?
Include any changed system variables, status variables or behaviour. Optionally list any https://mariadb.com/kb/ pages that need changing.

How can this PR be tested?

TODO: modify the automated test suite to verify that the PR causes MariaDB to behave as intended.
Consult the documentation on "Writing good test cases".

If the changes are not amenable to automated testing, please explain why not and carefully describe how to test manually.

Basing the PR against the correct MariaDB version

  • This is a new feature or a refactoring, and the PR is based against the main branch.
  • [x ] This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.

PR quality check

  • [x ] I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • [ x] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

…ber call on null pointer of type 'Wsrep_schema'

Problem was that we used wsrep_schema pointer before it was
initialized. Fix is to allow all connections when wsrep_schema
is not yet initialized and check allowed connections
only when wsrep_schema has been initialized.
@janlindstrom janlindstrom added the Codership Codership Galera label Jul 8, 2025
@grooverdan
Copy link
Member

Thanks for fixing @janlindstrom. Why is allowing all connections before the wsrep_schema is initialised a safe option?

@janlindstrom
Copy link
Contributor Author

@grooverdan Very good question. Assertion happens on joiner node that executes IST. If I correctly understand this situation, this joiner request IST from donor. This means that donor has already checked that joiner may connect to it using allowlist. Not sure if you can configure your cluster so that joiner may connect to donor but donor may not connect to joiner (in my understanding it would not make sense).

Based on https://galeracluster.com/2024/03/mariadb-galera-cluster-the-wsrep-allowlist/
it seems that confuguration of wsrep-allowlist is designed for DONOR only. Allowlist
is stored persistently only when new cluster is created and in below case this is not true.

Here is stack when wsrep_schema==NULL and this happens at node2

(rr) where
#0 __pthread_kill_implementation (threadid=, signo=6, no_tid=0) at ./nptl/pthread_kill.c:44
#1 __pthread_kill_internal (threadid=, signo=6) at ./nptl/pthread_kill.c:89
#2 __GI___pthread_kill (threadid=, signo=signo@entry=6) at ./nptl/pthread_kill.c:100
#3 0x0000714526a456de in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4 0x0000714526a288cd in __GI_abort () at ./stdlib/abort.c:73
#5 0x0000714526a28830 in __assert_fail_base (fmt=, assertion=, file=,
line=, function=) at ./assert/assert.c:118
#6 0x000060bcba1d109c in Wsrep_allowlist_service::allowlist_cb (this=0x60bcf871e360, key=wsrep::allowlist_service::allowlist_ip,
value=...) at /home/jan/work/mariadb/10.11/sql/wsrep_allowlist_service.cc:39
#7 0x000060bcbb5086a1 in wsrep_allowlist_service_v1::allowlist_cb (key=WSREP_ALLOWLIST_KEY_IP, value=0x7145119fe370)
at /home/jan/work/mariadb/10.11/wsrep-lib/src/allowlist_service_v1.cpp:60
#8 0x0000714521e2d9d0 in gu::allowlist_value_check (key=WSREP_ALLOWLIST_KEY_IP, value="127.0.0.1")
at /home/jan/work/galera-lib/galera-bugs/galerautils/src/gu_asio.cpp:878
#9 0x0000714521e5df5c in gu::AsioAcceptorReact::accept (this=0x714508036360)
at /home/jan/work/galera-lib/galera-bugs/galerautils/src/gu_asio_stream_react.cpp:945
#10 0x0000714521c46eb6 in galera::ist::Receiver::run (this=0x60bcf8744860)
at /home/jan/work/galera-lib/galera-bugs/galera/src/ist.cpp:346
#11 0x0000714521c45bf7 in run_receiver_thread (arg=0x60bcf8744860) at /home/jan/work/galera-lib/galera-bugs/galera/src/ist.cpp:161
#12 0x0000714526aa2ef1 in start_thread (arg=) at ./nptl/pthread_create.c:448
#13 0x0000714526b34244 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100

@temeo Is it safe to allow connection here?

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

Successfully merging this pull request may close these issues.

3 participants