Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segfault with column called delete #103

Closed
rogerbinns opened this issue Dec 29, 2013 · 1 comment
Closed

segfault with column called delete #103

rogerbinns opened this issue Dec 29, 2013 · 1 comment

Comments

@rogerbinns
Copy link
Owner

From jose.gomes.ny on May 26, 2010 08:19:39

This is a way to reproduce the issue. valgrind shows uninitialized memory
reads and eventually an invalid read in vtable.c:174. This is using apsw-
3.6.23.1- r1 .

!/usr/bin/env python

import apsw

class Source:
def Create(self, *args):
return 'CREATE TABLE x (delete)', None

connection = apsw.Connection('db')

cursor = connection.cursor()

connection.createmodule("testmod2", Source())

cursor.execute("create virtual table foo using testmod2(2,two)")

for row in cursor.execute("select * from foo"):
print row

Original issue: http://code.google.com/p/apsw/issues/detail?id=103

@rogerbinns
Copy link
Owner Author

From rogerbinns on May 26, 2010 10:55:36

Thank you very much for reporting this. It is fixed in r6a1015af26 and re3d41937fa which will be in the next release (scheduled along with the next release of SQLite).
In the short term you can grab the latest src/vtable.c or pull down the entire
source via mercurial.

The underlying cause is error handling. In short the code as written would have
resulted in the previous error message in that thread being returned or if there was
none (your case) then a crash (or assertion failure in debug build). (This esoteric
error handling is due to design errors in SQLite's API.)

There is code in the tests that inspect the source to check for this. However it
does not check the vtable code and this was the only relevant line in the vtable code
that would need to be checked. There is no other relevant code that is being missed
by the checks. I did try to add checking this file, but it is far too complex and we
have complete coverage of vtables api anyway so this code is unlikely to change ever.

Status: Verified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant