Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

32bit version crashes when closing a PostgreSQL connection #37

Closed
movermeyer opened this Issue Dec 11, 2017 · 9 comments

Comments

Projects
None yet
5 participants
@movermeyer
Copy link

movermeyer commented Dec 11, 2017

Expected behavior

When I click the close connection button, I expect to be brought back to the session manager.

Current behavior

The program throws an exception. This happens every time I click the close connection button:

crash

Failure information (for bugs)

Steps to reproduce

  1. Connect to a PostgreSQL connection.
    • I was unable to test with other databases (MySQL, SQL Server), since I don't have any of those.
  2. Click the "Close Connection" button.
  3. Exception appears.

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • HeidiSQL version: 9.4.0.5125 (Portable)
  • Database system + version: PostgreSQL 9.6 + PostgreSQL 10
  • Operating system: Windows 10 64-bit

Failure Logs

date/time          : 2017-12-11, 08:43:15, 499ms
computer name      : MIKE-DESKTOP
user name          : Mike
registered owner   : Windows User
operating system   : Windows 10 x64 build 16299
system language    : English
system up time     : 5 days 11 hours
program up time    : 3 minutes 56 seconds
processors         : 4x AMD Phenom(tm) II X4 940 Processor
physical memory    : 1096/4095 MB (free/total)
free disk space    : (C:) 81.37 GB
display mode       : 1920x1080, 32 bit
process id         : $1dc4
allocated memory   : 85.00 MB
largest free block : 1.00 GB
executable         : heidisql.exe
exec. date/time    : 2017-12-11 08:33
version            : 9.4.0.5125
compiled with      : Delphi XE5
madExcept version  : 4.0.12
callstack crc      : $c709fa10, $f4c20f33, $f4c20f33
exception number   : 1
exception class    : EAccessViolation
exception message  : Access violation at address 6DBA335C in module 'SSLEAY32.dll'. Read of address C35B5E83.

main thread ($1d94):
6dba335c SSLEAY32.dll                         SSL_shutdown
100052fc libpq.dll                            PQfinish
00847a72 heidisql.exe dbconnection   1985 +47 TPgConnection.SetActive
0095660c heidisql.exe Main           2129 +52 TMainForm.ConnectionsNotify
0086ce7a heidisql.exe dbconnection     38  +0 {System.Generics.Collections}TList<dbconnection.TDBConnection>.Notify
0086daef heidisql.exe dbconnection    728  +0 {System.Generics.Collections}TObjectList<dbconnection.TDBConnection>.Notify
0086ce56 heidisql.exe dbconnection     38  +0 {System.Generics.Collections}TList<dbconnection.TDBConnection>.DoDelete
0086d552 heidisql.exe dbconnection    728  +0 {System.Generics.Collections}TList<dbconnection.TDBConnection>.Delete
0086d525 heidisql.exe dbconnection    728  +0 {System.Generics.Collections}TList<dbconnection.TDBConnection>.Remove
0095625c heidisql.exe Main           2057  +6 TMainForm.actDisconnectExecute
0053b94b heidisql.exe System.Classes          TBasicAction.Execute
00595523 heidisql.exe Vcl.ActnList            TCustomAction.Execute
0053b7eb heidisql.exe System.Classes          TBasicActionLink.Execute
005b154c heidisql.exe Vcl.Controls            TControl.Click
005f80f8 heidisql.exe Vcl.ComCtrls            TToolButton.Click
005b1a0d heidisql.exe Vcl.Controls            TControl.WMLButtonUp
005b100d heidisql.exe Vcl.Controls            TControl.WndProc
005b0c48 heidisql.exe Vcl.Controls            TControl.Perform
005b5268 heidisql.exe Vcl.Controls            GetControlAtPos
005b5332 heidisql.exe Vcl.Controls            TWinControl.ControlAtPos
005b0c48 heidisql.exe Vcl.Controls            TControl.Perform
005b53fc heidisql.exe Vcl.Controls            TWinControl.IsControlMouseMsg
005b59a9 heidisql.exe Vcl.Controls            TWinControl.WndProc
005fcc68 heidisql.exe Vcl.ComCtrls            TToolBar.WndProc
005b5170 heidisql.exe Vcl.Controls            TWinControl.MainWndProc
0053c65c heidisql.exe System.Classes          StdWndProc
774e8c1b USER32.dll                           DispatchMessageW
00686167 heidisql.exe Vcl.Forms               TApplication.ProcessMessage
006861aa heidisql.exe Vcl.Forms               TApplication.HandleMessage
006864e5 heidisql.exe Vcl.Forms               TApplication.Run
76868652 KERNEL32.DLL                         BaseThreadInitThunk
@movermeyer

This comment has been minimized.

Copy link
Author

movermeyer commented Dec 11, 2017

I should also add that this happens whenever the connection closes. For example, it also happens if you close the application with the window's "X" button.

@ansgarbecker

This comment has been minimized.

Copy link
Collaborator

ansgarbecker commented Dec 11, 2017

This crash only occurs in the 32bit version of HeidiSQL, right? I noticed that already, but never found a working solution to that. The relevant code in HeidiSQL is quite simplistic:

    PQfinish(FHandle); // << this line crashes, always, in SSLEAY32.dll
    FActive := False;
    ClearCache(False);
    FConnectionStarted := 0;
    Log(lcInfo, f_(MsgDisconnect, [FParameters.Hostname, DateTimeToStr(Now)]));
@movermeyer

This comment has been minimized.

Copy link
Author

movermeyer commented Dec 11, 2017

This was the 32-bit version (I simply clicked on the "Portable" installer option on the download page.).

@ansgarbecker ansgarbecker changed the title Closing a (PostgreSQL? ) connection causes an exception 32bit version crashes when closing a PostgreSQL connection Dec 12, 2017

@movermeyer

This comment has been minimized.

Copy link
Author

movermeyer commented Dec 12, 2017

I have confirmed that it still happens on the 32-bit version using the latest installer.

@saho-tabakov

This comment has been minimized.

Copy link

saho-tabakov commented Jan 31, 2018

It is still here with HeidiSQL ver.9.5.0.5226, 32-bit

Tested with libpq.dll ver. 9.5.2, 9.6.1 and 9.6.6 and ssleay32.dll ver. 1.0.2g, 1.0.2l and 1.0.2n
The result is always one and the same - access violation while disconnecting in SSLEAY32.dll.

Are there any negative consequences, except for the error screen?

@rentalhost

This comment has been minimized.

Copy link
Collaborator

rentalhost commented Feb 12, 2018

@ansgarbecker Delphi support exception handling in cases like that? Something like try PQFinish() catch...

@ansgarbecker

This comment has been minimized.

Copy link
Collaborator

ansgarbecker commented Feb 12, 2018

Of course I could just silence that error. But I would prefer to find the cause and fix it. The 64bit version doesn't do that by the way.

@oliversalzburg

This comment has been minimized.

Copy link

oliversalzburg commented Mar 19, 2019

I'm running 64bit btw
image

@ansgarbecker

This comment has been minimized.

Copy link
Collaborator

ansgarbecker commented Mar 30, 2019

Finally I silenced this access violation :)
I have no clue how to overvome this crash in a normal way, and I don't eben know why it happens. So this is now the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.