Thread: Bug #855: pg_dump crash on linux-xfs
Ruslan V Lopation (lrv@ufps.tomsk.su) reports a bug with a severity of 3 The lower the number the more severe it is. Short Description pg_dump crash on linux-xfs Long Description pg_dump crashes with PostgreSQL 7.3(1) server installed on Linux-2.4.20(2.4.19) with XFS patches from ftp://oss.sgi.com/projects/xfs/download/patches/2.4.20/xfs-2.4.20-all-i386.bz2(and earlier patches) with ACLs and DMAPI enabledwhen pg_dump is used with compression enabled: [linux-xfs-host]$ pg_dump db -Fc -f dump Segmentation fault (core dumped) [linux-no-xfs-host]$ pg_dump -h linux-xfs-host db -Fc -f dump Segmentation fault (core dumped) ...and dump file contains only structure, no data. I tried moving database from XFS to reiser partition and it still crashes. Running pg_dump with database on server that's running vanilla 2.4.20 doesn't crash. [linux-no-xfs-host]$ pg_dump db2 -Fc -f dump2 works fine. PostgreSQL 7.2.x works fine. Sample Code No file was uploaded with this report
pgsql-bugs@postgresql.org writes: > [linux-xfs-host]$ pg_dump db -Fc -f dump > Segmentation fault (core dumped) Can you provide a stack trace from the core file? It would also be useful to see the last few SQL commands issued by pg_dump --- easiest way to do this is enable query logging via export PGOPTIONS="-c log_statement=1" before running pg_dump, and then look in the postmaster log. regards, tom lane
"Ruslan V. Lopatin" <lrv@ufps.tomsk.su> writes: > Program received signal SIGSEGV, Segmentation fault. > 0x402d3557 in strlen () from /lib/libc.so.6 > (gdb) bt > #0 0x402d3557 in strlen () from /lib/libc.so.6 > #1 0x08056ddc in WriteStr (AH=0x806c808, c=0x6c627570 "") > at pg_backup_archiver.c:1519 > #2 0x0805752a in WriteToc (AH=0x806c808) at > pg_backup_archiver.c:1851 > #3 0x0805a2ce in _CloseArchive (AH=0x806c808) at > pg_backup_custom.c:802 Ohh ... I see the problem. It is this misguided effort at avoiding memory leaks: if (commentDeps) { for (j = 0; (*commentDeps)[j] != NULL; j++) free((void *) (*commentDeps)[j]); free(commentDeps); } (about line 5447 of pg_dump.c; added in rev 1.268 of 2-Jul-02). This is freeing the dependency data that the archive entry needs :-( regards, tom lane