BUG #14261: Hanged randomly in hash_seq_search

From: amdecreme(at)airfrance(dot)fr
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14261: Hanged randomly in hash_seq_search
Date: 2016-07-19 14:35:20
Message-ID: 20160719143520.7438.73745@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 14261
Logged by: Amaury Decreme
Email address: amdecreme(at)airfrance(dot)fr
PostgreSQL version: 9.4.1
Operating system: Red Hat Enterprise Linux Server release 6.6
Description:

Hello,

When I execute the following request around 10-50 times in a row, postgres
hangs randomly on the connection. New connections are still working.

The CPU peaks at 100% and the process needs to be SIGKILLed. SIGTERM is not
treated.

The request is:
SELECT * FROM MEASURE_FLAT_H
INNER JOIN (
SELECT max(dt) as dtmax FROM MEASURE_FLAT_H WHERE (ASSETS_NAME = ?) AND
(METRIC_NAME = ?)
) d ON (D.DTMAX = DT)
WHERE (ASSETS_NAME = ?) AND (METRIC_NAME = ?)

At this step, no lock is found in pg_locks.

The process can be found stuck in the hash_seq_search().

Call stack:
#0 0x000000000075e919 in hash_seq_search ()
#1 0x00007fd0af74fb2b in pgqs_entry_dealloc ()
from /tech/postgres/9.4.1/server/lib/pg_qualstats.so
#2 0x00007fd0af750a15 in pgqs_ExecutorEnd ()
from /tech/postgres/9.4.1/server/lib/pg_qualstats.so
#3 0x000000000055dade in PortalCleanup ()
#4 0x000000000077438a in PortalDrop ()
#5 0x000000000077472a in PreCommit_Portals ()
#6 0x00000000004b36ec in CommitTransaction ()
#7 0x00000000004b4ab5 in CommitTransactionCommand ()
#8 0x000000000067a269 in finish_xact_command ()
#9 0x000000000067d685 in PostgresMain ()
#10 0x000000000062c246 in PostmasterMain ()
#11 0x00000000005c4ab8 in main ()

Each time, I've seen the process looping infinitely from 75e910 to 75e927:
0x000000000075e910 <+96>: mov (%r9,%rcx,8),%rax
0x000000000075e914 <+100>: test %rax,%rax
0x000000000075e917 <+103>: jne 0x75e93c <hash_seq_search+140>
0x000000000075e919 <+105>: add $0x1,%edx
---Type <return> to continue, or q <return> to quit---
=> 0x000000000075e91c <+108>: cmp %edx,%esi
0x000000000075e91e <+110>: jb 0x75e958 <hash_seq_search+168>
0x000000000075e920 <+112>: add $0x1,%rcx
0x000000000075e924 <+116>: cmp %rcx,%r8
0x000000000075e927 <+119>: jg 0x75e910 <hash_seq_search+96>

(I know 9.4.1 is not the last minor release for 9.4 but I didn't find this
bug reported for the >=9.4 majors)

Do you have an idea of what is causing this strange issue ?

Best regards,

Amaury

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tomas Vondra 2016-07-19 16:22:13 Re: BUG #14231: logical replication wal sender process spins when using error traps in function
Previous Message David G. Johnston 2016-07-19 14:02:27 Re: BUG #14259: i want to store XML version in our table postgres table.