Cancelling ODBC query causes TDP to silently exit

Apologies for not reporting this before. I'd previously been unable to find the supporting information which I've included below. This issue has existed for me through most of the 5.x series, and persists with 6.x. (Note, with 6.0, I used a fresh install on a brand new Win11 system, but the issue still existed)

Please let me know if you need any additional information.

Using an ODBC connection to a DB2 for i database, attempting to cancel an in-process query can result in TDP crashing silently. (application closes, no error message is presented).

I am unable to reliably reproduce this issue on a clean launch of TDP, but it always exists after using TDP for a few hours, and switching between multiple Native-driver connections and the problematic ODBC connection. I'm assuming this means there's likely some possible degradation of an internal state after using the ODBC connection multiple times.

I also do not know if this is specific to DB2 for i, or if it affects other ODBC connections. I've only reproduced the issue with this database, but my other ODBC connections are rarely used, and even more rarely cancelled.

The specific query does not seem to matter (apart from taking long enough to execute that I feel the need to cancel it).

Around the time of cancelling the query, this is what is recorded in Toad.log. (There is nothing in Exception.log or Action.log at the time of the crash)

2023-11-02 14:30:03Z thread# 53 D NativeOdbc Fetching more records. Current Record[1], Row Size[1000]
2023-11-02 14:30:13Z thread# 1 D CANCELINGEXECUTION ToadDataAdapter.IBackgroundTask.Cancel(): before ThreadPool.QueueUserWorkItem(Cancel);  
2023-11-02 14:30:13Z thread# 1 D CANCELINGEXECUTION ToadDataAdapter.IBackgroundTask.Cancel(): after ThreadPool.QueueUserWorkItem(Cancel);  
2023-11-02 14:30:13Z thread# 36 D CANCELINGEXECUTION ToadDataAdapter.Cancel(object state): before Cancel().  
2023-11-02 14:30:13Z thread# 36 D CANCELINGEXECUTION ToadDataAdapter.Cancel(object state): entering Cancel().
2023-11-02 14:30:13Z thread# 36 D CANCELINGEXECUTION ToadDataAdapter.Cancel(): cancel = true  
2023-11-02 14:30:13Z thread# 36 D CANCELINGEXECUTION ToadDataAdapter.Cancel(): before connection.Cancel(adapter.SelectCommand)  
2023-11-02 14:30:13Z thread# 36 D CANCELINGEXECUTION OdbcToadCancel.Cancel(IDbCommand command): entering with Command select * from tloadhdr hdr fetch first 5000 rows only
2023-11-02 14:30:13Z thread# 36 D CANCELINGEXECUTION OdbcToadCancel.Cancel(IDbCommand command): before odbcCommand.Cancel().  
2023-11-02 14:30:13Z thread# 36 D OdbcCommand.Cancel():   entering.  
2023-11-02 14:30:13Z thread# 36 D NativeOdbc OdbcCommand.Cancel

Additionally, this is noted in windows Event Viewer:


Faulting application name: toad.exe, version: 6.1.0.40, time stamp: 0x815f92ae
Faulting module name: ntdll.dll, version: 10.0.22000.2538, time stamp: 0x8512d78c
Exception code: 0xc0000374
Fault offset: 0x000000000010c399
Faulting process id: 0x624
Faulting application start time: 0x01da0db26b9d4a45
Faulting application path: C:\Program Files\Quest Software\Toad Data Point 6.1\toad.exe
Faulting module path: C:\WINDOWS\SYSTEM32\ntdll.dll
Report Id: d38d4d4e-d23e-4f1d-94cd-74c8319b05af
Faulting package full name: 
Faulting package-relative application ID: