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
Operations

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'

cdir="c:/mix/firebird/QA/fbt-repo/tmp/"

fbport="3331"
dbfile=cdir+"e30.fdb"

dsn='localhost/'+fbport+':'+dbfile
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'
cur1.prep(stt)
print( att1.firebird_version )
att1.close()
cur1.execute(stt)
for row in cur1.fetchall():
    print(row[0])
===

Output:
===
Traceback (most recent call last):
  File "c5285t.py", line 23, in <module>
    cur1.execute(stt)
  File "C:\Python27\lib\site-packages\fdb\fbcore.py", line 3567, in execute
    self._transaction.begin()
  File "C:\Python27\lib\site-packages\fdb\fbcore.py", 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'.