Access violation on large query

[expired user #6716]'s profile image [expired user #6716] posted 11 years ago in General Permalink
Hi,

I'm getting an AV inside libmysql when running a large query.
This happens every time I run the query, and I've done nothing else in HeidiSQL since starting it.
The query used to run without error, but the resultset will have grown since then so this may relate to either the time it takes or the size of the resultset.

The query takes 222s to return 20950 rows in MySQL Workbench.

The server version is 5.5.15, the libmysql.dll is currently version 5.5.28a-MariaDB (I've tried a few others, none of them change the behaviour).

Any ideas?

date/time : 2012-12-11, 08:29:55, 352ms
computer name : DT-WALL-806
user name : njt
registered owner : Jim
operating system : Windows 7 x64 Service Pack 1 build 7601
system language : English
system up time : 5 days 23 hours
program up time : 4 minutes 17 seconds
processors : 8x Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz
physical memory : 1175/8151 MB (free/total)
free disk space : (C:) 35.97 GB
display mode : 1680x1050, 32 bit
process id : $3318
allocated memory : 68.25 MB
executable : heidisql.exe
exec. date/time : 2012-12-10 11:52
version : 7.0.0.4273
compiled with : Delphi XE
madExcept version : 3.0m beta 1
callstack crc : $5e45ff70, $884bf626, $884bf626
exception number : 1
exception class : EAccessViolation
exception message : Access violation at address 5E45FF70 in module 'libmysql.dll'. Read of address 00000003.

main thread ($1998):
5e45ff70 libmysql.dll
5e45656f libmysql.dll mysql_ping
00720454 heidisql.exe dbconnection 1451 +2 TMySQLConnection.Ping
00720616 heidisql.exe dbconnection 1488 +1 TDBConnection.KeepAliveTimerEvent
00535457 heidisql.exe ExtCtrls TTimer.Timer
0053533b heidisql.exe ExtCtrls TTimer.WndProc
004ab88c heidisql.exe Classes StdWndProc
75557885 USER32.dll DispatchMessageW
00575f0f heidisql.exe Forms TApplication.ProcessMessage
00575f52 heidisql.exe Forms TApplication.HandleMessage
0057627d heidisql.exe Forms TApplication.Run
00812bf0 heidisql.exe heidisql 75 +23 initialization
75a533a8 kernel32.dll BaseThreadInitThunk

Thanks.
[expired user #6716]'s profile image [expired user #6716] posted 11 years ago Permalink
Oh, the query returns 17 columns, the biggest being varchar(255), so the overall amount of data isn't huge.
ansgar's profile image ansgar posted 11 years ago Permalink
I heard of such crashes in mysql_ping() a couple of times now. I have a gutt feeling that mysql_ping() is called during a (longer) query execution. Since query execution is done asynchronously in a thread, this mysql_ping() runs in the main thread, and can easily interfere with a query thread. Will check.
Code modification/commit from ansgar.becker, 11 years ago, revision 7.0.0.4279
Leave out TTimer based keep alive ping during long running queries. Fixes disconnects and AVs mentioned by a couple of users:
* http://www.heidisql.com/forum.php?t=11751
* http://www.heidisql.com/forum.php?t=8568
ansgar's profile image ansgar posted 11 years ago Permalink
r4279 changes this keep-alive timer to be left out during queries. Please update your build and report back if that fixes your problem. Thanks!
[expired user #6716]'s profile image [expired user #6716] posted 11 years ago Permalink
That does seem to have done the trick - the query just took 233s in HeidiSQL and completed successfuly.

Thanks.

Please login to leave a reply, or register at first.