View Issue Details

IDProjectCategoryView StatusLast Update
0000434Pgpool-IIBugpublic2018-10-23 18:19
ReporternagataAssigned Tohoshiai 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version4.0 RC1 
Target VersionFixed in Version 
Summary0000434: Segmentation fault due to a query error and Sync messages in native replication mode
DescriptionIn native replication mode, segmentation fault occurs when Sync messages is sent just after query error.

We can reproduce this using pgproto:

  'Q' "select 1 from not_existing_table"
  'S'
  'Y'
  'X'

In log messages:


2018-10-11 21:10:13: pid 31627: LOG: DB node id: 0 backend pid: 19770 statement: select 1 from not_existing_table
2018-10-11 21:10:13: pid 31627: LOG: pool_send_and_wait: Error or notice message from backend: : DB node id: 0 backend pid: 19770 statement: "select 1 from not_existing_table" message: "relation "not_existing_table" does not exist"
2018-10-11 21:10:14: pid 31605: WARNING: child process with pid: 31627 was terminated by segmentation fault
2018-10-11 21:10:14: pid 31605: LOG: fork a new child process with pid: 19789
TagsNo tags attached.

Activities

hoshiai

2018-10-12 10:10

developer   ~0002194

Thank you for report. I confirm this problem.

hoshiai

2018-10-17 12:07

developer  

bug434.patch (657 bytes)
 src/protocol/pool_proto_modules.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/protocol/pool_proto_modules.c b/src/protocol/pool_proto_modules.c
index 426aa95..bf4ca87 100644
--- a/src/protocol/pool_proto_modules.c
+++ b/src/protocol/pool_proto_modules.c
@@ -1999,6 +1999,7 @@ ReadyForQuery(POOL_CONNECTION * frontend,
 		else
 		{
 			if ((pool_is_doing_extended_query_message() &&
+				 session_context->query_context &&
 				 session_context->query_context->query_state[MASTER_NODE_ID] != POOL_UNPARSED &&
 				 session_context->uncompleted_message) ||
 				(!pool_is_doing_extended_query_message() && session_context->uncompleted_message &&
bug434.patch (657 bytes)

hoshiai

2018-10-17 12:07

developer   ~0002206

This problem happend that send Sync message with no query in native replication mode.
Pgpool-II try to refer query information that does not existed, so happen segment fault.

I created a patch that check whether query exist in advance.I confirmed that don't happend segment fault.

nagata

2018-10-19 13:56

developer   ~0002220

I also confirmed the problem is resolved with your patch.

Issue History

Date Modified Username Field Change
2018-10-11 21:11 nagata New Issue
2018-10-12 10:07 hoshiai Assigned To => hoshiai
2018-10-12 10:07 hoshiai Status new => assigned
2018-10-12 10:10 hoshiai Note Added: 0002194
2018-10-17 12:07 hoshiai File Added: bug434.patch
2018-10-17 12:07 hoshiai Note Added: 0002206
2018-10-17 12:08 hoshiai Status assigned => confirmed
2018-10-19 13:56 nagata Note Added: 0002220
2018-10-23 18:19 hoshiai Status confirmed => resolved
2018-10-23 18:19 hoshiai Resolution open => fixed