patrickfrey / strusAnalyzer

Library for document analysis (segmentation, tokenization, normalization, aggregation) with the goal to get a set of items that can be inserted into a strus storage. Also some functions for analysing tokens or phrases of the strus query are provided.
http://www.project-strus.net
Mozilla Public License 2.0
3 stars 0 forks source link

JSON segmenter crashes as sub segmenter #46

Closed andreasbaumann closed 7 years ago

andreasbaumann commented 7 years ago
Program terminated with signal SIGSEGV, Segmentation fault.
#0  getTextwolfItems (itemar=..., nd=nd@entry=0x0)
    at /home/abaumann/projects/strus/strusAnalyzer/src/segmenter_cjson/segmenterContext.cpp:79
79              switch (nd->type & 0x7F)
(gdb) bt
#0  getTextwolfItems (itemar=std::vector of length 0, capacity 0, nd=nd@entry=0x0)
    at /home/abaumann/projects/strus/strusAnalyzer/src/segmenter_cjson/segmenterContext.cpp:79
#1  0xb702a7fc in getSegmenterItems (tree=0x0, resar=..., automaton=<optimized out>)
    at /home/abaumann/projects/strus/strusAnalyzer/src/segmenter_cjson/segmenterContext.cpp:198
#2  strus::SegmenterContext::getNext (this=0x9bb59c8, id=@0xbffe51ec: 268435456, pos=@0x9bb5990: 2861, 
    segment=@0xbffe51e4: 0x9bb64a0 "\n{}\n", segmentsize=@0xbffe51e8: 4)
    at /home/abaumann/projects/strus/strusAnalyzer/src/segmenter_cjson/segmenterContext.cpp:238
#3  0xb70f8165 in strus::DocumentAnalyzerContext::analyzeNext (this=<optimized out>, doc=...)
    at /home/abaumann/projects/strus/strusAnalyzer/src/analyzer/documentAnalyzerContext.cpp:152
#4  0x0804e8a5 in main (argc=<optimized out>, argv=<optimized out>)
    at /home/abaumann/projects/strus/strusUtilities/src/strusAnalyze/strusAnalyze.cpp:457

maybe a problem is the empty JSON document:

#2  strus::SegmenterContext::getNext (this=0x9bb59c8, id=@0xbffe51ec: 268435456, pos=@0x9bb5990: 2861, 
    segment=@0xbffe51e4: 0x9bb64a0 "\n{}\n", segmentsize=@0xbffe51e8: 4)
patrickfrey commented 7 years ago

Fixed.