Bug #25532 Null ptr to my_real_read
Submitted: 10 Jan 2007 19:36 Modified: 11 Feb 2007 11:11
Reporter: [ name withheld ] Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S2 (Serious)
Version:5.0.27 OS:Microsoft Windows (XPSP2)
Assigned to: CPU Architecture:Any

[10 Jan 2007 19:36] [ name withheld ]
Description:
Dies in net_serv.cpp line number 811:

   if ((int) (length=vio_read(net->vio,(char*) pos,remain)) <= 0L)
        {
          my_bool interrupted = vio_should_retry(net->vio);  <------crash

	  DBUG_PRINT("info",("vio_read returned %d,  errno: %d",

Death is do to vio = NULL.  Vars:

-	net	0x1306f568 {vio=0x00000000 {sd=??? hPipe=??? localhost=??? ...} buff=0x00000000 <Bad Ptr> buff_end=0x0259a938 "ÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝ" ...}	st_net *
+	vio	0x00000000 {sd=??? hPipe=??? localhost=??? ...}	st_vio *
+	buff	0x00000000 <Bad Ptr>	unsigned char *
+	buff_end	0x0259a938 "ÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝ"	unsigned char *
+	write_pos	0x02598938 "ÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝ"	unsigned char *
+	read_pos	0x02598938 "ÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝ"	unsigned char *
	fd	976	unsigned int
	max_packet	8192	unsigned long

Backtrace:
>	_mysql.pyd!my_real_read(st_net * net=0x1306f568, unsigned long * complen=0x03a2f4fc)  Line 811 + 0xb	C++
 	_mysql.pyd!my_net_read(st_net * net=0x1306f568)  Line 983 + 0xd	C++
 	_mysql.pyd!cli_safe_read(st_mysql * mysql=0x1306f568)  Line 596 + 0x9	C
 	_mysql.pyd!cli_read_rows(st_mysql * mysql=0x1306f568, st_mysql_field * mysql_fields=0x031b51f8, unsigned int fields=34)  Line 1355 + 0x9	C
 	_mysql.pyd!mysql_store_result(st_mysql * mysql=0x1306f568)  Line 2738 + 0x24	C
 	_mysql.pyd!_mysql_ResultObject_Initialize(_mysql_ResultObject * self=0x12f66ba0, _object * args=0x00b64828, _object * kwargs=0x11ae3660)  Line 392 + 0x5	C
 	_mysql.pyd!_mysql_ConnectionObject_store_result(_mysql_ConnectionObject * self=0x1306f560, _object * args=0x00961030)  Line 1934 + 0x8	C
 	python24.dll!1e079bb7() 	
 	python24.dll!1e02722f() 	
 	python24.dll!1e028ca8() 	
 	python24.dll!1e028ff4() 	
 	_mysql.pyd!unpack_fields(st_mysql_data * data=0x03a2f718, st_mem_root * alloc=0x00000000, unsigned int fields=1, char default_value='', unsigned int server_capabilities=10777944)  Line 1272 + 0x16	C
 	python24.dll!1e028ff4() 	
 	python24.dll!1e0253ed() 	
 	python24.dll!1e02608b() 	
 	python24.dll!1e0272a6() 	
 	python24.dll!1e028ff4() 	
 	python24.dll!1e02608b() 	
 	python24.dll!1e0272a6() 	
 	python24.dll!1e028ff4() 	
 	python24.dll!1e02608b() 	
 	python24.dll!1e0272a6() 	
 	python24.dll!1e028ff4() 	
 	python24.dll!1e0299a9() 	
 	python24.dll!1e02a01c() 	
 	python24.dll!1e0260e6() 	
 	python24.dll!1e0272a6() 	
 	python24.dll!1e028ff4() 	
 	python24.dll!1e02608b() 	
 	python24.dll!1e0272a6() 	
 	python24.dll!1e028ff4() 	
 	python24.dll!1e05e079() 	
 	python24.dll!1e02608b() 	
 	python24.dll!1e0272a6() 	
 	python24.dll!1e028ff4() 	
 	python24.dll!1e05e079() 	
 	python24.dll!1e02608b() 	
 	python24.dll!1e0272a6() 	
 	python24.dll!1e028ff4() 	
 	python24.dll!1e0299a9() 	
 	python24.dll!1e02a01c() 	
 	python24.dll!1e05f35f() 	
 	python24.dll!1e018f3c() 	
 	python24.dll!1e02cf24() 	
 	ntdll.dll!7c90d625() 	
 	ntdll.dll!7c90eacf() 	
 	ntdll.dll!7c9105c8() 	
 	wxmsw272h_core_vc.dll!012bfffc() 	
 	ntdll.dll!7c9105c8() 	
 	ntdll.dll!7c910551() 	
 	ntdll.dll!7c91056d() 	
 	kernel32.dll!7c80261a() 	
 	kernel32.dll!7c8025f0() 	
 	kernel32.dll!7c8025f0() 	
 	kernel32.dll!7c802532() 	
 	python24.dll!1e018f3c() 	
 	python24.dll!1e025eda() 	
 	python24.dll!1e0a65e7() 	
 	python24.dll!1e0a5f59() 	
 	msvcr71.dll!7c34940f() 	
 	kernel32.dll!7c80b683() 	

How to repeat:
Run my code.

Suggested fix:
Figure out where null ptr is coming from and repair.

or

Do some type of null ptr checking before use.
[11 Jan 2007 11:11] Valeriy Kravchuk
Thank you for a problem report. Please, send/upload (as private file, if you want) your code and describe all steps to repeat this problem.
[12 Feb 2007 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[6 Mar 2009 17:11] Andrew Hutchings
Forum post in questions is:
https://sourceforge.net/forum/forum.php?thread_id=1646384&forum_id=70461

Could be a duplicate of bug #33854