View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000565 | Pgpool-II | Bug | public | 2019-12-10 15:47 | 2020-03-06 14:56 |
| Reporter | hoshiai | Assigned To | t-ishii | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | open | ||
| Product Version | 4.1.0 | ||||
| Target Version | 4.1.1 | Fixed in Version | 4.1.1 | ||
| Summary | 0000565: Segmentation falut happend by worker process | ||||
| Description | If apllication_name of standby's replication worker is ''(empty string), worker process of pgpool causes segment fault and this worker resatrt many times. pgpool.log is : 2019-12-10 15:37:03: pid 16868: WARNING: worker child process with pid: 18230 was terminated by segmentation fault 2019-12-10 15:37:03: pid 16868: LOG: fork a new worker child process with pid: 18234 2019-12-10 15:37:03: pid 16868: WARNING: worker child process with pid: 18234 was terminated by segmentation fault 2019-12-10 15:37:03: pid 16868: LOG: fork a new worker child process with pid: 18238 2019-12-10 15:37:03: pid 16868: WARNING: worker child process with pid: 18238 was terminated by segmentation fault 2019-12-10 15:37:03: pid 16868: LOG: fork a new worker child process with pid: 18242 2019-12-10 15:37:03: pid 16868: WARNING: worker child process with pid: 18242 was terminated by segmentation fault 2019-12-10 15:37:03: pid 16868: LOG: fork a new worker child process with pid: 18246 2019-12-10 15:37:03: pid 16868: WARNING: worker child process with pid: 18246 was terminated by segmentation fault 2019-12-10 15:37:03: pid 16868: LOG: fork a new worker child process with pid: 18250 2019-12-10 15:37:04: pid 16868: WARNING: worker child process with pid: 18250 was terminated by segmentation fault 2019-12-10 15:37:04: pid 16868: LOG: fork a new worker child process with pid: 18254 2019-12-10 15:37:04: pid 16868: WARNING: worker child process with pid: 18254 was terminated by segmentation fault 2019-12-10 15:37:04: pid 16868: LOG: fork a new worker child process with pid: 18258 2019-12-10 15:37:04: pid 16868: WARNING: worker child process with pid: 18258 was terminated by segmentation fault 2019-12-10 15:37:04: pid 16868: LOG: fork a new worker child process with pid: 18262 2019-12-10 15:37:04: pid 16868: WARNING: worker child process with pid: 18262 was terminated by segmentation fault 2019-12-10 15:37:04: pid 16868: LOG: fork a new worker child process with pid: 18266 2019-12-10 15:37:04: pid 16868: WARNING: worker child process with pid: 18266 was terminated by segmentation fault 2019-12-10 15:37:04: pid 16868: LOG: fork a new worker child process with pid: 18270 backtrace is : Program received signal SIGSEGV, Segmentation fault. 0x00007fdfd3c58706 in __strcmp_sse42 () from /lib64/libc.so.6 (gdb) bt #0 0x00007fdfd3c58706 in __strcmp_sse42 () from /lib64/libc.so.6 0000001 0x000000000044f738 in check_replication_time_lag () at streaming_replication/pool_worker_child.c:404 0000002 do_worker_child () at streaming_replication/pool_worker_child.c:174 0000003 0x000000000040a0a2 in worker_fork_a_child (type=PT_WORKER, func=0x44ee40 <do_worker_child>, params=0x0) at main/pgpool_main.c:713 0000004 0x000000000040a841 in reaper () at main/pgpool_main.c:2661 0000005 0x000000000041163f in PgpoolMain (discard_status=discard_status@entry=1 '\001', clear_memcache_oidmaps=clear_memcache_oidmaps@entry=0 '\000') at main/pgpool_main.c:458 0000006 0x000000000040882a in main (argc=<optimized out>, argv=<optimized out>) at main/main.c:356 This problem is happend by strcmp() which first agument is NULL poinnter. I think that 'application_name' col of pg_stat_replication is handled not enough. | ||||
| Steps To Reproduce | I tested with Pgpool 4.10 and PostgreSQL 12.1 $ pgpool_setup -n 2 $ vim data1/myrecovery.conf #primary_conninfo = 'port=11002 user=test_usr application_name=''server1''' ↓ #primary_conninfo = 'port=11002 user=test_usr application_name=''''' $ ./startall | ||||
| Tags | No tags attached. | ||||
|
|
It turned out that a bug is in do_query() which is called by the worker process. When user sets an empty string to application_name, do_query() mistakenly returned NULL pointer instead of a pointer to an empty string. This means that the bug could potentially affect to all other places where do_query() gets called. So I will apply the fix to all supported branches. Patch attached. By the way, giving an empty string to application_name in primary_conninfo is not a good idea as it makes show pool_nodes returned empty replication_state | and replication_sync_state field. |
|
|
Thank you for createing and commiting your patch. I confirmed, this problem is resolved by this patch and latest V4_1_STABLE branch. |
|
|
Thank you for confirmation. I am going to mark this as "resolved". |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2019-12-10 15:47 | hoshiai | New Issue | |
| 2019-12-10 16:01 | hoshiai | Description Updated | |
| 2019-12-11 11:54 | hoshiai | Steps to Reproduce Updated | |
| 2019-12-12 07:41 | t-ishii | Assigned To | => t-ishii |
| 2019-12-12 07:41 | t-ishii | Status | new => assigned |
| 2019-12-12 17:30 | t-ishii | File Added: do_query_fix.diff | |
| 2019-12-12 17:30 | t-ishii | Note Added: 0003019 | |
| 2019-12-12 21:41 | t-ishii | Status | assigned => feedback |
| 2019-12-12 21:41 | t-ishii | Target Version | => 4.1.1 |
| 2019-12-16 17:01 | hoshiai | Status | feedback => assigned |
| 2019-12-16 17:01 | hoshiai | Note Added: 0003022 | |
| 2019-12-19 14:25 | t-ishii | Note Added: 0003026 | |
| 2019-12-19 14:25 | t-ishii | Status | assigned => resolved |
| 2020-03-06 14:56 | administrator | Status | resolved => closed |
| 2020-03-06 14:56 | administrator | Fixed in Version | => 4.1.1 |