Issue Details (XML | Word | Printable)

Key: CORE-5285
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Alexander Peshkov
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
Firebird Core

Segfault when attachment is closed before it's request/statement/etc.

Created: 20/Jun/16 09:56 AM   Updated: 22/Jun/16 04:41 PM
Component/s: API / Client Library
Affects Version/s: 4.0 Initial, 3.0.0
Fix Version/s: 3.0.1, 4.0 Alpha 1

QA Status: Cannot be tested
Test Details:
Unfortunatelly, problem can not be reproduced when running in Python + fdb scenario described by Alex:
import os
import fdb

os.environ["ISC_USER"] = 'SYSDBA'
os.environ["ISC_PASSWORD"] = 'masterke'



customTPB = ( [ fdb.isc_tpb_read_committed, fdb.isc_tpb_rec_version, fdb.isc_tpb_nowait ] )

att1 = fdb.connect(dsn=dsn)
trn1 = att1.trans( default_tpb = customTPB )
cur1 = trn1.cursor()
stt='select mon$database_name from mon$database'
print( att1.firebird_version )
for row in cur1.fetchall():

Traceback (most recent call last):
  File "", line 23, in <module>
  File "C:\Python27\lib\site-packages\fdb\", line 3567, in execute
  File "C:\Python27\lib\site-packages\fdb\", line 3978, in begin
    raise ProgrammingError("Transaction is permanently closed.")
fdb.fbcore.ProgrammingError: Transaction is permanently closed.

 Description  « Hide
When trying to access some object with already closed attachment initialization code (common for all objects) tries to access already missing attachment. An issue is partially fixed in pull request #37. However, other objects require same fix, not only request.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov added a comment - 20/Jun/16 06:35 PM
How to test:
Attach to database, prepare statement, detach from database, next ask statement to execute or open cursor.
On 3.0.0 this should cause segfault. On current snapshots - expected message like 'statement handle invalid'.