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

core dumped when reading CDX file downloaded from USPTO #1139

Closed
eloyfelix opened this issue May 23, 2023 · 0 comments · Fixed by #1151
Closed

core dumped when reading CDX file downloaded from USPTO #1139

eloyfelix opened this issue May 23, 2023 · 0 comments · Fixed by #1151
Assignees
Labels

Comments

@eloyfelix
Copy link
Contributor

Thanks for fixing #1126. I saw this other issue before but I mistakenly assumed that it would be related...

Steps to Reproduce

Python: 3.11.3
Indigo: 1.12.0.rc1 (pip installed)

>>> from indigo import Indigo
>>> 
>>> indigo = Indigo()
>>> 
>>> for item in indigo.iterateCDXFile("US06837803-20050104-C00001.CDX"):
...     print(item.smiles())
... 
O1CCCC[AlH]1
double free or corruption (out)
Aborted (core dumped)

error if using a buffer to read (what I do since I'm reading from a zipfile)

>>> with open("US06837803-20050104-C00001.CDX", mode="rb") as f:
...     for item in indigo.iterateCDX(indigo.loadBuffer(f.read())):
...         print(item.smiles())
... 
O1CCCC[AlH]1
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/home/eloy/.pyenv/versions/uspto-patents/lib/python3.11/site-packages/indigo/indigo/indigo_object.py", line 65, in __next__
    obj = self._next()
          ^^^^^^^^^^^^
  File "/home/eloy/.pyenv/versions/uspto-patents/lib/python3.11/site-packages/indigo/indigo/indigo_object.py", line 58, in _next
    new_obj = IndigoLib.checkResult(self._lib().indigoNext(self.id))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eloy/.pyenv/versions/uspto-patents/lib/python3.11/site-packages/indigo/indigo/indigo_lib.py", line 1001, in checkResult
    raise exception_class(IndigoLib.lib.indigoGetLastError())
indigo.indigo.indigo_exception.IndigoException: scanner: size = 3725, offset = 260497 after seek()

Expected behavior
Molecules being parsed of failing to parse in a controlled manner.

Attachments

US06837803-20050104-C00001.zip

Indigo/Bingo version
Indigo: 1.12.0.rc1

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

Successfully merging a pull request may close this issue.

2 participants