question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Segmentation fault from a script

See original GitHub issue

The script I have produces a segmentation fault, any idea why?

import io
import spacy

from spacy.tokens.doc import Doc

def transform( in_file, out_file ):   

    global nlp

    with io.open( out_file, 'w', encoding='utf8') as o_f:
        with io.open( in_file, 'rb' ) as i_f:
            for byte_string in Doc.read_bytes( i_f ):
                doc = Doc( nlp.vocab ).from_bytes( byte_string )
                doc.is_parsed = True
                o_f.write(transform_doc( doc )) 


nlp = spacy.en.English( parser=False, tagger=False, matcher=False, entity=False )

transform( 'sample.txt', 'sample_out.txt' )

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
zygmuntzcommented, Apr 1, 2016

Ah, the joys of copy-paste. Thank you for clarifying this.

Still, a message like “Attempted to read_bytes() from not-a-Doc-instance, terminating…” would be helpful. With another sample I just got a memory error.

0reactions
lock[bot]commented, May 9, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bash shell script shows segmentation fault - Stack Overflow
Show activity on this post. my shell script prints segmentation fault when it starts. Script gets a program name as a parameter. I...
Read more >
Segmentation fault when calling a recursive bash function
There are many reasons for a segmentation fault. The most common low-level cause is that the process tried to access a memory address...
Read more >
Identify what's causing segmentation faults (segfaults)
A segmentation fault (aka segfault) is a common condition that causes programs to crash; they are often associated with a file named core...
Read more >
Segmentation fault in function call, shell script
If you are experiencing a segmentation fault, the error is not in your script; there is a memory management bug in one of...
Read more >
1872980 – Segmentation fault when running script on Blender ...
This script has been ported to blender 2.8, worked well, but currently crashes with segmentation fault. I tested upstream bleder tar package ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found