-
Notifications
You must be signed in to change notification settings - Fork 80
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
Segmentation fault (core dumped) causing app crash on .query and .querySync #46
Comments
In the interim, I am attempting to take steps forward to understand what is happening. I am setting up a gdb debugger to listen on the eg.
With
No luck thus far getting any insight If anyone can provide other debug recommendations, would appreciate your comments. Happy to follow up this issue with slight direction on environment setup |
Seg fault appears to be the result of a missing ( SELECT *
ROW_NUMBER() should be ( SELECT *
, ROW_NUMBER() Did further testing - Other information - also occurs if I run the library and code within another environment such as a docker container with os:
FYI Have rebuilt manually within Hope the above information can assist in identifying why there may be a seg fault. Memory issue on SQL validation? |
Have you considered that it might be crashing in the psqlodbc driver itself, or in unixODBC somewhere? If you enable core dumps you might be able to use gdb to get a stack trace from the core dump, which may at least tell you what the segfaulting module is. |
Hi,
I am getting a
Segmentation fault (core dumped)
after this odbc library executes a heavy (potentially bad performing query) sql string onself.conn.query(sql, cbQuery);
command (eg. line 260 of ./lib/odbc.js and line 336 to name a couple). The fault occurs within milliseconds.Immediate question: How do you recommend I obtain error logs from the cpp binding so that I can provide more information?
Further information:
From what I have experienced so far, this only occurs on particular SQL query strings that are passed into
self.conn.query(sql,cbQuery)
.Very simple queries - whether they are syntactically incorrect or perfect, have no problem executing towards the target Postgres DB. (Eg. if wrong syntax is passed through the binding, the DB correctly responds back with error messages).
However, a larger query like the one shown below causes a segmentation fault (without the ability for my app to gracefully catch an exception from the cpp binding, inform the user that an error has occured or otherwise fail nicely prior to fault) - it just tears down the entire process within milliseconds.
SQL Query example showing what leads to an seg fault. Hopefully this can help you and I understand what resides within the below string that could cause a segmentation fault in the underlying odbc_binding cpp code
I won't explain the context of the above query - I have simply presented the precise query structure that causes an
Segmentation fault
.I am hoping this issue will help find a new exception to raise within the library such that an error message can be returned to the JS lib
The text was updated successfully, but these errors were encountered: