Share

KInterbasDB

Tracker: Bugs

5 Segfault on fetchone() after non-select - ID: 551098
Last Update: Settings changed ( woodsplitter )

I realize that fetching after executing a non-select
statement is improper, but it should really raise an
exception, not segfault ;-)

I ran into this because the ZFirebirdDA adapter for
Zope is buggy, and always fetches.


Nobody/Anonymous ( nobody ) - 2002-05-01 17:59

5

Closed

Fixed

Nobody/Anonymous

General problems

None

Public


Comments ( 5 )




Date: 2002-05-09 02:39
Sender: woodsplitterProject Admin

Logged In: YES
user_id=414645

Fixed in CVS rev 1.23 of _kinterbasdb.c


Date: 2002-05-02 22:15
Sender: woodsplitterProject Admin

Logged In: YES
user_id=414645

I found the problem. It was the same silly strcat call
that gave rise to another bug:

http://sourceforge.net/tracker/index.php?
func=detail&aid=551207&group_id=9913&atid=109913


A fix is coming soon to a CVS repository near you.


Date: 2002-05-02 20:18
Sender: woodsplitterProject Admin

Logged In: YES
user_id=414645

Thanks for the details.

I happen to have a Mandrake 8.1 installation, so I'll use
that to investigate.


Date: 2002-05-02 18:10
Sender: nobody

Logged In: NO

This is kinterbasdb 3.0 final on Mandrake 8.1, kernel
2.4.8-34.1mdk talking to a LI-V6.2.796 Firebird 1.0 server
with a dialect 1 database on Debian Woody.

I left ZFirebird DA out of things, by using the Python 2.1
command line:

>>> import kinterbasdb
>>> kinterbasdb.__version__
(3, 0, 0, 'final', 0)
>>> conn = kinterbasdb.connect('server:/path/db.gdb',
'user', 'pass')
>>> curs = conn.cursor()
>>> curs.execute('update vardata set id=-999 where id=-999')
>>> curs.fetchone()
Segmentation fault


Date: 2002-05-01 23:34
Sender: woodsplitterProject Admin

Logged In: YES
user_id=414645

I need more specifics:
- version of kinterbasdb
- operating system
- version of ZFirebirdDA

I tested a non-query Z SQL Method with kinterbasdb 3.0
(when I refer to 3.0 without further elaboration, I mean
3.0 final, not one of the prereleases), ZFirebirdDA 0.0.1,
Zope 2.5.0, Python 2.1.2, and WinNT 4.0 SP6a. It certainly
didn't segfault; it raised a kinterbasdb.ProgrammingError
(0, 'Attempt to fetch after non-query statement...').

I then tested with ZFirebirdDA 0.0.2; the improper fetching
has been fixed.

As you pointed out, the soundness of ZFirebirdDA is
immaterial in this context, because kinterbasdb should not
segfault no matter how it is abused by a client
programmer. However, *I observed no segfault with
kinterbasdb 3.0*.

Perhaps you are using a version of kinterbasdb previous to
3.0 final, and the segfault you observed is related to this
bug (which is fixed in 3.0 final):
http://sourceforge.net/tracker/index.php?
func=detail&aid=517842&group_id=9913&atid=109913


-------------
On a somewhat related note, I discovered a minor bug while
investigating your bug report:
http://sourceforge.net/tracker/index.php?
func=detail&aid=551207&group_id=9913&atid=109913


Log in to comment.




Attached File

No Files Currently Attached

Changes ( 3 )

Field Old Value Date By
status_id Open 2002-05-12 16:17 woodsplitter
resolution_id None 2002-05-12 16:17 woodsplitter
close_date - 2002-05-12 16:17 woodsplitter