473,287 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Segmentation fault on updating a BYTEA field [psycopg2]

I have a simple DB table that stores md5 signature pairs:

Table "public.duplicate"
Column | Type | Modifiers
----------+-------+-----------
sig | bytea | not null
orig_sig | bytea | not null
Indexes:
"duplicate_pkey" PRIMARY KEY, btree (sig)
"ix_duplicate_orig_sig" btree (orig_sig)

I use SqlAlchemy to interact with it and inserting works fine; update
however crashes hard with a segfault. Sure enough, the crash is
reproducible when using the underlying psycopg2 directly:
>>import psycopg2
connect_string = ...
conn = psycopg2.connect(connect_string)
cur = conn.cursor()
cur.execute('SELECT sig,orig_sig from duplicate limit 1')
d = cur.fetchone()
d
(<read-only buffer for 0x40209100, size 16, offset 0 at 0x403054e0>,
<read-only buffer for 0x402090f0, size 16, offset 0 at 0x40305580>)
>>map(str,d)
["\x02#qO\xb0\xcc\xfcx\xb9u\xa5\x83)\xc4'@", '\xa1\xf22\xf6y\xd0\xbc
\xea6\xf0Y\xf1"\xc9(\n']
>>cur.execute('UPDATE duplicate SET orig_sig=%(orig_sig)s WHERE duplicate.sig = %(duplicate_sig)s',
.... dict(orig_sig=d[0], duplicate_sig=d[1]))
Segmentation fault

Am I (and SqlAlchemy) doing something silly or is this a bug in
psycopg2 ?

George
Jun 27 '08 #1
1 2127
On May 21, 6:32 pm, George Sakkis <george.sak...@gmail.comwrote:
I have a simple DB table that stores md5 signature pairs:

Table "public.duplicate"
Column | Type | Modifiers
----------+-------+-----------
sig | bytea | not null
orig_sig | bytea | not null
Indexes:
"duplicate_pkey" PRIMARY KEY, btree (sig)
"ix_duplicate_orig_sig" btree (orig_sig)

I use SqlAlchemy to interact with it and inserting works fine; update
however crashes hard with a segfault. Sure enough, the crash is
reproducible when using the underlying psycopg2 directly:
>import psycopg2
connect_string = ...
conn = psycopg2.connect(connect_string)
cur = conn.cursor()
cur.execute('SELECT sig,orig_sig from duplicate limit 1')
d = cur.fetchone()
d

(<read-only buffer for 0x40209100, size 16, offset 0 at 0x403054e0>,
<read-only buffer for 0x402090f0, size 16, offset 0 at 0x40305580>)>>map(str,d)

["\x02#qO\xb0\xcc\xfcx\xb9u\xa5\x83)\xc4'@", '\xa1\xf22\xf6y\xd0\xbc
\xea6\xf0Y\xf1"\xc9(\n']>>cur.execute('UPDATE duplicate SET orig_sig=%(orig_sig)s WHERE duplicate.sig = %(duplicate_sig)s',

... dict(orig_sig=d[0], duplicate_sig=d[1]))
Segmentation fault

Am I (and SqlAlchemy) doing something silly or is this a bug in
psycopg2 ?

George
I installed the latest release (psycopg2-2.0.7) and it seems the
problem is gone. Sorry for the noise.

George
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: madunix | last post by:
My Server is suffering bad lag (High Utlization) I am running on that server Oracle10g with apache_1.3.35/ php-4.4.2 Web visitors retrieve data from the web by php calls through oci cobnnection...
4
by: Abandoned | last post by:
Hi.. I run a my script and 3-4 minutes later give me an error "segmentation fault". What is the reason of this error ? I use in my script: Threading Psycopg2 open & write to txt urlopen
0
by: badaboum84 | last post by:
I have to migrate a current PostgreSQL database to MSSQL. For doing this task I uses Python to create script for doing this task. Now, I want to extract the data from the current PostgreSQL...
15
by: Rares Vernica | last post by:
Hello, I have a strange problem. I compile my code with g++ (GCC) 4.1.2. My code runs just fine if I use the -O2 optimization flag. valgrind does not report any memory leak. When I use the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.