-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seg fault when selecting from SQL Server foreign table in a plpgsql function with local variable #236
Comments
Hi @shirabez , Would you be able to enable core dumps, then reproduce the issue, and then extract the backtrace of the crash from the resulting core dump? Information on how to enable core dumps can be found in issue #218. i.e.:
|
Thanks for the swift reply, Geoff. Hoping to get this to you this week. |
Hi, |
I found small workaroud: change SELECT INTO X COUNT() FROM Y to dynamic |
@adamb111 if you have clear instructions about how to build tds_fdw at Windows, can you share them? We could add them to a README, and maybe it could help us reproducing the problems. |
@GeoffMontee Here is the backtrace from a core dump: [New LWP 3557] Thread 1 (Thread 0x7f209e6f3840 (LWP 3557)): |
Thanks, @shirabez. That seems odd. It seems to be segfaulting when freeing the connection's query variable: https://github.com/tds-fdw/tds_fdw/blob/v2.0.1/src/tds_fdw.c#L1929 |
My instruction, how to compile tds_fdw on Windows. |
Thanks, the instructions are really clear. I will see if I can create a generic README for Windows, or even better, some kind of recipe to ease stuff and prevent errors :-) |
Hello, |
Postgresql: 12.1
tds-fdw: 2.0.1
I have a PostgreSQL plpgsql function that does a SELECT INTO X COUNT(*) on a SQL Server foreign table where X is a local variable declared in the function. The function runs fine the first time it is executed. On the second execution, it causes a seg fault. It's very consistent. That is, every second run of the function causes the Postgres server to raise a signal 11 seg fault.
Other details:
So I'm thinking the issue is with tds-fdw...? Not sure if this is related to issue #51, but I've set match_column_names to both 1 or 0 in the foreign table definition and it seems to make no difference. It always crashes on the second run. Any ideas? Let me know what other info I can provide. Thank you very much.
The text was updated successfully, but these errors were encountered: