Opened 3 years ago

Last modified 3 years ago

#63878 assigned defect

mariadb-10.5 and other versions after install problem with mysql_install_db

Reported by: 6aKa Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc: jonasjonas (Frank Hellenkamp), claudepache (Claude Pache)
Port: mariadb-10.5

Description

From other port

:debug:sysinfo macOS 12.0.1 (darwin/21.1.0) arch i386
:debug:sysinfo MacPorts 2.7.1
:debug:sysinfo Xcode 13.1
:debug:sysinfo SDK 12
:debug:sysinfo MACOSX_DEPLOYMENT_TARGET: 12.0

Installed openssl

$ port echo installed | grep openss
openssl                        @3_1
openssl3                       @3.0.0_4+legacy
openssl11                      @1.1.1l_5
Installing MariaDB/MySQL system tables in '/opt/local/var/db/mariadb-10.5' ...
/opt/local/lib/mariadb-10.5/bin/mysql_install_db: line 524: 24400 Abort trap: 6           "$mysqld_bootstrap" $defaults $defaults_group_suffix "$mysqld_opt" --bootstrap $silent_startup "--basedir=$basedir" "--datadir=$ldata" --log-warnings=0 --enforce-storage-engine="" "--plugin-dir=${plugindir}" $args --max_allowed_packet=8M --net_buffer_length=16K

Installation of system tables failed!  Examine the logs in
/opt/local/var/db/mariadb-10.5 for more information.

And this problem with other versions mariadb-10.4, mariadb-10.6 - other not testing

Change History (6)

comment:1 Changed 3 years ago by jmroot (Joshua Root)

Owner: set to michaelld
Status: newassigned

comment:2 Changed 3 years ago by jonasjonas (Frank Hellenkamp)

Cc: jonasjonas added

comment:3 Changed 3 years ago by jonasjonas (Frank Hellenkamp)

I think that it is related to the following:

mariadb crashes as soon as on tries to execute a query on it (with an existing database).

It seems to be the same behaviour on mariadb 10.5 and 10.6.

2021-11-16 13:32:22 0 [Note] /opt/local/lib/mariadb-10.6/bin/mysqld: ready for connections.
Version: '10.6.5-MariaDB'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
mysqld(77163,0x700006f5b000) malloc: *** error for object 0x700006f5a4f0: pointer being freed was not allocated
mysqld(77163,0x700006f5b000) malloc: *** set a breakpoint in malloc_error_break to debug
211116 13:32:26 [ERROR] mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.

To report this bug, see https://mariadb.com/kb/en/reporting-bugs

We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail.

Server version: 10.6.5-MariaDB
key_buffer_size=16777216
read_buffer_size=131072
max_used_connections=1
max_threads=153
thread_count=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 118265 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7fc03f08d618
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x700006f5af30 thread_stack 0x49000
0   mariadbd                            0x000000010a43cabf my_print_stacktrace + 60
Printing to addr2line failed
0   mariadbd                            0x0000000109e30b90 handle_fatal_signal + 710
0   libsystem_platform.dylib            0x00007ff815fd2e2d _sigtramp + 29
0   ???                                 0x0000000000000000 0x0 + 0
0   libsystem_c.dylib                   0x00007ff815f09d10 abort + 123
0   libsystem_malloc.dylib              0x00007ff815de73e2 has_default_zone0 + 0
0   libsystem_malloc.dylib              0x00007ff815dea5ed malloc_report + 151
0   libcrypto.3.dylib                   0x000000010bf82358 evp_md_ctx_clear_digest + 220
0   libcrypto.3.dylib                   0x000000010bf823c5 EVP_MD_CTX_reset + 55
0   mariadbd                            0x000000010a1cbcd7 _ZL8md5_initP13evp_md_ctx_st + 28
0   mariadbd                            0x000000010a1cbc77 my_md5 + 50
0   mariadbd                            0x000000010a1e6f92 _Z21find_or_create_digestP10PFS_threadPK18sql_digest_storagePKcj + 183
0   mariadbd                            0x000000010a1e0389 pfs_end_statement_v1 + 228
0   mariadbd                            0x0000000109fdc33e _Z16dispatch_command19enum_server_commandP3THDPcjb + 6904
0   mariadbd                            0x0000000109fdd3ec _Z10do_commandP3THDb + 529
0   mariadbd                            0x000000010a0cd21c _Z24do_handle_one_connectionP7CONNECTb + 315
0   mariadbd                            0x000000010a0cd058 handle_one_connection + 91
0   mariadbd                            0x000000010a1dd04b pfs_spawn_thread + 207
0   libsystem_pthread.dylib             0x00007ff815fbd514 _pthread_start + 125
0   libsystem_pthread.dylib             0x00007ff815fb902f thread_start + 15

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x0): (null)
Connection ID (thread ID): 3
Status: NOT_KILLED

Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off

The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
information that should help you find out what is causing the crash.

We think the query pointer is invalid, but we will try to print it anyway. 
Query: 

Core pattern: /cores/core.%P

comment:4 Changed 3 years ago by jonasjonas (Frank Hellenkamp)

I installed libressl instead of openssl, removed and reinstalled mariadb-10.6 and mariadb-10.6-server and now I seems to run without crashing.

comment:5 Changed 3 years ago by michaelld (Michael Dickens)

@jonasjonas : Thanks for reporting back your success using libressl ... very interesting! MariaDB recommends "Wolf SSL" via a GIT submodule), but allows any SSL with a compatible API. If the issue is with the SSL ABI, then that indicates that either the SSL implementation is broken or MariaDB's use of the SSL implementation is broken. Either way, it's beyond the scope of what I can reasonably fix. That said, I'll look to see if upstream has a fix in place already & if so then create a PR to add it in in the interim before the next release.

comment:6 Changed 3 years ago by claudepache (Claude Pache)

Cc: claudepache added
Note: See TracTickets for help on using tickets.