Bug #1424 Segfault in mysql_close (embedded)
Submitted: 28 Sep 2003 23:55 Modified: 29 Sep 2003 1:53
Reporter: Georg Richter Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Embedded Library ( libmysqld ) Severity:S3 (Non-critical)
Version:4.1.1 OS:
Assigned to: Alexey Botchkov CPU Architecture:Any

[28 Sep 2003 23:55] Georg Richter
Description:
mysql_close segfaults with embedded server. 
 
Backtrace: 
 
(gdb) bt full 
#0  free_embedded_thd (mysql=0x8431228) at lib_sql.cc:482 
	thd = (class THD *) 0x8f8f8f8f 
#1  0x0804bce6 in mysql_close (mysql=0x8431228) at libmysqld.c:293 
	_db_func_ = 0x4022fb90 "?*\023" 
	_db_file_ = 0x40014020 "xF\001@\n" 
	_db_level_ = 3221222244 
	_db_framep_ = (char **) 0xbffff2f8 
#2  0x0804b51e in main () at test.c:33 
	rc = 1073823776 
 

How to repeat:
#include <mysql.h> 
#include <stdio.h> 
 
 
int main() { 
	int		rc; 
	int i; 
	MYSQL 		*mysql; 
 
	mysql_server_init(0, NULL, NULL); 
 
	mysql = mysql_init(NULL); 
	if (mysql_real_connect(mysql, NULL, NULL, NULL, "", 0, NULL, 0) == NULL) { 
		printf("error\n"); 
	} 
	if (mysql_errno(mysql)) { 
		printf("Error 1: %s\n", mysql_error(mysql)); 
		mysql_close(mysql); 
		exit(-1); 
	} 
	mysql_close(mysql); 
	mysql_server_end(); 
}
[29 Sep 2003 1:53] Alexey Botchkov
I couldn't reproduce the bug - the example works well on my Linux 8.0
Maybe you should try fresher sources
[29 Sep 2003 1:53] Alexey Botchkov
Thank you for taking the time to report a problem.  Unfortunately
you are not using a current version of the product your reported a
problem with -- the problem might already be fixed. Please download
a new version from http://www.mysql.com/downloads/

If you are able to reproduce the bug with one of the latest versions,
please change the version on this bug report to the version you
tested and change the status back to "Open".  Again, thank you for
your continued support of MySQL.
[29 Sep 2003 2:35] Georg Richter
Alexey, 
 
yes it's fixed now - I tried a bk pull immediatley before I sent the report, but bk replied "nothing 
to pull" (since Friday). Looks like external bk tree should be synchronized more often.