-
Notifications
You must be signed in to change notification settings - Fork 5
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
Bug in hdt_search #6
Comments
Thanks. I think this is more likely to be an issue with the HTD library itself than the interface. Can you try updating the HDT submodule? |
I cannot reproduce this: the query I also notice that some solutions contain terms that do not appear in the data file at all, e..g, |
Sorry, I had added the triple I'm updating the hdt library and testing again. |
Using the exact ontology that I gave above:
The version # given by hdtSearch in the source tree for the prolog hdt library:
Note that when I build from hdt separately and use hdtSearch to do the query I get the expected results:
The version # given by hdtSearch compiled separately:
If I use the version in the pack I get:
When I create an hdt file using Similarly search fails using the swipl compiled version for both versions of rdf2hdt. For this reason it doesn't seem to be merely a version incompatibility but something going wrong with the version being compiled in the pack. Could it have to do with -fPIC or something along those lines? I can have another go at a clean recompile but I wonder are there any suggestions about what I might try. |
Sure enough, compiling the hdt pack without -fPIC results in an hdtSearch binary which works correctly (but obviously you can't use the pack). Any ideas on how to solve this? |
What do you mean with correctly? In the log above I see Trying to get an element bigger than the array., which seems to be be same exception as Prolog gets. Only, Prolog doesn't catch the runtime error and crashes. Sure we can make it produce a normal Prolog exception, but this still seems a bug in the HDT, no? I can reproduce the above with the hdtSearch compiled as part of the pack. If this is all correct, the bug is in the core HDT rather than the Prolog interface. Does it depend on I'd first consider updating hdt-lib as used by the pack. I'm a bit unsure which version to pick though. @wouterbeek is more knowledgeable here. |
The correct result is no results. If I compile hdt separately, using hdtSearch I get no results, rather than a series of incorrect results followed by a crash. I have now definitely established that -fPIC changes the behaviour to make it incorrect, mimicking the incorrect behaviour I was getting in prolog. If I remove -fPIC the tools work correctly (though obviously not the prolog interface), and if I put it back they do not. I've reported this to hdt-lib. Presumably this means I can write the package to be statically compiled against swipl as a workaround? |
Thanks for the additional information and MWE. I hope I can take a detailed look at it this evening. |
Thanks. I think there are some sensible things to try: (1) a different version of I did (2). Doesn't show anything suspicious. For (4) I use gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 from Ubuntu 18.04. Using a non-relocatable version of I'd start trying (1). |
(1) I've pulled the latest from the devel branch and it still occurs. (2) valgrind shows memory leaks for the -fPIC version and none for the version without. (3) I've played around with a few combinations here. I'll try more systematically. (4) My gcc version is 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10) I guess if you guys can't reproduce it, I'd better try to upgrade gcc. |
Thanks for all the searching! (2) is interesting and might give a hint about what is going wrong. As I can reproduce on Ubuntu 18.04 using gcc 7.3.0, upgrading GCC isn't promising. In theory, there should simply not be an observable difference between
Not sure how to proceed. As a work-around you could still try different Oh. you could consider compiling with |
Sorry, it turns out I was checking out an old commit. The latest develop branch does fix the problem. The structure of the develop branch tree has changed somewhat significantly, so some changes needed to be made to the build process to make the swipl hdt pack compile. I've forked the repository and it now seems to build cleanly in my fork. https://github.com/GavinMendelGleason/hdt I'm probably not using best practices, but it's working. Maybe you can fold changes back in in the appropriate way. |
And thanks to both of you for all the help! |
I have a reproducible fatal error in the hdt interface. For some reason searching with a predicate and object, returns more results than simply searching for the object (in this case), and eventually gives you bounds check error.
The turtle file to reproduce this is:
And the following interaction demonstrates the problem:
The bug can also be tickled using hdt_search instead of searching by id:
I've used the prolog hdt library on multi-gig databases including millions of nodes with no problem, so this one has me stumped and quite surprised to find a failure on such a small example.
The text was updated successfully, but these errors were encountered: