Skip to content
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

IndexBuilderMain dumps core on empty stream input without good error message #262

Closed
lehmann-4178656ch opened this issue Jul 1, 2019 · 0 comments

Comments

@lehmann-4178656ch
Copy link
Member

When using IndexBuilderMain inside a pipeline I mistyped the name of a volume and was greeted with the following message (replaced real path with iDoNotExist):

/bin/bash: line 1:     7 Exit 1                  bzcat iDoNotExist
         8 Segmentation fault      (core dumped) | IndexBuilderMain -l -i /index/truthy -F nt -f -

As it was not obvious to me that I mistyped the volume directory I initially was confused on what the error could be.

In this case the problematic line is bzcat: Can't open input file iDoNotExist: No such file or directory. but it's hard to spot inside the normal output of the IndexBuilder

~$ wharfer run --rm --entrypoint /bin/bash -v /tmp:/index/ niklas88/qlever:latest "-c" "bzcat iDoNotExist | IndexBuilderMain -l -i /index/truthy -F nt -f -"

IndexBuilderMain, version Jun  7 2019 07:47:36

Set locale LC_CTYPE to: C.UTF-8
Mon Jul  1 08:19:53.879	- DEBUG: Configuring STXXL...
Mon Jul  1 08:19:53.879	- DEBUG: done.
Mon Jul  1 08:19:53.879	- INFO:  Parsing from stdin.
Mon Jul  1 08:19:53.879	- INFO:  Reading from uncompressed NTriples file/dev/stdin
bzcat: Can't open input file iDoNotExist: No such file or directory.
FOXXLL v1.4.99 (prerelease/Release)
Disk '/index/truthy-stxxl.disk' is allocated, space: 1000000 MiB, I/O implementation: syscall queue=0 devid=0
Mon Jul  1 08:19:53.881	- INFO:  Lines (from KB-file) processed: 0
Mon Jul  1 08:19:53.881	- INFO:  Actual number of Triples in this section (include langfilter triples): 0
Mon Jul  1 08:19:53.881	- INFO:  writing partial vocabulary to /index/truthy.partial-vocabulary0
Mon Jul  1 08:19:53.881	- INFO:  it contains 1 elements
Mon Jul  1 08:19:53.881	- INFO:  Creating partial vocabulary from set ...
Mon Jul  1 08:19:53.881	- INFO:  ... sorting ...
Mon Jul  1 08:19:53.881	- INFO:  Done creating vocabulary.
Mon Jul  1 08:19:53.881	- INFO:  Writing vocabulary to binary file /index/truthy.partial-vocabulary0
Mon Jul  1 08:19:53.881	- INFO:  Done writing vocabulary to file.
Mon Jul  1 08:19:53.881	- INFO:  Pass done.
Mon Jul  1 08:19:53.881	- INFO:  Merging vocabulary
Mon Jul  1 08:19:53.882	- INFO:  Finished writing batch of merged words
Mon Jul  1 08:19:53.882	- INFO:  Finished Merging Vocabulary.
Mon Jul  1 08:19:53.885	- INFO:  total size of vocabulary (internal and external) is 1
Mon Jul  1 08:19:53.885	- INFO:  Initialized external vocabulary. It contains 0 elements.
Mon Jul  1 08:19:53.886	- INFO:  Updating Ids in stxxl vector to global Ids.
Mon Jul  1 08:19:53.886	- INFO:  Lines processed: 0
Mon Jul  1 08:19:53.886	- INFO:  Corresponding number of statements in original knowledgeBase:0
Mon Jul  1 08:19:53.886	- INFO:  Reading IdMap from /index/truthy.partial-ids-mmap0 ...
Mon Jul  1 08:19:53.886	- INFO:  Done reading idMap
Mon Jul  1 08:19:53.889	- INFO:  Lines processed: 0
Mon Jul  1 08:19:53.889	- INFO:  Pass done.
Mon Jul  1 08:19:53.889	- INFO:  Sorting for PSO permutation...
stl_in_memory_sort, range: 0
Mon Jul  1 08:19:53.889	- INFO:  Sort done.
Mon Jul  1 08:19:53.889	- INFO:  Performing unique to ensure RDF semantics...
Mon Jul  1 08:19:53.889	- INFO:  Size before: 0
Mon Jul  1 08:19:53.889	- INFO:  Done: unique.
Mon Jul  1 08:19:53.889	- INFO:  Size after: 0
Mon Jul  1 08:19:53.889	- WARN:  Attempt to write an empty index!
Mon Jul  1 08:19:53.889	- INFO:  Sorting for SPO permutation...
stl_in_memory_sort, range: 0
Mon Jul  1 08:19:53.890	- INFO:  Sort done.
Mon Jul  1 08:19:53.890	- WARN:  Attempt to write an empty index!
Mon Jul  1 08:19:53.890	- INFO:  Vector already sorted for pattern creation.
Mon Jul  1 08:19:53.890	- INFO:  Creating patterns file...
/bin/bash: line 1:     7 Exit 1                  bzcat iDoNotExist
         8 Segmentation fault      (core dumped) | IndexBuilderMain -l -i /index/truthy -F nt -f -
2019/07/01 10:19:54 exit status 139

It looks like IndexBuilderMain handles empty strings:

$ wharfer run --rm --entrypoint /bin/bash -v /tmp:/index/ niklas88/qlever:latest "-c" "echo \"\" | IndexBuilderMain -l -i /index/truthy -F nt -f -"

IndexBuilderMain, version Jun  7 2019 07:47:36

Set locale LC_CTYPE to: C.UTF-8
Mon Jul  1 08:25:20.539	- DEBUG: Configuring STXXL...
Mon Jul  1 08:25:20.539	- DEBUG: done.
Mon Jul  1 08:25:20.539	- INFO:  Parsing from stdin.
Mon Jul  1 08:25:20.539	- INFO:  Reading from uncompressed NTriples file/dev/stdin
Mon Jul  1 08:25:20.540	- ERROR: BAD INPUT STRING (Illegal whitespace only line; in /app/src/parser/NTriplesParser.cpp, line 29, function bool NTriplesParser::getLine(std::array<std::__cxx11::basic_string<char>, 3>&))

This can be observed using the latest and previous images:
niklas88/qlever latest 5e18076b6ad5 3 days ago 198MB
niklas88/qlever latest ce623d98a552 3 weeks ago 199MB

@lehmann-4178656ch lehmann-4178656ch changed the title IndexBuilderMain dumps core on empty stream input without goot error message IndexBuilderMain dumps core on empty stream input without good error message Jul 1, 2019
niklas88 added a commit that referenced this issue Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant