Crash in "Insert files into TEXT/BLOB fields" dialogue

kalvaro posted 4 years ago in General
To reproduce:

1. Create a table with a BLOB column, e.g.:

CREATE TABLE `picture` (
PRIMARY KEY (`picture_id`)

2. Go to "Data" tab, right click and choose "Insert files into TEXT/BLOB fields"

3. Type "%filecontent%" in the appropriate "Value" cell and hit enter. Crash!

date/time          : 2015-05-04, 13:57:22, 150ms
computer name      : *********
user name          : ALVARO.GONZALEZ
registered owner   : ALVARO
operating system   : Windows 7 x64 Service Pack 1 build 7601
system language    : Spanish
system up time     : 4 days 4 hours
program up time    : 21 seconds
processors         : 2x AMD Athlon(tm) 64 X2 Dual Core Processor 4000+
physical memory    : 958/4096 MB (free/total)
free disk space    : (C:) 61,35 GB (D:) 12,93 GB
display mode       : 1440x900, 32 bit
process id         : $29b8
allocated memory   : 60,25 MB
largest free block : 8185,30 GB
executable         : heidisql.exe
exec. date/time    : 2015-05-02 13:40
version            :
compiled with      : Delphi XE5
madExcept version  :
callstack crc      : $41cc7730, $abc98d47, $abc98d47
exception number   : 1
exception class    : EAccessViolation
exception message  : Access violation at address 00000000005E4F9B in module 'heidisql.exe'. Read of address 0000000000000000.
main thread ($2730):
005e4f9b heidisql.exe System.Classes          {System.Generics.Collections}TDictionary<System.Integer,System.Classes.IInterfaceList>.Hash
005e5eaf heidisql.exe System.Classes          {System.Generics.Collections}TDictionary<System.Integer,System.Classes.IInterfaceList>.TryGetValue
005dc6f2 heidisql.exe System.Classes          TObservers.IsObserving
006c96b9 heidisql.exe Vcl.StdCtrls            TCustomComboBox.KeyDown
0069d92b heidisql.exe Vcl.Controls            TWinControl.DoKeyDown
006c7f7c heidisql.exe Vcl.StdCtrls            TCustomCombo.ComboWndProc
006ca7ef heidisql.exe Vcl.StdCtrls            TCustomComboBox.ComboWndProc
006c7bcd heidisql.exe Vcl.StdCtrls            TCustomCombo.EditWndProc
005da9b3 heidisql.exe System.Classes          StdWndProc
771d98d5 USER32.dll                           DispatchMessageW
0081328f heidisql.exe Vcl.Forms               TApplication.ProcessMessage
00813303 heidisql.exe Vcl.Forms               TApplication.HandleMessage
0080bc48 heidisql.exe Vcl.Forms               TCustomForm.ShowModal
00c0d86e heidisql.exe Main           3048  +2 TMainForm.actInsertFilesExecute
005d9400 heidisql.exe System.Classes          TBasicAction.Execute
00664783 heidisql.exe Vcl.ActnList            TCustomAction.Execute
005d9134 heidisql.exe System.Classes          TBasicActionLink.Execute
007ea27c heidisql.exe Vcl.Menus               TMenuItem.Click
007ecbaf heidisql.exe Vcl.Menus               TMenu.DispatchCommand
007ef104 heidisql.exe Vcl.Menus               TPopupList.WndProc
007ef005 heidisql.exe Vcl.Menus               TPopupList.MainWndProc
005da9b3 heidisql.exe System.Classes          StdWndProc
771d98d5 USER32.dll                           DispatchMessageW
0081328f heidisql.exe Vcl.Forms               TApplication.ProcessMessage
00813303 heidisql.exe Vcl.Forms               TApplication.HandleMessage
008137ef heidisql.exe Vcl.Forms               TApplication.Run
00c5c3b7 heidisql.exe heidisql         77 +24 initialization
770b59cb kernel32.dll                         BaseThreadInitThunk

P.S. You are not allowed to upload crash reports:

Error: File #0: Invalid file format: text/x-pascal. Allowed types: jpg, png, gif, txt, html.
ansgar posted 4 years ago
I just fixed the upload to allow all text/* types. Should work from now on.

Now for the crash report: That's my all-time-favorite crash which already greyed out my hair, and which I'm now giving another attempt for getting fixed. Probably with a really dirty fix now, as everything else did not help yet.
ansgar posted 4 years ago
Think I got it by the balls now, in r4948. I small glitch in an if/else construct.

I think I intended to make the tab key working in such fields, which now does not work, but at least the crash is fixed.

See also issue #3461.
kalvaro posted 4 years ago
The enter key doesn't work either so I guess there's no way to use the dialogue without the mouse but I can confirm that at least it isn't crashing. Thanks for the effort.
ansgar posted 4 years ago
Exactly, the enter and tab keys should work here, and now they don't do anything but triggering a beep sound. The crash was caused within an OnKeyDown event which destroys the drop down editor when the tab or enter key was pressed. Now the OnKeyDown event triggered a later call to another window procedure at a time when the editor was already destroyed.

Maybe a timer based approach can help here, postponing the destruction of the drop down editor to a point some milliseconds after the tab/enter pressing.
ansgar posted 4 years ago
A user in a Delphi forum had a similar problem, only his solution is quite quirky and also much effort.
kalvaro posted 4 years ago
No idea about Delphi, sorry. In JavaScript you'd just add yet another level of event handlers ;-)

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