pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #6065: FATAL: lock 0 not held
2+ messages / 2 participants
[nested] [flat]

* BUG #6065: FATAL: lock 0 not held
@ 2011-06-17 07:56 Ben <bwtest24@yahoo.com>
  2011-06-17 14:28 ` Re: BUG #6065: FATAL: lock 0 not held Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Ben @ 2011-06-17 07:56 UTC (permalink / raw)
  To: pgsql-bugs


The following bug has been logged online:

Bug reference:      6065
Logged by:          Ben
Email address:      bwtest24@yahoo.com
PostgreSQL version: 9.0.4
Operating system:   üLinux version 2.6.21-uc0 on ARM processor
(NXP-LPC2478)
Description:        FATAL: lock 0 not held
Details: 

while initialising with initdb, after creating and filling new WAL file.
We see LWLockAcquire(11) followed by LWLockRelease(0) and then a FATAL: 
lock 0 is not held.

Don't know if this is a problem due to misconfiguration or an actual bug,
but I though lets ask the experts. Please let me know I you need any
additional information.

Thanx in advance!

Ben...

output of: /usr/local/bin/initdb -d -D /mnt/nand/data
Running in debug mode.
VERSION=9.0.4
PGDATA=/mnt/nand/data
share_path=/usr/local/share/postgresql
PGPATH=/usr/local/bin
POSTGRES_SUPERUSERNAME=guest
POSTGRES_BKI=/usr/local/share/postgresql/postgres.bki
POSTGRES_DESCR=/usr/local/share/postgresql/postgres.description
POSTGRES_SHDESCR=/usr/local/share/postgresql/postgres.shdescription
POSTGRESQL_CONF_SAMPLE=/usr/local/share/postgresql/postgresql.conf.sample
PG_HBA_SAMPLE=/usr/local/share/postgresql/pg_hba.conf.sample
PG_IDENT_SAMPLE=/usr/local/share/postgresql/pg_ident.conf.sample
The files belonging to this database system will be owned by user "guest".
This user must also own the server process.

The database cluster will be initialized with locale C.
The default database encoding has accordingly been set to SQL_ASCII.
The default text search configuration will be set to "english".

creating directory /mnt/nand/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 30
selecting default shared_buffers ... 2400kB
creating configuration files ... ok
creating template1 database in /mnt/nand/data/base/1 ... DEBUG:  invoking
IpcMemoryCreate(size=4063232)
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(1): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(1): excl 1 shared 0 head (nil) rOK 1
DEBUG:  removing file "pg_notify/0000"
LOG:  LWLockAcquire(26): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(724): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(26): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(26): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(724): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(26): excl 1 shared 0 head (nil) rOK 1
LOG:  LWLockAcquire(3): excl 0 shared 0 head (nil) rOK 1
LOG:  LWLockRelease(3): excl 1 shared 0 head (nil) rOK 1
DEBUG:  transaction ID wrap limit is 2147483650, limited by database with
OID 1
DEBUG:  creating and filling new WAL file
DEBUG:  done creating and filling new WAL file
LOG:  LWLockAcquire(11): excl 0 shared 0 head (nil) rOK 0
LOG:  LWLockRelease(0): excl 0 shared 0 head (nil) rOK 0
FATAL:  lock 0 is not held
DEBUG:  shmem_exit(1): 3 callbacks to make
DEBUG:  proc_exit(1): 3 callbacks to make
DEBUG:  exit(1)
DEBUG:  shmem_exit(-1): 0 callbacks to make
DEBUG:  proc_exit(-1): 0 callbacks to make
child process exited with exit code 1
initdb: removing data directory "/mnt/nand/data"




additional info:
#define LOCK_DEBUG 1 (src/include/pg_config_manual.h line: 200)

bool Trace_lwlocks=true; (src/backend/storage/lmgr/lwlock.c line: 100)

./configure --without-readline --enable-thread-safety --host=arm-linux
--build=i686-pc-linux-gnu --with-libraries=/home/ben/uClinux-dist/lib
--with-includes=/home/ben/uClinux-dist/lib/zlib
CC='/home/ben/uClinux-dist/tools/ucfront-gcc arm-elf-gcc -march=armv4t
-mtune=arm7tdmi' CFLAGS='-Os -fomit-frame-pointer -pipe -msoft-float
-fno-common -fno-builtin -Wall -DEMBED -Dlinux -D__linux__ -Dunix
-D__uClinux__ -fno-inline' CPP='/home/ben/uClinux-dist/tools/ucfront-gcc
arm-elf-gcc -march=armv4t -mtune=arm7tdmi -E' CPPFLAGS=' -I.. '
LDFLAGS='-Wl,--fatal-warnings -Wl,-elf2flt -msoft-float -Wl,--fatal-warnings
-Wl,-elf2flt -msoft-float' --prefix=/home/ben/uClinux-dist/romfs/usr/local
--disable-shared



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #6065: FATAL: lock 0 not held
  2011-06-17 07:56 BUG #6065: FATAL: lock 0 not held Ben <bwtest24@yahoo.com>
@ 2011-06-17 14:28 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2011-06-17 14:28 UTC (permalink / raw)
  To: Ben <bwtest24@yahoo.com>; +Cc: pgsql-bugs

"Ben" <bwtest24@yahoo.com> writes:
> Operating system:   üLinux version 2.6.21-uc0 on ARM processor
> (NXP-LPC2478)
> Description:        FATAL: lock 0 not held
> Details: 

> while initialising with initdb, after creating and filling new WAL file.
> We see LWLockAcquire(11) followed by LWLockRelease(0) and then a FATAL: 
> lock 0 is not held.

Compiler bug?  It's pretty hard to credit that you've found some new
code path through bootstrap where the wrong lock number gets frobbed.

We do have at least one buildfarm member running on ARM, so that
architecture does get tested regularly, which eliminates various
other theories about PG portability problems.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2011-06-17 14:28 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-06-17 07:56 BUG #6065: FATAL: lock 0 not held Ben <bwtest24@yahoo.com>
2011-06-17 14:28 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox