Skip to content
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.

none checking on owl + removal of compiled pyx files #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lukemetz
Copy link

Ran into a number of odd errors when accidentally passing None into owl functions. Turns out cython just tries to accept them and they turn into invalid memory causing segfaults. (https://github.com/cython/cython/wiki/FAQ#why-does-a-function-with-cdef-d-parameters-accept-none) This pull request tries to fix that. In addition I removed the generated cpp file for the pyx file.

The new errors look something like:

[23:49:49] /home/luke/Repos/minerva/minerva/system/minerva_system.cpp:86: dag engine enabled
Traceback (most recent call last):
  File "tt.py", line 10, in <module>
    ele.relu(None)
  File "/home/luke/Repos/minerva/owl/owl/elewise.py", line 50, in relu
    return _owl.NArray.relu(x)
TypeError: Argument 'lhs' has incorrect type (expected owl.libowl.NArray, got NoneType)

The old error looks like:

[23:51:53] /home/luke/Repos/minerva/minerva/system/minerva_system.cpp:86: dag engine enabled
Segmentation fault (core dumped)

To my knowledge there are no tests for this pyx file. In addition I cannot run the cuda code on my current machine but to my knowledge this shouldn't break anything.

@hotpxl
Copy link
Member

hotpxl commented Aug 20, 2015

Hi. Thanks for contributing. I'll merge after I test with your commits. This might take some time as we are now moving efforts to dmlc/mxnet and we are short of developers.

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

Successfully merging this pull request may close these issues.

2 participants