Closed hiroin closed 5 months ago
Thank you for the report. I was able to reproduce the segfault using your SQL sample. I think what happens here is:
I think the fix is to disable the analysis by providing NULL pointer to psqlscan initialize function. Note that psqlscan was imported from psql and originally the analysis was necessary of course, but it is not for pgpool. fix_sqlscan.txt
Attached is the patch to fix the issue. If you like, please try it.
I have applied the patch you provided and confirmed that no segmentation fault occurs. Thank you. Since this is not urgent, please include it in one of the upcoming releases at your convenience. I will now close this issue.
Thank you for testing! The fix will appear in next minor releases.
[Overview]
Attempting to execute the SQL query in the attached file
segfault_sql.txt
on pgpool causes a segmentation fault.[Environment]
[Details]
When executing the SQL query from
segfault_sql.txt
via psql on pgpool, the following occurs:The server's
messages
log shows the following:A core dump was generated, and a backtrace using gdb shows the following:
The segmentation fault occurs during the SQL parsing stage in pgpool, and it can be reproduced regardless of the schema. Executing the query in
segfault_sql.txt
on any schema will trigger the segmentation fault, even if the tables specified in the query do not exist in the schema.It was also confirmed that the same SQL query can be executed directly on PostgreSQL without any issues.
[Steps to Reproduce]
segfault_sql.txt
file.Attachments
Please let me know if you need any further information.