Segmentation fault using digest from pg_crypto - Mailing list pgsql-hackers

From Manuel Sugawara
Subject Segmentation fault using digest from pg_crypto
Date
Msg-id m33ay924ve.fsf@conexa.fciencias.unam.mx
Whole thread Raw
Responses Re: Segmentation fault using digest from pg_crypto  (Manuel Sugawara <masm@fciencias.unam.mx>)
List pgsql-hackers
Hi,

I have a simple query that uses digest(data, 'sha1') and consistently
crashes the backend (tested in two different machines):

ciencias=# select version();                                                version
---------------------------------------------------------------------------------------------------------PostgreSQL
8.2.4on x86_64-redhat-linux-gnu, compiled by GCC gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-8)
 
(1 row)


ciencias=# select version();                                               version
--------------------------------------------------------------------------------------------------------PostgreSQL
8.2.4on i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-51)
 
(1 fila)

with segmentation fault. Backtrace follows:

-bash-3.1$ gdb `which postgres` ./data/core.7428
GNU gdb Red Hat Linux (6.5-15.fc6rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".


warning: Can't read pathname for load map: Error de entrada/salida.
Reading symbols from /lib/libcrypt.so.1...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
Reading symbols from /usr/lib/gconv/ISO8859-1.so...done.
Loaded symbols for /usr/lib/gconv/ISO8859-1.so
Reading symbols from /usr/lib/pgsql/pgcrypto.so...Reading symbols from
/usr/lib/debug/usr/lib/pgsql/pgcrypto.so.debug...done.
done.
Loaded symbols for /usr/lib/pgsql/pgcrypto.so
Reading symbols from /usr/lib/libz.so.1...done.
Loaded symbols for /usr/lib/libz.so.1
Core was generated by `postgres: masm ciencias [local] SELECT  '.
Program terminated with signal 11, Segmentation fault.
#0  pg_detoast_datum (datum=0x0) at fmgr.c:1964
1964            if (VARATT_IS_EXTENDED(datum))
(gdb) bt
#0  pg_detoast_datum (datum=0x0) at fmgr.c:1964
#1  0x00124c9e in pg_digest (fcinfo=0xbf9ba174) at pgcrypto.c:73
#2  0x0815127c in ExecMakeFunctionResultNoSets (fcache=0x8fa84f8, econtext=0x8fa83d8, isNull=0x8fad282 "",
isDone=0x8fad2e0)at execQual.c:1330
 
#3  0x0814ce57 in ExecProject (projInfo=0x8fad290, isDone=0xbf9ba438) at execQual.c:4119
#4  0x08159d1c in ExecHashJoin (node=0x8fa8350) at nodeHashjoin.c:270
#5  0x0814c55d in ExecProcNode (node=0x8fa8350) at execProcnode.c:390
#6  0x0814b87b in ExecutorRun (queryDesc=0x8fa7ae0, direction=ForwardScanDirection, count=0) at execMain.c:1082
#7  0x081d5300 in PortalRunSelect (portal=0x8f85530, forward=<value optimized out>, count=0, dest=0x8f97920) at
pquery.c:831
#8  0x081d6269 in PortalRun (portal=0x8f85530, count=2147483647, dest=0x8f97920, altdest=0x8f97920,
completionTag=0xbf9ba688"") at pquery.c:684
 
#9  0x081d1f40 in exec_simple_query (   query_string=0x8f64420 "select a.id, a.persona,
digest(to_char(fecha_nacimiento,'DDMMYYYY'), 'sha1') from auth.credential c join auth.agent a on (a.id = c.agent) join
persona.personap on (p.id = a.persona) where now() betw"...) at postgres.c:939
 
#10 0x081d3517 in PostgresMain (argc=4, argv=<value optimized out>, username=0x8efc540 "masm") at postgres.c:3424
#11 0x081aaf0e in ServerLoop () at postmaster.c:2931
#12 0x081abd0a in PostmasterMain (argc=3, argv=0x8ef95b8) at postmaster.c:963
#13 0x0816b3d0 in main (argc=3, argv=Cannot access memory at address 0x9
) at main.c:188
(gdb)

Please letme know if there is more information I can supply.

Regards,
Manuel.


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: SQL feature requests
Next
From: Manuel Sugawara
Date:
Subject: Re: Segmentation fault using digest from pg_crypto