Setting text blob param AsWideString can cause Access Violation error

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
upscene
Posts: 286
Joined: Thu 19 Oct 2006 08:13

Setting text blob param AsWideString can cause Access Violation error

Post by upscene » Thu 12 Nov 2020 09:11

Hi,

In an application, I'm repeatedly setting a parameter values and calling ExecSQL on the TIBCQuery component.

After several thousand rows, this suddenly fails on a text blob parameter with an access violation.

Code:

Code: Select all

FCommand.Params[Index].AsWideString := 'this is a wide string';
FCommand is the TIBCQuery component, DescribeParams is True, the column is of type BLOB (text).

According to the call stack, it happens in TBlob.Clear + $26, from TDAParam.SetAsWideString + $6C.

Using Delphi XE7, version 7.1.3 of IBDac. In the fixes list for the newer versions, there's nothing about blobs.

Note: this doesn't happen at once, only after a few thousand iterations.

Any clue?

oleg0k
Devart Team
Posts: 131
Joined: Wed 11 Mar 2020 08:28

Re: Setting text blob param AsWideString can cause Access Violation error

Post by oleg0k » Tue 17 Nov 2020 14:26

Hello,
Could you send us a sample IBDAC-based project where the issue occurs more frequently than once in a few thousand iterations? Otherwise, we may not be able to reproduce it.
Please also attach DDL scripts for creating and populating the database objects (or the backup file/database file)
and send them to us through the form: https://devart.com/company/contactform.html

wbr, Oleg
Devart Team

upscene
Posts: 286
Joined: Thu 19 Oct 2006 08:13

Re: Setting text blob param AsWideString can cause Access Violation error

Post by upscene » Wed 18 Nov 2020 18:34

where the issue occurs more frequently
Well, no.

I have an application that executes this multiple times and it simply "just fails" after hundreds/thousands of iterations. First I thought it might be related to the data itself, so I made the value hard coded > still fails. I have no idea why. That's why I gave you the call stack.

oleg0k
Devart Team
Posts: 131
Joined: Wed 11 Mar 2020 08:28

Re: Setting text blob param AsWideString can cause Access Violation error

Post by oleg0k » Tue 24 Nov 2020 15:15

Hello,
Unfortunately, we couldn't reproduce the issue with IBDAC in our environment based on your description. Our users haven't reported this type of issue before, it might be caused by something else. Therefore, the only way to diagnose the issue is to use a sample project where it can be reproduced. Please send us such a project (through the form: https://devart.com/company/contactform.html), and if the issue is related to our product, we'll fix as soon as possible.

wbr, Oleg
Devart Team

upscene
Posts: 286
Joined: Thu 19 Oct 2006 08:13

Re: Setting text blob param AsWideString can cause Access Violation error

Post by upscene » Mon 11 Jan 2021 12:12

I wonder if this could be related to commit-ting a transaction, starting another and continuing using the same prepared statement?

My application generates rows of data, by default, commits after every 1000 rows and I noticed the exception happens after generating 2000 rows (that's after the second COMMIT).

I confirmed 2000 rows being created just fine.

(edit)
I just modified the settings to commit every 100 rows, and hoppa, I now get the access violation after only 200 rows generated. So, the first commit success, the second commit succeeds (cause there's 200 rows in the database), and after that, the access violation happens.

Clearly there's an issue there.

After the access violation, I get:
Assertion failure (D:\Projects\Delphi\Dac\Common\Source\DBAccess.pas, line 7425)
The parameter is set to ftWidememo and then to a string value. Works for 2 commits, then fails.

oleg0k
Devart Team
Posts: 131
Joined: Wed 11 Mar 2020 08:28

Re: Setting text blob param AsWideString can cause Access Violation error

Post by oleg0k » Thu 14 Jan 2021 10:03

Hello,
Unfortunately, we couldn't reproduce the issue with IBDAC in our environment based on your description.
Our users haven't reported such an issue so far and we couldn't reproduce it either. To further investigate it, we need your application code with modified settings (the most basic part which reproduces the issue).
Please send us your application (through the form: https://devart.com/company/contactform.html), and if the issue is related to our product, we'll fix it as soon as possible.

wbr, Oleg
Devart Team

Post Reply