njh / redstore

RedStore is a lightweight RDF triplestore written in C using the Redland library.
https://www.aelius.com/njh/redstore/
GNU General Public License v3.0
62 stars 6 forks source link

Segmentation fault on triples insertion #56

Open Hibou57 opened 7 years ago

Hibou57 commented 7 years ago

I started RedStore using:

redstore -s file foo.rdf -p 61002

Then in the web interface I tried to insert some test triples:

@prefix: <foo/> .
:a1 :b1 "C1" .
:a2 :b2 "C2" .

… using Turtle for the syntax and “bar” for the base URI. When I clicked “Send”, the browser told me the connexion was reinitialised, and in the terminal within which I started RedStore, there was this message:

[1] 6508 segmentation fault (core dumped) redstore -s file foo.rdf -p 61002

This is not random, this always happens each time I retry the same. I’ve set ulimit -c to unlimited to get a core‑dump file, but it’s big (620K) so I don’t know if it’s OK to attach it here.

If this can help, uname -a says:

Linux XXX 3.13.0-129-generic #178-Ubuntu SMP Fri Aug 11 12:49:13 UTC 2017 i686 i686 i686 GNU/Linux
Hibou57 commented 7 years ago

With a different use‑case, I got a crash with this additional message:

redstore: headers.c:54: redhttp_headers_add: Assertion `strlen(key) > 0' failed.

Hibou57 commented 7 years ago

For the one above, I could figure the cause. That’s because I did this from another terminal:

curl 'http://localhost:61002/data?&format=rdfxml'

Instead of:

curl 'http://localhost:61002/data?default&format=rdfxml'
njh commented 7 years ago

It is not immediately obvious to me why RedStore is crashing. What you are attempting to do looks reasonable.

It is useful to check to see if this is a RedStore problem or a Redland problem but attempting to do the same thing using rdfproc.

Be warned that there also hasn't been a release of Redland since 2013.

nick.

Hibou57 commented 7 years ago

One segmentation fault was preceded by an interesting message:

[WARNING] Sat Sep 2 21:41:18 2017 Model does not support contexts [1] 28458 segmentation fault (core dumped) redstore -s file foo.rdf -p 61002

The preceding warning message may be worth to note.

— Edit — More than one time, it was always there, I just have not noticed before (shy).

Hibou57 commented 7 years ago

I can’t reproduce the crash with rdfproc:

rdfproc -s file foo.rdf add 'foo/a1' 'foo/b1' '"C1"'

… works

It fails with RedStore only and RedStore does not crash if I use -n -s sqlite foo.db instead of -s file foo.rdf. Since SQLite store provides context and RDF file store does not, and there is this warning message (mentioned before), this must be related to context (unfortunately, I don’t know about RDF context).

May be it expects something somewhere, tries to access this non‑existing thing and then segfault.

jonassmedegaard commented 5 years ago

README.md explicitly states that "You can use any of the Redland Storage Modules that supports contexts"