Roundup Robot added the comment:
New changeset c46ad743bcb4 by Serhiy Storchaka in branch '2.7':
Issue #21975: Fixed crash when using uninitialized sqlite3.Row (in particular
http://hg.python.org/cpython/rev/c46ad743bcb4
New changeset c1ca1c4c131b by Serhiy Storchaka in branch '3.4':
Issue
Changes by Serhiy Storchaka storch...@gmail.com:
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21975
___
Claudiu Popa added the comment:
Hi, thanks for the report. Here's a patch which implements __setstate__ and
__getstate__ for Row objects.
--
keywords: +patch
nosy: +Claudiu.Popa, ghaering
stage: - patch review
versions: +Python 3.5 -Python 3.3
Added file:
Serhiy Storchaka added the comment:
The issue is not in pickling/unpickling, but in sqlite3.Row.__new__ which
creates object in invalid state. Simple example:
import sqlite3
r = sqlite3.Row.__new__(sqlite3.Row)
len(r)
Segmentation fault (core dumped)
--
assignee: -
Claudiu Popa added the comment:
Using your example, I can't make it to crash using the tip, nor with Python 3.4.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21975
___
Claudiu Popa added the comment:
Nevermind, I didn't see the len call.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21975
___
___
Serhiy Storchaka added the comment:
Here is a patch which fixes crash.
--
stage: - patch review
Added file: http://bugs.python.org/file35953/sqlite3_row_new.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21975
Claudiu Popa added the comment:
It doesn't crash anymore with your patch, but the pickle.load fails:
Traceback (most recent call last):
File a.py, line 19, in module
load = pickle.loads(dump)
TypeError: function takes exactly 2 arguments (0 given)
--
stage: patch review -
Serhiy Storchaka added the comment:
For pickling open other issue.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21975
___
___
Python-bugs-list
Claudiu Popa added the comment:
Ups, I accidentally removed the patch review stage, sorry for that.
--
stage: - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21975
___
Elizabeth Myers added the comment:
The backtrace of the crash, if it helps
--
Added file: http://bugs.python.org/file35948/trace.txt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21975
___
New submission from Elizabeth Myers:
Pickling, unpickling, then using an sqlite3.Row object results in a segfault on
at least Python 3.3.5, 3.4.0, and 3.4.1. I have attached a test case and a
backtrace below.
I know you're not supposed to pickle sqlite3.Row objects, as the given test
case
12 matches
Mail list logo