Skip to content
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

qmol_from_smiles() + bogus input causes engine crash #3689

Closed
robins opened this issue Jan 4, 2021 · 3 comments
Closed

qmol_from_smiles() + bogus input causes engine crash #3689

robins opened this issue Jan 4, 2021 · 3 comments
Labels
Milestone

Comments

@robins
Copy link

robins commented Jan 4, 2021

Describe the bug
Similar to #3687 and #3688, engine crash when calling mol_adjust_query_properties() with bogus input

To Reproduce
SELECT mol_adjust_query_properties(nullif(NULL::mol, NULL::mol)::mol, 'a'::cstring) @> qmol_from_smiles('a'::cstring);

Screenshots / SQL Output

postgres=> SELECT mol_adjust_query_properties(nullif(NULL::mol, NULL::mol)::mol, 'a'::cstring) @> qmol_from_smiles('a'::cstring);
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!?> \q

Error Log Excerpt

2021-01-04 08:06:48 UTC::@:[20623]:LOG: server process (PID 20539) was terminated by signal 11: Segmentation fault
2021-01-04 08:06:48 UTC::@:[20623]:DETAIL: Failed process was running: SELECT mol_adjust_query_properties(nullif(NULL::mol, NULL::mol)::mol, 'a'::cstring) @> qmol_from_smiles('a'::cstring);
2021-01-04 08:06:48 UTC::@:[20623]:LOG: terminating any other active server processes
@robins robins added the bug label Jan 4, 2021
@greglandrum
Copy link
Member

I think the problem here is actually with qmol_from_smiles.
Breaking your reproducible into two pieces shows this:

egression=# SELECT mol_adjust_query_properties(nullif(NULL::mol, NULL::mol)::mol, 'a'::cstring);
 mol_adjust_query_properties 
-----------------------------
 
(1 row)

regression=# SELECT qmol_from_smiles('a'::cstring);
server closed the connection unexpectedly
	This probably means the server terminated abnormally
	before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!> 

If you can confirm I will rename the issue.

@robins
Copy link
Author

robins commented Jan 5, 2021

Thanks for looking into this promptly.

I didn't know the relation but Correct, SELECT qmol_from_smiles('a'::cstring); crashes too.

postgres=> SELECT qmol_from_smiles('a'::cstring);
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!?> \q

@robins robins changed the title mol_adjust_query_properties() + bogus input causes engine crash qmol_from_smiles() + bogus input causes engine crash Jan 6, 2021
@robins
Copy link
Author

robins commented Jan 6, 2021

! A little more coffee and now I see what I missed earlier. Updated the Issue title.

greglandrum added a commit to greglandrum/rdkit that referenced this issue Jan 12, 2021
@greglandrum greglandrum added this to the 2020_09_4 milestone Jan 12, 2021
greglandrum added a commit that referenced this issue Jan 21, 2021
* fixes #3687

* Fixes #3688

* fixes #3689

* more testing

* change in response to review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants