"invalid pointer operation" on changing SQL for 5th time
"invalid pointer operation" on changing SQL for 5th time
With 3.50.0.18 I get AVs as well.
I'm using a TIBCQuery that's reused during several INSERT operations, when blob columns are involved, I get an AV on the 5th time I'm changing SQL (edit, not on calling Prepare).
If I remove ANY of the INSERTs before the 5th, it works fine. If I put the last INSERT, which does not have a BLOB column on 4th place it fails too.
This is a serious problem for me.
The error is: " Invalid pointer operation "
---------------------------
Project ... raised exception class EAccessViolation with message 'Access violation at address 50006BF4 in module 'rtl120.bpl'. Read of address FFFFFFFD'.
---------------------------
Callstack:
kernerl32.RaiseException
Marshal.FreeHGlobal
TCRCommand.SetSQL + $55
TCustomDASQL.SetICommandSQL + $F7
TCustomDASQL.AssembleSQL + $1E
TCustomDASQL.ProcessSQLChanged + $CB
I'm using a TIBCQuery that's reused during several INSERT operations, when blob columns are involved, I get an AV on the 5th time I'm changing SQL (edit, not on calling Prepare).
If I remove ANY of the INSERTs before the 5th, it works fine. If I put the last INSERT, which does not have a BLOB column on 4th place it fails too.
This is a serious problem for me.
The error is: " Invalid pointer operation "
---------------------------
Project ... raised exception class EAccessViolation with message 'Access violation at address 50006BF4 in module 'rtl120.bpl'. Read of address FFFFFFFD'.
---------------------------
Callstack:
kernerl32.RaiseException
Marshal.FreeHGlobal
TCRCommand.SetSQL + $55
TCustomDASQL.SetICommandSQL + $F7
TCustomDASQL.AssembleSQL + $1E
TCustomDASQL.ProcessSQLChanged + $CB
Last edited by upscene on Wed 29 Dec 2010 07:59, edited 1 time in total.
No offence, but what have you tried so far?AndreyZ wrote:Hello,
I cannot reproduce the problem. Please try composing a small sample to demonstrate the problem and send it to andreyz*devart*com. Also please specify the following:
- the exact Firebird version you are using;
- the exact version of your IDE.
What I have here, is a "datapump" tool.
It copies data from the source to the destination, different column types.
UseUnicode = True.
The data contains blobs in all 4 tables, the 5th table has no blobs.
I prepare the INSERT statement, loop over the source resultset, assign data and use parameterized LoadFromStream on a TByteStream for the blob data.
Now, even when commenting out the LoadFromStream on the blob parameter, I get the "invalid pointer operation" error, the values are not initialized (null) though.
The error happens not when calling .Prepare, but when setting SQL.Text (see the stack trace). I do not have the source, so I do not know what happens on TRCCommand.SetSQL and Marshal.FreeHGlobal.
If I remove the 4th table: still the error, removing the 1st, adding the 4th: no problem.
Now, if I remove SOME of the blob columns in the INSERT statements, the error re-appears. Each table, except for the 5th has 1 blob column, 1 table has 2 blob columns. Removing just one of that table doesn't matter.
Does this help?
Firebird 2.5
Delphi 2009
It copies data from the source to the destination, different column types.
UseUnicode = True.
The data contains blobs in all 4 tables, the 5th table has no blobs.
I prepare the INSERT statement, loop over the source resultset, assign data and use parameterized LoadFromStream on a TByteStream for the blob data.
Now, even when commenting out the LoadFromStream on the blob parameter, I get the "invalid pointer operation" error, the values are not initialized (null) though.
The error happens not when calling .Prepare, but when setting SQL.Text (see the stack trace). I do not have the source, so I do not know what happens on TRCCommand.SetSQL and Marshal.FreeHGlobal.
If I remove the 4th table: still the error, removing the 1st, adding the 4th: no problem.
Now, if I remove SOME of the blob columns in the INSERT statements, the error re-appears. Each table, except for the 5th has 1 blob column, 1 table has 2 blob columns. Removing just one of that table doesn't matter.
Does this help?
Firebird 2.5
Delphi 2009
I'm trying to reproduce, but I cannot yet.AndreyZ wrote:Unfortunately, I still canot reproduce the problem. Please try composing a small sample to demonstrate the problem and send it to andreyz*devart*com.
Can you post the code of the routines at this callstack:
Marshal.FreeHGlobal
TCRCommand.SetSQL + $55
TCustomDASQL.SetICommandSQL + $F7
TCustomDASQL.AssembleSQL + $1E
TCustomDASQL.ProcessSQLChanged + $CB
?
Perhaps that helps me.
I've commented out the BLOB transferring: still the same problem.AndreyZ wrote:This problem can be caused by incorrect working with memory. Please check that you correctly allocate memory for blob data and free it.
As I've said: when the BLOB columns are not part of the INSERT INTO statement, the error doesn't happen. When they ARE part of the statement, but no data is put into them, the error happens.
Just after I've sent you the instructions on how to do this with the full application, I was able to reproduce the problem in a sample application!AndreyZ wrote:Ok, send your application and databases to andreyz*devart.com. Also specify the steps we should perform in your application to reproduce the problem.
I've sent you the sample application as well. I noticed in the full application, that using .Params.Clear just before setting the SQL avoids the problem.
Please check to see where things go wrong.