-
Notifications
You must be signed in to change notification settings - Fork 794
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
segfault with large data #71
Comments
It happens on both Python 2.7 and Python 3.6 |
Could you post backtrace |
Couldn't get any backtrace. |
#[pyfn(m, "extract_entity")]
fn extract_entity_py(py: Python, content: Vec<Vec<String>>) -> PyResult<Vec<Vec<Vec<Entity>>>> {
println!("{:?}", content);
} the |
Try to run it with lldb |
|
Seems like something wrong with executable. Are you sure you build it with right arch?
…Sent from my iPhone
On Jul 31, 2017, at 12:18 AM, messense ***@***.***> wrote:
During startup program terminated with signal SIGSEGV, Segmentation fault.
(gdb) bt
No stack.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I am sure. It works fine with small amount of data. |
Got some backtrace with core dump. |
Could you post reproducible code |
It'll take some time to extract reproducible code. More bt:
|
Do you use master or 0.1 release? |
Tried both, they all have the same issue, the backtrace is generated from 0.1 release |
Ok. Try to extract reproducible code |
@fafhrd91 I have sent you the code through email. |
https://github.com/PyO3/pyo3/blob/master/src/objects/iterator.rs#L47 Change: py.cast_from_ptr_or_opt(ffi::PyIter_Next(self.0.as_ptr())) } to py.cast_from_borrowed_ptr_or_opt(ffi::PyIter_Next(self.0.as_ptr())) } fixed the segfault on linux(and still works on macOS) |
I added temp fix. could you try to run your code with English text? |
Confirmed the fix with both Chinese text and English text. |
But does it segfault with English without latest fix? |
It does, but it needs more data to trigger. |
I used the zen = 'xxxxxx'
testdata = [zen.split('\n') * 3] * 10 |
Hmm, that's strange. I am afraid my fix fixes side effects and not actual problem. |
This issue still occurs sometimes with |
could you create repo with code with reproducible bug |
I have created a repo for reproducing the issue here: https://github.com/messense/pyo3-issue-71 |
Should also be fixed by 0.5.1 |
I have a function with signature:
with large data it segfaults (small data is fine), it happens on Linux, on macOS it's mostly fine.
dmesg
log:The text was updated successfully, but these errors were encountered: