Bug #25883 Pthread failed assertion
Submitted: 26 Jan 2007 22:14 Modified: 3 Feb 2007 14:01
Reporter: Matteo Beccati Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: General Severity:S1 (Critical)
Version:5.1.14-beta-log OS:Linux (Ubuntu Linux/Sparc )
Assigned to: CPU Architecture:Any

[26 Jan 2007 22:14] Matteo Beccati
Description:
I'm testing a Sun T2000 with Ububtu Linux. Under heavy load the mysqld daemon exits with:

mysqld: pthread_mutex_lock.c:108: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.

I don't actually know if it's a MySQL bug or compiler/glibc related bug.

How to repeat:
I was trying to benchmark performance of a web application using ab from a remote machine.

ab -c 1 -n 100 http://t2000/script.php - works

ab -c 2 -n 100 http://t2000/script.php - doesn't
[28 Jan 2007 10:28] Valeriy Kravchuk
Thank you for a problem report. Please, send the exact ./configure command line used and:

gcc --version
getconf GNU_LIBPTHREAD_VERSION

results.
[29 Jan 2007 9:53] Matteo Beccati
Plain configure with no optimization (hoping to get more reliable gdb output)

CCFLAGS='-g -O0' CXXFLAGS='-g -O0' ./configure

# gcc --version
gcc (GCC) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# getconf GNU_LIBPTHREAD_VERSION
NPTL 2.4
[29 Jan 2007 11:56] Valeriy Kravchuk
Please, send backtrace, if possible. I do not have any chance to really verify this bug, as I do not have access to SPARC hardware for installation of Ubuntu.
[29 Jan 2007 13:49] Matteo Beccati
I could even provide you a backtrace, but I found out that it was always changing. I will attach one soon. 

I could even grant you SSH access to the machine if it could help: just drop me an email and I'll be happy to help.
[29 Jan 2007 14:00] Matteo Beccati
Here is a backtrace:

mysqld: pthread_mutex_lock.c:108: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.

Program received signal SIGABRT, Aborted.
[Switching to Thread -576439376 (LWP 3997)]
0xf7b279f4 in raise () from /lib/v9v/libc.so.6
(gdb) bt full
#0  0xf7b279f4 in raise () from /lib/v9v/libc.so.6
No symbol table info available.
#1  0xf7b2923c in abort () from /lib/v9v/libc.so.6
No symbol table info available.
#2  0xf7b1f0bc in __assert_fail () from /lib/v9v/libc.so.6
No symbol table info available.
#3  0xf7f084cc in pthread_mutex_lock () from /lib/v9v/libpthread.so.0
No symbol table info available.
#4  0x0018cbf4 in dispatch_command ()
No symbol table info available.
#5  0x0018ec4c in handle_one_connection ()
No symbol table info available.
#6  0xf7f06d34 in start_thread () from /lib/v9v/libpthread.so.0
No symbol table info available.
#7  0xf7be1458 in clone () from /lib/v9v/libc.so.6
No symbol table info available.
#8  0xf7be1458 in clone () from /lib/v9v/libc.so.6
No symbol table info available.
Previous frame identical to this frame (corrupt stack?)
[31 Jan 2007 12:03] Sveta Smirnova
Could you please provide content of script.php file and structure of tables it uses?
[31 Jan 2007 17:59] Matteo Beccati
The script is the adlog.php script part of the Openads 2.0.11 web application.

Queries are along those lines:

SET SESSION sql_mode='MYSQL40';
INSERT INTO phpads_adviews SET bannerid = 1, zoneid = 1, host = '192.168.1.100', source = '', country = '';

No other queries should be involved.

Table structure is available here: 
https://developer.openads.org/browser/trunk/libraries/defaults/all.sql#L90

InnoDB isn't enabled, but the failure happens both with MyISAM and Memory storage engines.
[3 Feb 2007 14:01] Matteo Beccati
Being unable to use MySQL at all, I've tried to upgrade Ubuntu/Linux to unstable (feisty). I can ensure that it is working now, without recompiling MySQL.

Thank you for your support.

Just as a reference:

# gcc --version
gcc (GCC) 4.1.2 20070106 (prerelease) (Ubuntu 4.1.1-21ubuntu7)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# getconf GNU_LIBPTHREAD_VERSION
NPTL 2.5