<div dir="ltr">I've attached a sample pgpool.conf. These get generated from a template. Things like identifiers will be different, but all settings are identical to the one used in the logs. As you can see, both failover_on_backend_error and failover_on_backend_shutdown are enabled.<div><br></div><div>I've increased the logging as you requested. It might take some time to reproduce the errors. These segfaults do not occur very frequently. We see about one failure every few days. I'll report back when I managed to reproduce them with the new logging settings.</div><div><br></div><div>Best regards,</div><div>Emond</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Op za 8 jun 2024 om 04:55 schreef Tatsuo Ishii <<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> Thank you for the info.  This is really weird. By the time when the<br>
> execution reach here, backend->slots[2] must be filled like slot[0]<br>
> and slot[1] since VALID_BACKEND(2) returns true which means the<br>
> connection to backend 2 is valid. I need more time to investigate<br>
> this.<br>
<br>
I am trying to determine the code path when the segfault occurred.  For<br>
this purpose can you share pgpool.conf? I especially interested in<br>
failover_on_backend_error and failover_on_backend_shutdown settings.<br>
<br>
Also can you get pgpool.log when segfaults occur with log_min_messages = debug1?<br>
<br>
>> For the second crash (in pool_connection_pool.c:326), all slots are null:<br>
>> (gdb) info locals<br>
>> i = 0<br>
>> freed = 0<br>
>> closetime = 0<br>
>> oldestp = 0x7f474f36e168<br>
>> ret = 0x0<br>
>> info = 0x55b511283469 <opt_sort><br>
>> p = 0x7f474f36e168<br>
>> <br>
>> (gdb) p *p<br>
>> $7 = {<br>
>>   info = 0x7f47470d5c08,<br>
>>   slots = {0x0 <repeats 128 times>}<br>
>> }<br>
>> <br>
>> (gdb) p p->slots[0]<br>
>> $10 = (POOL_CONNECTION_POOL_SLOT *) 0x0<br>
>> (gdb) p p->slots[1]<br>
>> $11 = (POOL_CONNECTION_POOL_SLOT *) 0x0<br>
>> (gdb) p p->slots[2]<br>
>> $12 = (POOL_CONNECTION_POOL_SLOT *) 0x0<br>
> <br>
> This is strange too. How come p->slots[0-2] is 0 if VALID_BACKEND<br>
> returns true. I will look into this.<br>
> <br>
>> I hope this helps.<br>
>> <br>
>> Best regards,<br>
>> Emond<br>
>> <br>
>> Op di 4 jun 2024 om 04:56 schreef Tatsuo Ishii <<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>>:<br>
>> <br>
>>> > No worries. I hope you had a good trip. Last night we triggered the last<br>
>>> > crash again. Is there anything we can do to make it easier for you to<br>
>>> find<br>
>>> > the cause?<br>
>>><br>
>>> It would be helpful if you could share some variable values in the<br>
>>> core file. Since I don't have the pgpool load module when you got the<br>
>>> core, I cannot inspect the variables using the core you provided.<br>
>>><br>
>>> > #0  connect_backend (sp=0x55803eb0a6b8, frontend=0x55803eb08768) at<br>
>>> > protocol/child.c:1076<br>
>>> > #1  0x000055803ce3d02a in get_backend_connection<br>
>>> (frontend=0x55803eb08768)<br>
>>> > at protocol/child.c:2112<br>
>>> > #2  0x000055803ce38fd5 in do_child (fds=0x55803eabea90) at<br>
>>> > protocol/child.c:416<br>
>>> > #3  0x000055803cdfea4c in fork_a_child (fds=0x55803eabea90, id=13) at<br>
>>> > main/pgpool_main.c:863<br>
>>> > #4  0x000055803cdfde30 in PgpoolMain (discard_status=0 '\000',<br>
>>> > clear_memcache_oidmaps=0 '\000') at main/pgpool_main.c:561<br>
>>> > #5  0x000055803cdfb9e6 in main (argc=2, argv=0x7ffc8cdddda8) at<br>
>>> > main/main.c:365<br>
>>><br>
>>> Around protocol/child.c:1076:<br>
>>>                                 /* set DB node id */<br>
>>>                                 pool_set_db_node_id(CONNECTION(backend,<br>
>>> i), i);<br>
>>><br>
>>> I want to see the values in the "backend" struct. Since CONNECTION<br>
>>> macro is used here, you have to do something like in a gdb session.<br>
>>><br>
>>> p *backend->slots[0]<br>
>>> p *backend->slots[1]<br>
>>> p *backend->slots[2]<br>
>>><br>
>>> Best reagards,<br>
>>> --<br>
>>> Tatsuo Ishii<br>
>>> SRA OSS LLC<br>
>>> English: <a href="http://www.sraoss.co.jp/index_en/" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en/</a><br>
>>> Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
>>><br>
> _______________________________________________<br>
> pgpool-general mailing list<br>
> <a href="mailto:pgpool-general@pgpool.net" target="_blank">pgpool-general@pgpool.net</a><br>
> <a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><br>
</blockquote></div>