-
Notifications
You must be signed in to change notification settings - Fork 34
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 in copy constructor of StdTransducer #25
Comments
That looks like it should work to me, given the code in line 338 oneward in . On Fri, Sep 18, 2015 at 6:04 PM, GeorgeArgyros [email protected]
|
Yes, this is how I figured out that a copy constructor exists in the first place. However, I am getting the seg fault mentioned above. I am running pyfst on OSX Yosemite btw. |
I can replicate the segmentation fault. You are correct that such behavior is indicated to be supported by the cython code. However, looking at https://github.com/vchahun/pyfst/blob/master/fst/__init__.py#L8, the initialization function that is actually used does not match the one in cython code. Namely, it does not anticipate a source parameter. Also, notice that https://github.com/vchahun/pyfst/blob/master/fst/_fst.pyx.tpl#L342 does not actually try and copy the source FST, but rather tries to copy itself. Since up to that point, self.fst has not been assigned yet, I believe that is what produces the segmentation fault. |
I tried to fix this behavior but unfortunately couldn't. An easy workaround is to use:
|
Although I cannot find it in the API description (http://pyfst.github.io/api.html) it looks like there exists a copy constructor for the StdTransducer and StdAcceptor classes. However, when I am trying to initialize a new object like that I get a segmentation fault.
Example:
Is this a bug, or I am doing something unexpected for the library?
Thanks!
The text was updated successfully, but these errors were encountered: