View Issue Details

IDProjectCategoryView StatusLast Update
0000063Pgpool-IIBugpublic2013-06-30 17:19
ReporterharukatAssigned Tot-ishii 
PriorityhighSeveritycrashReproducibilityalways
Status resolvedResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0000063: Child process was terminated by segmentation fault with memcached
DescriptionChild process was terminated by segmentation fault
when a client repeat a prepared statement execution
with large response.

Steps To ReproduceI can reproduce this issue in following condition.
   * pgpool-II 3.2 STABLE 2013/6/27 snapshot
   * PostgreSQL 9.1.9
   * JDBC client program (uploaded)

pgpool.conf:
  * backend0 only
  * memory_cache_enabled = on
  * memqcache_method = 'memcached'
  * memqcache_maxcache = 819200
Additional Informationupload
  * gstack
  * valgrid log
  * java reproduce program
TagsNo tags attached.

Activities

harukat

2013-06-27 21:21

developer  

pgpool2bugreport20130627.zip (8,566 bytes)

harukat

2013-06-28 11:34

developer   ~0000297

we can prevent this crash by the following fix.

$ diff -c ./pool_memqcache.c.ORG ./pool_memqcache.c
*** ./pool_memqcache.c.ORG 2013-06-28 11:31:51.397073076 +0900
--- ./pool_memqcache.c 2013-06-28 11:33:58.621054796 +0900
***************
*** 2622,2628 ****
                pool_discard_buffer(temp_cache->buffer);
        if (temp_cache->oids)
                pool_discard_buffer(temp_cache->oids);
! free(temp_cache);
  }

  /*
--- 2622,2628 ----
                pool_discard_buffer(temp_cache->buffer);
        if (temp_cache->oids)
                pool_discard_buffer(temp_cache->oids);
! // free(temp_cache); // insincere temporary fix
  }

  /*

harukat

2013-06-28 11:49

developer   ~0000298

a little more proper fix.


$ diff -c pool_memqcache.c.ORG .
/pool_memqcache.c
*** pool_memqcache.c.ORG 2013-06-28 11:31:51.397073076 +0900
--- ./pool_memqcache.c 2013-06-28 11:49:34.924047711 +0900
***************
*** 2965,2970 ****
--- 2965,2973 ----

                                cache = pool_get_current_cache();
                                pool_discard_temp_query_cache(cache);
+ if (cache) {
+ session_context->query_context->temp_cache = NULL;
+ } // more proper fix
                        }
                        /*
                         * Otherwise add to the temp cache array.

t-ishii

2013-06-30 17:18

developer   ~0000299

Thanks for the test case. It seems the segfault occurs when:
- extended protocol mode
- query cache is not created because the SELECT results are tool large
- same portal(prepared statement) is used

Fix committed in master and 3.2-stable tree.

Issue History

Date Modified Username Field Change
2013-06-27 21:21 harukat New Issue
2013-06-27 21:21 harukat File Added: pgpool2bugreport20130627.zip
2013-06-28 11:34 harukat Note Added: 0000297
2013-06-28 11:49 harukat Note Added: 0000298
2013-06-28 12:57 t-ishii Assigned To => t-ishii
2013-06-28 12:57 t-ishii Status new => assigned
2013-06-30 17:18 t-ishii Note Added: 0000299
2013-06-30 17:19 t-ishii Status assigned => resolved