[MDEV-2974] LP:422550 - Crash in PBXT during shutdown Created: 2009-09-01  Updated: 2012-10-04  Resolved: 2012-10-04

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Kristian Nielsen Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: Launchpad

Attachments: XML File LPexportBug422550.xml    

 Description   

I have a problem with PBXT crashing sometimes during shutdown.

To reproduce, run the following command in a build of lp:maria:

mkdir -p /tmp/x && sql/mysqld --no-defaults --basedir=$(pwd) --character-sets-dir=$(pwd)/sql/share/charsets --language=$(pwd)/sql/share/english --skip-networking --datadir=/tmp/x --skip-grant-tables --nonexistentoption

This is supposed to complain about bad --nonexistentoption, and exit.

Instead, in about 75% of cases it crashes during shutdown .

Basically, it crashes when the thread that calls xt_init_databases() is
different from the thread that calls xt_stop_database_threads(),
xt_exit_databases(), and db_finalize(). For some reason, this is usually, but
not always, done in different threads in this scenario.

Here is the stack trace:

==16085== Invalid read of size 4
==16085== at 0x9DFB78: xt_sl_delete(XTThread*, XTSortedList*, void*) (sortedlist_xt.cc:205)
==16085== by 0xA14461: db_finalize(XTThread*, void*) (database_xt.cc:323)
==16085== by 0x9C340E: xt_heap_release(XTThread*, XTHeap*) (heap_xt.cc:110)
==16085== by 0xA133AA: xt_unuse_database(XTThread*, XTThread*) (database_xt.cc:662)
==16085== by 0xA1341C: xt_db_exit_thread(XTThread*) (database_xt.cc:682)
==16085== by 0x9F6F07: thr_exit(XTThread*) (thread_xt.cc:1051)
==16085== by 0x9F711A: xt_free_thread(XTThread*) (thread_xt.cc:1445)
==16085== by 0x9F9345: thr_main (thread_xt.cc:1028)
==16085== by 0x50463F6: start_thread (pthread_create.c:297)
==16085== by 0x6026B3C: clone (in /usr/lib/debug/libc-2.7.so)
==16085== Address 0x44 is not stack'd, malloc'd or (recently) free'd

So, I do not know why the thread is sometimes the same and sometimes not in
startup and shutdown. I guess it is some kind of race condition?



 Comments   
Comment by Paul McCullagh (Inactive) [ 2009-09-01 ]

Re: Crash in PBXT during shutdown
Hi Kristian,

Thanks for the bug report. I have confirmed this crash exactly as described. I will prepare a fix.

Comment by Rasmus Johansson (Inactive) [ 2009-09-07 ]

Launchpad bug id: 422550

Generated at Thu Feb 08 06:45:28 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.