Skip to content

Segmentation fault while using matcher #587

Closed

Description

@sadovnychyi

As mentioned in #429. I have manually installed spacy with this fix which you did yesterday. It took me a lot of time to catch this.. so here we are:

import spacy
import spacy.matcher

nlp = spacy.load('en', parser=False, entity=False)
matcher = spacy.matcher.Matcher(nlp.vocab)
content = u'''a b; c'''
matcher.add(entity_key='1', label='TEST', attrs={}, specs=[[{65: 'a'}, {65: 'b'}]])
matcher(nlp(content))
matcher.add(entity_key='2', label='TEST', attrs={}, specs=[[{65: 'a'}, {65: 'b'}, {5: True}, {65: 'c'}]])
matcher(nlp(content))
matcher.add(entity_key='3', label='TEST', attrs={}, specs=[[{65: 'a'}, {65: 'b'}, {5: True}, {65: 'd'}]])
matcher(nlp(content))

->

Segmentation fault: 11

Thrown from the last line.

Activity

  1. added a commit that references this issue on Oct 28, 2016
  2. added
    bugBugs and behaviour differing from documentation
    on Oct 28, 2016
  3. added a commit that references this issue on Oct 28, 2016
  4. honnibal commented on Oct 28, 2016

    @honnibal
    Member

    Hm, was silently ignoring an error condition.

    Fixed now, but looking at this, I doubt this will be the last error. Hopefully they should report more cleanly now though.

  5. sadovnychyi commented on Oct 28, 2016

    @sadovnychyi
    ContributorAuthor

    Thanks!

    Traceback (most recent call last):
      File "word2vec/matcher.py", line 118, in <module>
        matches = matcher(doc)
      File "spacy/matcher.pyx", line 315, in spacy.matcher.Matcher.__call__ (spacy/matcher.cpp:8519)
    Exception: Error selecting action in matcher
    

    How do I go from here? Seems like there's no debug logs available.

  6. sadovnychyi commented on Oct 28, 2016

    @sadovnychyi
    ContributorAuthor

    Ok, got it. Hope you don't mind if I'll leave it here.

    import spacy
    import spacy.matcher
    
    nlp = spacy.load('en', parser=False, entity=False)
    matcher = spacy.matcher.Matcher(nlp.vocab)
    content = u'''a b; c'''
    matcher.add(entity_key='1', label='TEST', attrs={}, specs=[[]])
    matcher(nlp(content))

    ->

    Traceback (most recent call last): 
      File "word2vec/matcher_bla.py", line 8, in <module>
        matcher(nlp(content))
      File "spacy/matcher.pyx", line 315, in spacy.matcher.Matcher.__call__ (spacy/matcher.cpp:8519)
    Exception: Error selecting action in matcher
    

    Caused by empty specs. While I understand that this is a mistake in my data it's better to check this when entity is being added.

  7. savkov commented on Nov 10, 2016

    @savkov
    Contributor

    I had that last week but it disappeared when I updated the data. I was suspecting empty pattern/key caused it. Thanks for the explanation!

  8. lock commented on May 9, 2018

    @lock

    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.

  9. locked as resolved and limited conversation to collaborators on May 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBugs and behaviour differing from documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions