BUG #3763: crash after create table with primary key defined

Started by migoover 18 years ago7 messagesbugs
Jump to latest
#1migo
admin@abp.pl

The following bug has been logged online:

Bug reference: 3763
Logged by: migo
Email address: admin@abp.pl
PostgreSQL version: 8.2.4
Operating system: Gentoo
Description: crash after create table with primary key defined
Details:

On psql console:

=> CREATE TABLE phpbb_acl_roles_data ( role_id INT4 DEFAULT '0' NOT NULL
CHECK (role_id >= 0), auth_option_id INT4 DEFAULT '0' NOT NULL CHECK
(auth_option_id >= 0), auth_setting INT2 DEFAULT '0' NOT NULL, PRIMARY KEY
(role_id, auth_option_id) );
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
wolni=>

In logs after this:
Nov 20 11:02:04 www postgres[32757]: [4-1] wolni>NOTICE: CREATE TABLE /
PRIMARY KEY will create implicit index "phpbb_acl_roles_data_pkey" for
table
Nov 20 11:02:04 www postgres[32757]: [4-2] "phpbb_acl_roles_data"
Nov 20 11:02:04 www postgres[32758]: [2-1] [unknown]>LOG: connection
received: host=[local]
Nov 20 11:02:04 www postgres[32758]: [3-1] wolni>LOG: connection
authorized: user=wolni database=wolni
Nov 20 11:02:04 www postgres[32731]: [2-1] >LOG: server process (PID 32757)
was terminated by signal 11
Nov 20 11:02:04 www postgres[32731]: [3-1] >LOG: terminating any other
active server processes
Nov 20 11:02:04 www postgres[32758]: [4-1] wolni>WARNING: terminating
connection because of crash of another server process
Nov 20 11:02:04 www postgres[32758]: [4-2] wolni>DETAIL: The postmaster has
commanded this server process to roll back the current transaction and exit,
because another
Nov 20 11:02:04 www postgres[32758]: [4-3] server process exited abnormally
and possibly corrupted shared memory.
Nov 20 11:02:04 www postgres[32758]: [4-4] wolni>HINT: In a moment you
should be able to reconnect to the database and repeat your command.
Nov 20 11:02:04 www postgres[32731]: [4-1] >LOG: all server processes
terminated; reinitializing
Nov 20 11:02:04 www postgres[32759]: [5-1] >LOG: database system was
interrupted at 2007-11-20 11:01:46 CET
Nov 20 11:02:04 www postgres[32759]: [6-1] >LOG: checkpoint record is at
0/F5FBD7FC
Nov 20 11:02:04 www postgres[32759]: [7-1] >LOG: redo record is at
0/F5FBD7FC; undo record is at 0/0; shutdown TRUE
Nov 20 11:02:04 www postgres[32759]: [8-1] >LOG: next transaction ID:
0/2321145; next OID: 206248
Nov 20 11:02:04 www postgres[32759]: [9-1] >LOG: next MultiXactId: 1; next
MultiXactOffset: 0
Nov 20 11:02:04 www postgres[32759]: [10-1] >LOG: database system was not
properly shut down; automatic recovery in progress
Nov 20 11:02:04 www postgres[32759]: [11-1] >LOG: redo starts at
0/F5FBD844
Nov 20 11:02:04 www postgres[32759]: [12-1] >LOG: unexpected pageaddr
0/F0FD4000 in log file 0, segment 245, offset 16596992
Nov 20 11:02:04 www postgres[32759]: [13-1] >LOG: redo done at 0/F5FD3194
Nov 20 11:02:05 www postgres[32759]: [14-1] >LOG: database system is ready

What's wrong?

#2Simon Riggs
simon@2ndQuadrant.com
In reply to: migo (#1)
Re: BUG #3763: crash after create table with primary key defined

On Tue, 2007-11-20 at 10:12 +0000, migo wrote:

The following bug has been logged online:

Bug reference: 3763
Logged by: migo
Email address: admin@abp.pl
PostgreSQL version: 8.2.4
Operating system: Gentoo
Description: crash after create table with primary key defined
Details:

On psql console:

=> CREATE TABLE phpbb_acl_roles_data ( role_id INT4 DEFAULT '0' NOT NULL
CHECK (role_id >= 0), auth_option_id INT4 DEFAULT '0' NOT NULL CHECK
(auth_option_id >= 0), auth_setting INT2 DEFAULT '0' NOT NULL, PRIMARY KEY
(role_id, auth_option_id) );
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
wolni=>

In logs after this:
Nov 20 11:02:04 www postgres[32757]: [4-1] wolni>NOTICE: CREATE TABLE /
PRIMARY KEY will create implicit index "phpbb_acl_roles_data_pkey" for
table
Nov 20 11:02:04 www postgres[32757]: [4-2] "phpbb_acl_roles_data"
Nov 20 11:02:04 www postgres[32758]: [2-1] [unknown]>LOG: connection
received: host=[local]
Nov 20 11:02:04 www postgres[32758]: [3-1] wolni>LOG: connection
authorized: user=wolni database=wolni
Nov 20 11:02:04 www postgres[32731]: [2-1] >LOG: server process (PID 32757)
was terminated by signal 11
Nov 20 11:02:04 www postgres[32731]: [3-1] >LOG: terminating any other
active server processes
Nov 20 11:02:04 www postgres[32758]: [4-1] wolni>WARNING: terminating
connection because of crash of another server process

Looks to me that the process that crashed was not the process that
issued the CREATE TABLE command. So it could be something else entirely.

Is this behaviour repeatable?

--
Simon Riggs
2ndQuadrant http://www.2ndQuadrant.com

#3migo
admin@abp.pl
In reply to: migo (#1)
Re: BUG #3763: crash after create table with primary key defined

Dnia Wt Listopada 20 2007, 12:12, Simon Riggs napisaďż˝(a):

On Tue, 2007-11-20 at 10:12 +0000, migo wrote:

The following bug has been logged online:

Bug reference: 3763
Logged by: migo
Email address: admin@abp.pl
PostgreSQL version: 8.2.4
Operating system: Gentoo
Description: crash after create table with primary key defined
Details:

On psql console:

=> CREATE TABLE phpbb_acl_roles_data ( role_id INT4 DEFAULT '0' NOT
NULL
CHECK (role_id >= 0), auth_option_id INT4 DEFAULT '0' NOT NULL CHECK
(auth_option_id >= 0), auth_setting INT2 DEFAULT '0' NOT NULL, PRIMARY
KEY
(role_id, auth_option_id) );
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
wolni=>

In logs after this:
Nov 20 11:02:04 www postgres[32757]: [4-1] wolni>NOTICE: CREATE TABLE /
PRIMARY KEY will create implicit index "phpbb_acl_roles_data_pkey" for
table
Nov 20 11:02:04 www postgres[32757]: [4-2] "phpbb_acl_roles_data"
Nov 20 11:02:04 www postgres[32758]: [2-1] [unknown]>LOG: connection
received: host=[local]
Nov 20 11:02:04 www postgres[32758]: [3-1] wolni>LOG: connection
authorized: user=wolni database=wolni
Nov 20 11:02:04 www postgres[32731]: [2-1] >LOG: server process (PID
32757)
was terminated by signal 11
Nov 20 11:02:04 www postgres[32731]: [3-1] >LOG: terminating any other
active server processes
Nov 20 11:02:04 www postgres[32758]: [4-1] wolni>WARNING: terminating
connection because of crash of another server process

Looks to me that the process that crashed was not the process that
issued the CREATE TABLE command. So it could be something else entirely.

Is this behaviour repeatable?

Yes, when i type this create table command allways postgresql crashes in
that same way.

Its strange that when i modify this command to:
"CREATE TABLE phpbb_acl_roles_data ( role_id INT4 DEFAULT '0' NOT
NULL CHECK (role_id >= 0), auth_option_id INT4 DEFAULT '0' NOT NULL CHECK
(auth_option_id >= 0), auth_setting INT2 DEFAULT '0' NOT NULL );"
(PRIMARY KEY option cuted off) query works fine.

Regards,
--
Tomasz

#4Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Simon Riggs (#2)
Re: BUG #3763: crash after create table with primary keydefined

Simon Riggs wrote:

On Tue, 2007-11-20 at 10:12 +0000, migo wrote:

=> CREATE TABLE phpbb_acl_roles_data ( role_id INT4 DEFAULT '0' NOT NULL
CHECK (role_id >= 0), auth_option_id INT4 DEFAULT '0' NOT NULL CHECK
(auth_option_id >= 0), auth_setting INT2 DEFAULT '0' NOT NULL, PRIMARY KEY
(role_id, auth_option_id) );
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
wolni=>

In logs after this:
Nov 20 11:02:04 www postgres[32757]: [4-1] wolni>NOTICE: CREATE TABLE /
PRIMARY KEY will create implicit index "phpbb_acl_roles_data_pkey" for
table
Nov 20 11:02:04 www postgres[32757]: [4-2] "phpbb_acl_roles_data"
Nov 20 11:02:04 www postgres[32758]: [2-1] [unknown]>LOG: connection
received: host=[local]
Nov 20 11:02:04 www postgres[32758]: [3-1] wolni>LOG: connection
authorized: user=wolni database=wolni
Nov 20 11:02:04 www postgres[32731]: [2-1] >LOG: server process (PID 32757)
was terminated by signal 11
Nov 20 11:02:04 www postgres[32731]: [3-1] >LOG: terminating any other
active server processes
Nov 20 11:02:04 www postgres[32758]: [4-1] wolni>WARNING: terminating
connection because of crash of another server process

Looks to me that the process that crashed was not the process that
issued the CREATE TABLE command. So it could be something else entirely.

To me it does look like it was the CREATE TABLE that crashed. The NOTICE
shows that it's process ID 32757 that's running the CREATE TABLE, and
the LOG line later on says that that's the process that crashed.

Is this behaviour repeatable?

I couldn't reproduce this on my laptop with 8.2.4. Migo, is it possible
for you to get a core dump and a back trace out of it? Is there anything
unusual about the system / compiler / compiler options used?

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

#5Simon Riggs
simon@2ndQuadrant.com
In reply to: Heikki Linnakangas (#4)
Re: BUG #3763: crash after create table with primary keydefined

On Tue, 2007-11-20 at 11:46 +0000, Heikki Linnakangas wrote:

In logs after this:
Nov 20 11:02:04 www postgres[32757]: [4-1] wolni>NOTICE: CREATE TABLE /
PRIMARY KEY will create implicit index "phpbb_acl_roles_data_pkey" for
table

Nov 20 11:02:04 www postgres[32731]: [2-1] >LOG: server process (PID 32757)
was terminated by signal 11

To me it does look like it was the CREATE TABLE that crashed. The NOTICE
shows that it's process ID 32757 that's running the CREATE TABLE, and
the LOG line later on says that that's the process that crashed.

Yep, agreed. :-(

--
Simon Riggs
2ndQuadrant http://www.2ndQuadrant.com

#6migo
admin@abp.pl
In reply to: Heikki Linnakangas (#4)
Re: BUG #3763: crash after create table with primary keydefined

Dnia Wt Listopada 20 2007, 14:20, Simon Riggs napisaďż˝(a):

On Tue, 2007-11-20 at 11:46 +0000, Heikki Linnakangas wrote:

In logs after this:
Nov 20 11:02:04 www postgres[32757]: [4-1] wolni>NOTICE: CREATE

TABLE /

PRIMARY KEY will create implicit index "phpbb_acl_roles_data_pkey"

for

table

Nov 20 11:02:04 www postgres[32731]: [2-1] >LOG: server process (PID

32757)

was terminated by signal 11

To me it does look like it was the CREATE TABLE that crashed. The NOTICE
shows that it's process ID 32757 that's running the CREATE TABLE, and
the LOG line later on says that that's the process that crashed.

Yep, agreed. :-(

OK so what we can do now?

Regards,
--
Tomasz

#7Zdenek Kotala
Zdenek.Kotala@Sun.COM
In reply to: migo (#6)
Re: BUG #3763: crash after create table with primary keydefined

admin@abp.pl wrote:

Dnia Wt Listopada 20 2007, 14:20, Simon Riggs napisaďż˝(a):

On Tue, 2007-11-20 at 11:46 +0000, Heikki Linnakangas wrote:

In logs after this:
Nov 20 11:02:04 www postgres[32757]: [4-1] wolni>NOTICE: CREATE

TABLE /

PRIMARY KEY will create implicit index "phpbb_acl_roles_data_pkey"

for

table
Nov 20 11:02:04 www postgres[32731]: [2-1] >LOG: server process (PID

32757)

was terminated by signal 11

To me it does look like it was the CREATE TABLE that crashed. The NOTICE
shows that it's process ID 32757 that's running the CREATE TABLE, and
the LOG line later on says that that's the process that crashed.

Yep, agreed. :-(

OK so what we can do now?

Do you have core file? It is usually stored in data postgreSQL
directory. Can you provide stack trace to determine which function
fails? It is very important.

what's happen when you create primary key by alter table command?

what's happen when you create unique index on (role_id, auth_option_id)?

Is it fresh database? Can you reproduce it on the same machine with the
same postgreSQL installation on new created database cluster?

Zdenek