Access Violation after long query

lemon_juice's profile image lemon_juice posted 13 years ago in Running SQL scripts Permalink
I have connected to a remote server and ran a select query that was taking long to process. After about 2 minutes Heidi crashed. When I pressed continue I got a message "Lost connection to mysql server", and the program hang taking up 100% CPU. It might be possible that Heidi crashed when the query finished executing beause that's what process list soon revealed.

date/time : 2011-06-30, 15:26:14, 15ms
computer name : xxx
user name : xxx
registered owner : xxx
operating system : Windows XP Dodatek Service Pack 3 build 2600
system language : Polish
system up time : 15 minutes 28 seconds
program up time : 12 minutes 30 seconds
processor : AMD Athlon(tm) XP 3000+
physical memory : 442/1279 MB (free/total)
free disk space : (D:) 773,45 MB
display mode : 1680x1050, 32 bit
process id : $ac8
allocated memory : 15,78 MB
executable : heidisql.exe
exec. date/time : 2011-06-30 12:09
version : 6.0.0.3902
compiled with : Delphi XE
madExcept version : 3.0m beta 1
callstack crc : $100378be, $fe5a4577, $fe5a4577
exception number : 1
exception class : EAccessViolation
exception message : Access violation at address 100378BE in module 'libmysql.dll'. Read of address 00000003.

main thread ($640):
100378be libmysql.dll
10024dad libmysql.dll mysql_ping
0073d030 heidisql.exe dbconnection 1261 +2 TMySQLConnection.Ping
007433e6 heidisql.exe dbconnection 2659 +5 TDBConnection.ConnectionInfo
007cf087 heidisql.exe Main 1104 +18 TMainForm.StatusBarMouseMove
004e9802 heidisql.exe Controls TControl.MouseMove
004e988e heidisql.exe Controls TControl.WMMouseMove
004e8f68 heidisql.exe Controls TControl.WndProc
004ed82c heidisql.exe Controls TWinControl.WndProc
004ececc heidisql.exe Controls TWinControl.MainWndProc
004ab73c heidisql.exe Classes StdWndProc
7e368a0b USER32.dll DispatchMessageW
00587a87 heidisql.exe Forms TApplication.ProcessMessage
00587aca heidisql.exe Forms TApplication.HandleMessage
00587df5 heidisql.exe Forms TApplication.Run
008008c3 heidisql.exe heidisql 66 +16 initialization
BubikolRamios's profile image BubikolRamios posted 13 years ago Permalink
Just a tip, if this happens often.

The same thing (100% cpu) appears in MYSQL query browser ('badly' written queries). So since I don't have multicore CPU, that means computer hangs, on win xp, I installed 'Process tammer' - look for it on google. It helps, like in 99% of cases, so you can kill mysqld process without restaring comp. Same queries do allso 'hang' on linux but there I have multicore CPU, or is it Linux ? that enables me to restart mysqld.
lemon_juice's profile image lemon_juice posted 13 years ago Permalink
BubikolRamios, in this case I don't think the problem has anything to do with badly written queries because I was connecting to a remote db so the query wasn't running on my computer at all. It was heidisql's process using 100% CPU.
BubikolRamios's profile image BubikolRamios posted 13 years ago Permalink
Did not mean bad as bad, but in sence of not using indexes, using some stuff that makes mysql slow, ...
lemon_juice's profile image lemon_juice posted 13 years ago Permalink
I know but this makes no difference anyway - the query was not run on my computer so it was the remote server that could have high CPU usage not my computer, therefore there was no reason for high CPU usage on my end.
lemon_juice's profile image lemon_juice posted 13 years ago Permalink
But there is another possibility: after 2 minutes the server might have started to send back a large result set which somehow overwhelmed Heidi and possibly made it to run into an infinite loop, hence 100% CPU.
BubikolRamios's profile image BubikolRamios posted 13 years ago Permalink
Hmm, don't know how hsql operates internaly but I think it has default limit like 100000, but not sure if that limit is automaticaly included into sql.

tested that, on remote server:
1. select from huge_table
--> did not wait, managed to crash hsql with stop button
2. select from huge_table limit 100.000
it ignores tools/preferences/data/number of rows displayed
BubikolRamios's profile image BubikolRamios posted 13 years ago Permalink
That is, I thik 'large result' should be by default limited to
100.000.
[expired user #5298]'s profile image [expired user #5298] posted 13 years ago Permalink
I get the same crash on a result set of 2250

operating system : Windows XP Service Pack 3 build 2600
system language : English
system up time : 9 days 7 hours
program up time : 3 minutes 29 seconds
processors : 2x Intel(R) Pentium(R) 4 CPU 3.00GHz
physical memory : 1528/3063 MB (free/total)
free disk space : (C:) 26.50 GB
display mode : 1280x1024, 32 bit
process id : $a8c
allocated memory : 13.53 MB
executable : heidisql.exe
exec. date/time : 2011-08-16 09:46
version : 6.0.0.3923
compiled with : Delphi XE
madExcept version : 3.0m beta 1
callstack crc : $0351794c, $dde4fb04, $dde4fb04
exception number : 1
exception class : EAccessViolation
exception message : Access violation at address 0351794C in module 'libmysql.dll'. Read of address 00000088.

main thread ($2030):
0351794c libmysql.dll
03504dad libmysql.dll mysql_ping
0072b1b0 heidisql.exe dbconnection 1263 +2 TMySQLConnection.Ping
007315ce heidisql.exe dbconnection 2659 +5 TDBConnection.ConnectionInfo
007bef9b heidisql.exe Main 1094 +18 TMainForm.StatusBarMouseMove
004e95fa heidisql.exe Controls TControl.MouseMove
004e9686 heidisql.exe Controls TControl.WMMouseMove
004e8d60 heidisql.exe Controls TControl.WndProc
004ed624 heidisql.exe Controls TWinControl.WndProc
004eccc4 heidisql.exe Controls TWinControl.MainWndProc
004ab53c heidisql.exe Classes StdWndProc
7e418a0b USER32.dll DispatchMessageW
00575c0f heidisql.exe Forms TApplication.ProcessMessage
00575c52 heidisql.exe Forms TApplication.HandleMessage
00575f7d heidisql.exe Forms TApplication.Run
007ef8c3 heidisql.exe heidisql 66 +16 initialization
[expired user #5298]'s profile image [expired user #5298] posted 13 years ago Permalink
version is 3923

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