Bug #15749 Crash with : mysqld in free(): warning: modified (chunk-) pointer
Submitted: 14 Dec 2005 17:56 Modified: 17 Dec 2005 8:33
Reporter: Geoffroy RIVAT Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1.15 OS:FreeBSD (FreeBSD 6.0-STABLE)
Assigned to: CPU Architecture:Any

[14 Dec 2005 17:56] Geoffroy RIVAT
Description:
My MySQL server is crashing regularly.

The first logs was :
Version: '4.1.15-log'  socket: '/tmp/mysql.sock'  port: 3306  FreeBSD port: mysql-server-4.1.15
mysqld got signal 10;
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.
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.

key_buffer_size=16777216
read_buffer_size=1044480
max_used_connections=64
max_connections=500
threads_connected=16
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 133164 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

The server was compiled with BUILD_OPTIMIZED (CFLAGS+=        -O3 -fno-omit-frame-pointer) and BUILD_STATIC (--with-mysqld-ldflags=-all-static) flags.

I recompiled server without any flags and now the server is always crashing but with the message :

Version: '4.1.15-log'  socket: '/tmp/mysql.sock'  port: 3306  FreeBSD port: mysql-server-4.1.15
mysqld in free(): warning: modified (chunk-) pointer

my.cnf is :
skip-bdb
big-tables
innodb_data_file_path = ibdata1:1000M:autoextend
back_log                        =       250
connect_timeout                 =       10
join_buffer_size                =       8M
key_buffer                      =       16M
read_buffer_size                =       1M
sort_buffer                     =       32M
max_connections                 =       500
max_connect_errors              =       100
max_delayed_threads             =       100
max_tmp_table                   =       1024
net_read_timeout                =       60
net_write_timeout               =       90
query_cache_limit               =       16M
query_cache_size                =       32M
query_cache_type                =       1
tmp_table_size                  =       512M
thread_stack                    =       8M
table_cache                     =       32M     
wait_timeout                    =       230400

The request are made with PHP 4.4.1 on a remote server using mysql_pconnect.

Here is a sample of status command : Uptime: 830  Threads: 124  Questions: 89438  Slow queries: 0  Opens: 237  Flush tables: 1  Open tables: 207  Queries per second avg: 107.757

How to repeat:
Don't know.. I've tried do a full log to see if a query always be the same before crash but not

Suggested fix:
None
[14 Dec 2005 17:58] Geoffroy RIVAT
Error file

Attachment: sushi.err (application/octet-stream, text), 194.29 KiB.

[15 Dec 2005 21:31] Geoffroy RIVAT
This evening MySQL has crashed again but without restarting..

Always same log.
[16 Dec 2005 10:09] Valeriy Kravchuk
Thank you for a problem report. Please, send the exact configure options used and describe your hardware.
[16 Dec 2005 10:21] Geoffroy RIVAT
It's Dell PowerEdge 1425
Bi Intel(R) Xeon(TM) CPU 2.80GHz
2Gb of RAM
2x 80Go in SATA

./configure --localstatedir=/var/db/mysql --without-debug --without-readline --without-libedit --without-bench --without-extra-tools --with-libwrap --with-mysqlfs --with-vio --with-low-memory --with-comme
nt=FreeBSD port: mysql-server-4.1.15 --enable-thread-safe-client --enable-assembler --with-berkeley-db --with-named-thread-libs=-pthread --prefix=/usr/local --build=i386-portbld-freebsd6.0
[16 Dec 2005 11:51] Geoffroy RIVAT
The latest crash has one line more in err file :

mysqld in free(): warning: modified (chunk-) pointer
Fatal error '_pq_insert_tail: Already in priority queue' at line 200 in file /usr/src/lib/libpthread/thread/thr_priority_queue.c (errno = 0)
[16 Dec 2005 13:19] Valeriy Kravchuk
Can you, please, try to rebuild with LinuxThreads and check for the same crashes then? http://dev.mysql.com/doc/refman/5.0/en/freebsd.html has some hints on this.
[17 Dec 2005 8:33] Geoffroy RIVAT
MySQL Server has no more crashed.

Really thanks.