Thread: initdb - segmentation fault
Hello all, I am trying to do an initdb and keep getting a segmentation fault during the "Vacuuming database" portion of the initdb script. I am running PostgreSQL 7.1.3 on RedHat 7.1. I have the following rpm's installed: postgresql-libs-7.1.3-1PGDG postgresql-7.1.3-1PGDG postgresql-server-7.1.3-1PGDG postgresql-devel-7.1.3-1PGDG Here is the output of the initdb - [postgres@huma pgsql]$ initdb This database system will be initialized with username "postgres". This user will own all the data files and must also own the server process. Fixing permissions on existing directory /var/lib/pgsql/data Creating directory /var/lib/pgsql/data/base Creating directory /var/lib/pgsql/data/global Creating directory /var/lib/pgsql/data/pg_xlog Creating template1 database in /var/lib/pgsql/data/base/1 NOTICE: Initializing database with en_US collation order. This locale setting will prevent use of index optimization for LIKE and regexp searches. If you are concerned about speed of such queries, you may wish to set LC_COLLATE to "C" and re-initdb. For more information see the Administrator's Guide. DEBUG: database system was shut down at 2002-02-11 09:02:47 EST DEBUG: CheckPoint record at (0, 8) DEBUG: Redo record at (0, 8); Undo record at (0, 8); Shutdown TRUE DEBUG: NextTransactionId: 514; NextOid: 16384 DEBUG: database system is in production state Creating global relations in /var/lib/pgsql/data/global DEBUG: database system was shut down at 2002-02-11 09:02:54 EST DEBUG: CheckPoint record at (0, 108) DEBUG: Redo record at (0, 108); Undo record at (0, 0); Shutdown TRUE DEBUG: NextTransactionId: 514; NextOid: 17199 DEBUG: database system is in production state Initializing pg_shadow. Enabling unlimited row width for system tables. Creating system views. Loading pg_description. Setting lastsysoid. Vacuuming database. /usr/bin/initdb: line 635: 16757 Done echo "VACUUM ANALYZE" 16758 Segmentation fault (core dumped) | "$PGPATH"/postgres $PGSQL_OPT template1 >/dev/null initdb failed. Removing temp file /tmp/initdb.16677. [postgres@huma pgsql]$ Here is my postgres user .bash_profile - [postgres@huma postgres]$ cat .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin BASH_ENV=$HOME/.bashrc PGLIB=/usr/lib PGDATA=/var/lib/pgsql/data USERNAME="" export USERNAME BASH_ENV PATH PGLIB PGDATA # DoubleVision's terminal type collector ... [ -x /bin/termtype ] && /bin/termtype [postgres@huma postgres]$ And here is the output from gdb on the core dumped by initdb... this core was dumped in the $PGDATA/base/1 directory - [postgres@huma pgsql]$ cat gdb.out GNU gdb 5.0rh-5 Red Hat Linux 7.1 Copyright 2001 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 "ipostgresql-libs-7.1.3-1PGDG386-redhat-linux"...=postgres: No such file or directory. Core was generated by `/usr/bin/postgres -o /dev/null -O -F -D/var/lib/pgsql/data template1'. Program terminated with signal 11, Segmentation fault. #0 0x402b66b9 in ?? () (gdb) quit [postgres@huma pgsql]$ If anyone can help me out and let me know what is going, I would greatly appreciate it as a major project depends on the completion on this dbase installation. Thanks in advance, Bradley Brown
Bradley Brown <bradley@segrestfarms.com> writes: > [ initdb crashes on RHL 7.1 ] Curious. Can you think of anything at all that's unusual about your installation? You're surely not the first to use these RPMs on RHL 7.1, so there must be something out of the ordinary. > Core was generated by `/usr/bin/postgres -o /dev/null -O -F > -D/var/lib/pgsql/data template1'. > Program terminated with signal 11, Segmentation fault. > #0 0x402b66b9 in ?? () > (gdb) quit This is quite unhelpful --- but a backtrace (bt) might tell something. regards, tom lane
Tom, Thanks for your comments. I cannot think of anything that might be out of the ordinary on this machine. I did the install of the RHL 7.1 myself. I also did the install of the rpms myself and encountered no problems or errors. I am including the backtrace form the gdb on the core produced my initdb. Thanks again for your help. Bradley Brown gdb output with backtrace - [postgres@huma 1]$ cat gdb.out GNU gdb 5.0rh-5 Red Hat Linux 7.1 Copyright 2001 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"..."/usr/bin/initdb": not in executable format: File format not recognized Core was generated by `/usr/bin/postgres -o /dev/null -O -F -D/var/lib/pgsql/data template1'. Program terminated with signal 11, Segmentation fault. #0 0x402b66b9 in ?? () (gdb) bt #0 0x402b66b9 in ?? () #1 0x4001cdcf in ?? () #2 0x4001d80b in ?? () #3 0x4001d432 in ?? () #4 0x080ff565 in ?? () #5 0x081062ba in ?? () #6 0x08106259 in ?? () #7 0x081070e9 in ?? () #8 0x08144364 in ?? () #9 0x081446b6 in ?? () #10 0x08144838 in ?? () #11 0x08101518 in ?? () #12 0x08142a15 in ?? () #13 0x0808195b in ?? () #14 0x08081c55 in ?? () #15 0x080b35a4 in ?? () #16 0x080afe06 in ?? () #17 0x080afd57 in ?? () #18 0x0810aaea in ?? () #19 0x081087ab in ?? () #20 0x081098ee in ?? () #21 0x080cfaf4 in ?? () #22 0x4025b177 in ?? () (gdb) quit [postgres@huma 1]$ Tom Lane wrote: > Bradley Brown <bradley@segrestfarms.com> writes: > > [ initdb crashes on RHL 7.1 ] > > Curious. Can you think of anything at all that's unusual about your > installation? You're surely not the first to use these RPMs on RHL 7.1, > so there must be something out of the ordinary. > > > Core was generated by `/usr/bin/postgres -o /dev/null -O -F > > -D/var/lib/pgsql/data template1'. > > Program terminated with signal 11, Segmentation fault. > > #0 0x402b66b9 in ?? () > > (gdb) quit > > This is quite unhelpful --- but a backtrace (bt) might tell something. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster
Bradley Brown <bradley@segrestfarms.com> writes: > I am including the backtrace form the gdb on the core produced my > initdb. Drat. I was hoping for some symbolic information --- but it looks like the RPMs you are using have been stripped of all debug symbols. One possibility, though I never before heard of it causing a crash in initdb, is that there's a known bug in strcoll() in some versions of glibc, which does cause crashes during VACUUM ANALYZE if the right data pattern crops up. I think that a never-updated copy of RHL 7.1 might have the buggy version of strcoll(). Try updating to the latest glibc available for RHL 7.1 and see if it helps. regards, tom lane