View Issue Details

IDProjectCategoryView StatusLast Update
0000301Pgpool-IIBugpublic2017-08-15 15:28
ReportergileswAssigned Tot-ishii 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionopen 
PlatformOSLinuxOS VersionTrusty
Product Version3.6.2 
Target VersionFixed in Version 
Summary0000301: Segfault when memcached is enabled in 3.6.2-1.pgdg14.04+1
DescriptionWhen enabling memcached in the most recent version of pgpool2 in pgdg a segfault occurs. I have tested the same configuration with the previous version and it runs fine. (pgpool2 3.5.4-1.pgdg12.4+1)

Steps To Reproduce...
memory_cache_enabled = on
memqcache_method = 'memcached'
...

sudo /etc/init.d/pgpool2 restart


psql -U xxxx -h localhost -p 5432 postgres -c 'show pool_cache;' -x


server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.
connection to server was lost

Additional InformationApr 18 00:26:18 devbld01v pgpool: 2017-04-18 00:26:18: pid 9050: LOG: Setting up socket for 0.0.0.0:5432
Apr 18 00:26:18 devbld01v pgpool: 2017-04-18 00:26:18: pid 9050: LOG: Setting up socket for :::5432
Apr 18 00:26:18 devbld01v pgpool: 2017-04-18 00:26:18: pid 9050: LOG: pgpool-II successfully started. version 3.6.2 (subaruboshi)
Apr 18 00:26:33 devbld01v pgpool: 2017-04-18 00:26:33: pid 9050: WARNING: child process with pid: 9156 was terminated by segmentation fault
Apr 18 00:26:33 devbld01v pgpool: 2017-04-18 00:26:33: pid 9050: LOG: fork a new child process with pid: 9168
Apr 18 00:26:33 devbld01v kernel: [17582182.327442] pgpool[9156]: segfault at 0 ip 000000000043a4ab sp 00007fff87c5daf8 error 4 in pgpool[400000+13d000]

TagsNo tags attached.

Activities

t-ishii

2017-04-18 08:49

developer   ~0001430

Not reproduced here. Mine is built from source code on Ubuntu 16.04.

t-ishii@localhost: psql -p 11000 postgres -c 'show pool_cache;' -x
Pager usage is off.
-[ RECORD 1 ]---------------+-----
num_cache_hits | 2
num_selects | 999
cache_hit_ratio | 0.00
num_hash_entries | 0
used_hash_entries | 0
num_cache_entries | 0
used_cache_entries_size | 0
free_cache_entries_size | 0
fragment_cache_entries_size | 0

gilesw

2017-04-18 09:12

reporter   ~0001431

memqcache_method = 'shmem' is fine.

gilesw

2017-04-18 09:16

reporter   ~0001432

Hi t-ishil, I wouldn't expect it to be reproducible from source. I suspect it is a build issue with the pgdg release. I tried running it in a non-daemonize mode but the segfault happens in a child process. Any tips on how I can get a gdb dump out of this pgdg release?

t-ishii

2017-04-18 10:21

developer   ~0001433

Oh ok, testing memqcahce_method = 'memcached'...

It turns out that someone broke 'show pool_cache;' in 3.6 when memcached is used :-<. Attached is the one-line fix for the problem.

t-ishii

2017-04-18 10:22

developer  

query-cache-fix.patch (547 bytes)
diff --git a/src/query_cache/pool_memqcache.c b/src/query_cache/pool_memqcache.c
index 1b60ef4..fdef8c1 100644
--- a/src/query_cache/pool_memqcache.c
+++ b/src/query_cache/pool_memqcache.c
@@ -3890,7 +3890,7 @@ POOL_SHMEM_STATS *pool_get_shmem_storage_stats(void)
 	mystats.cache_stats.num_selects = stats->num_selects;
 	mystats.cache_stats.num_cache_hits = stats->num_cache_hits;
 
-	if (pool_config->memqcache_method == SHMEM_CACHE)
+	if (pool_config->memqcache_method != SHMEM_CACHE)
 		return &mystats;
 
 	/* number of total hash entries */
query-cache-fix.patch (547 bytes)

t-ishii

2017-08-15 15:27

developer   ~0001659

No feedback from the reporter over 1 month. Issue closed.

Issue History

Date Modified Username Field Change
2017-04-18 08:30 gilesw New Issue
2017-04-18 08:48 t-ishii Assigned To => t-ishii
2017-04-18 08:48 t-ishii Status new => feedback
2017-04-18 08:49 t-ishii Note Added: 0001430
2017-04-18 09:12 gilesw Note Added: 0001431
2017-04-18 09:12 gilesw Status feedback => assigned
2017-04-18 09:16 gilesw Note Added: 0001432
2017-04-18 10:21 t-ishii Note Added: 0001433
2017-04-18 10:22 t-ishii File Added: query-cache-fix.patch
2017-04-18 10:33 t-ishii Status assigned => feedback
2017-08-15 15:27 t-ishii Note Added: 0001659
2017-08-15 15:28 t-ishii Status feedback => closed