[redland-dev] redland rasqal datatype problem (bug?)

Sebastian Trüg strueg at mandriva.com
Fri Mar 21 13:19:51 GMT 2008


Hi guys,

I hope someone can shed some light on this problem I am having after parsin=
g =

the RDF syntax data encoded in rdf+xml. The error I get on stderr is the =

following:

node: Cannot encode a datatype URI string of 808595303 bytes length (error)

I tracked it down to rdf_node.c. Attached you find the backtrace starting f=
rom =

a breakpoint at rdf_node.c where an invalid datatype uri causes a failure.

This is the datatype uri (clearly invalid):

$2 =3D {world =3D 0x772f2f3a70747468, string =3D 0x726f2e33772e7777 <Addres=
s =

0x726f2e33772e7777 out of bounds>, string_length =3D 808595303, usage =3D =

1479487793}

which has been casted from a raptor_uri which is essentially a void pointer.

I gave up tracking down the invalid datatype uri when it went into a raptor =

sequence. I just do not have enough insight on the code. Hopefully someone =

knows what this is about.

I also ran it through valgrind but all I got is this invalid write which I =

could not make much of:

=3D=3D1921=3D=3D Syscall param pwrite64(buf) points to uninitialised byte(s)
=3D=3D1921=3D=3D    at 0x879B813: __pwrite_nocancel (in /lib64/libpthread-2=
.6.1.so)
=3D=3D1921=3D=3D    by 0x12C22B81: __os_io (in /usr/lib64/libdb-4.5.so)
=3D=3D1921=3D=3D    by 0x12C1231E: (within /usr/lib64/libdb-4.5.so)
=3D=3D1921=3D=3D    by 0x12C12534: __memp_bhwrite (in /usr/lib64/libdb-4.5.=
so)
=3D=3D1921=3D=3D    by 0x12C1DF0F: __memp_sync_int (in /usr/lib64/libdb-4.5=
.so)
=3D=3D1921=3D=3D    by 0x12BC6E4A: __db_sync (in /usr/lib64/libdb-4.5.so)
=3D=3D1921=3D=3D    by 0x12BD5DC6: __db_sync_pp (in /usr/lib64/libdb-4.5.so)
=3D=3D1921=3D=3D    by 0x12929B1D: librdf_hash_bdb_sync (rdf_hash_bdb.c:996)
=3D=3D1921=3D=3D    by 0x1290B316: librdf_hash_sync (rdf_hash.c:1104)
=3D=3D1921=3D=3D    by 0x12919013: librdf_storage_hashes_sync =

(rdf_storage_hashes.c:1684)
=3D=3D1921=3D=3D    by 0x12914941: librdf_storage_sync (rdf_storage.c:1586)
=3D=3D1921=3D=3D    by 0x12910C26: librdf_model_storage_sync (rdf_model_sto=
rage.c:549)
=3D=3D1921=3D=3D  Address 0xf745008 is 3,200 bytes inside a block of size 4=
,183 =

alloc'd
=3D=3D1921=3D=3D    at 0x4C226AC: malloc =

(in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
=3D=3D1921=3D=3D    by 0x12C208EB: __os_malloc (in /usr/lib64/libdb-4.5.so)
=3D=3D1921=3D=3D    by 0x12BE8843: __db_shalloc (in /usr/lib64/libdb-4.5.so)
=3D=3D1921=3D=3D    by 0x12C109EE: __memp_alloc (in /usr/lib64/libdb-4.5.so)
=3D=3D1921=3D=3D    by 0x12C1306B: __memp_fget (in /usr/lib64/libdb-4.5.so)
=3D=3D1921=3D=3D    by 0x12B6E201: __bam_get_root (in /usr/lib64/libdb-4.5.=
so)
=3D=3D1921=3D=3D    by 0x12B6E557: __bam_search (in /usr/lib64/libdb-4.5.so)
=3D=3D1921=3D=3D    by 0x12B5F3E8: (within /usr/lib64/libdb-4.5.so)
=3D=3D1921=3D=3D    by 0x12B60953: (within /usr/lib64/libdb-4.5.so)
=3D=3D1921=3D=3D    by 0x12BCDC1E: __db_c_get (in /usr/lib64/libdb-4.5.so)
=3D=3D1921=3D=3D    by 0x12BD8C6D: __db_c_get_pp (in /usr/lib64/libdb-4.5.s=
o)
=3D=3D1921=3D=3D    by 0x129292FC: librdf_hash_bdb_cursor_get (rdf_hash_bdb=
.c:492)


Thanks a lot,
Sebastian Tr=FCg
-------------- next part --------------
#0  librdf_node_encode (node=3D0x2aaaac2575d0, buffer=3D0x0, length=3D0) at=
 rdf_node.c:1410
#1  0x00002b07012de7a0 in librdf_new_node_from_typed_counted_literal (world=
=3D0x2aaaac2221a0, value=3D0x2aaaac2be790 "http://www.w3.org/1999/02/22-rdf=
-syntax-ns#", value_len=3D43, xml_language=3D0x0, xml_language_len=3D0,
    datatype_uri=3D0x2aaaac24f0b0) at rdf_node.c:490
#2  0x00002b07012dea03 in librdf_new_node_from_typed_literal (world=3D0x2aa=
aac2221a0, value=3D0x2aaaac2be790 "http://www.w3.org/1999/02/22-rdf-syntax-=
ns#", xml_language=3D0x0, datatype_uri=3D0x2aaaac24f0b0) at rdf_node.c:591
#3  0x00002b07012f842e in rasqal_literal_to_redland_node (world=3D0x2aaaac2=
221a0, l=3D0x2aaaac224e10) at rdf_query_rasqal.c:169
#4  0x00002b07012f8e1a in rasqal_redland_init_triples_match (rtm=3D0x2aaaac=
2bb760, rts=3D0x2aaaac2b52a0, user_data=3D0x2aaaac231730, m=3D0x2aaaac26470=
0, t=3D0x2aaaac2c0590) at rdf_query_rasqal.c:548
#5  0x00002b07019be575 in rasqal_new_triples_match (query_results=3D0x2aaaa=
c22cfc0, user_data=3D0x2aaaac264700, m=3D0x2aaaac264700, t=3D0x2aaaac2c0590=
) at rasqal_engine.c:566
#6  0x00002b07019bebf3 in rasqal_engine_triple_graph_pattern_get_next_match=
 (query_results=3D0x2aaaac22cfc0, gp=3D0x2aaaac280b10) at rasqal_engine.c:9=
12
#7  0x00002b07019bee42 in rasqal_engine_graph_pattern_get_next_match (query=
_results=3D0x2aaaac22cfc0, gp=3D0x2aaaac280b10) at rasqal_engine.c:1005
#8  0x00002b07019bf8bb in rasqal_engine_do_step (query_results=3D0x2aaaac22=
cfc0, outergp=3D0x2aaaac2431b0, gp=3D0x2aaaac280b10) at rasqal_engine.c:1446
#9  0x00002b07019bfe9e in rasqal_engine_get_next_result (query_results=3D0x=
2aaaac22cfc0) at rasqal_engine.c:1764
#10 0x00002b07019c1c5e in rasqal_engine_excute_next_lazy (query_results=3D0=
x2aaaac22cfc0) at rasqal_engine.c:3377
#11 0x00002b07019c1a6d in rasqal_engine_execute_run (query_results=3D0x2aaa=
ac22cfc0) at rasqal_engine.c:3266
#12 0x00002b07019badfc in rasqal_query_execute (query=3D0x2aaaac256fa0) at =
rasqal_query.c:1204
#13 0x00002b07012f8fec in librdf_query_rasqal_execute (query=3D0x2aaaac2bf5=
50, model=3D0x2aaaac31b090) at rdf_query_rasqal.c:612
#14 0x00002b07012f6b6e in librdf_query_execute (query=3D0x2aaaac2bf550, mod=
el=3D0x2aaaac31b090) at rdf_query.c:461
#15 0x00002b07012e8bf9 in librdf_model_storage_query_execute (model=3D0x2aa=
aac31b090, query=3D0x2aaaac2bf550) at rdf_model_storage.c:532
#16 0x00002b07012e7d3d in librdf_model_query_execute (model=3D0x2aaaac31b09=
0, query=3D0x2aaaac2bf550) at rdf_model.c:1396
#17 0x00002b0702083595 in Soprano::Redland::RedlandModel::executeQuery (thi=
s=3D0x2aaaac337620, query=3D at 0x7fffb5ebbee0, language=3DSoprano::Query::Que=
ryLanguageSparql, userQueryLanguage=3D at 0x7fffb5ebc020)
    at /home/trueg/kde/dev/kde/src/4/kdesupport/soprano/backends/redland/re=
dlandmodel.cpp:223
#18 0x00002b06fedac1ec in (anonymous namespace)::findGraphUris (model=3D0x2=
aaaac337620, ns=3D at 0x7fffb5ebc140, dataGraphUri=3D at 0x7fffb5ebc120, metaData=
GraphUri=3D at 0x7fffb5ebc110)
    at /home/trueg/kde/dev/kde/src/4/kdebase/runtime/nepomuk/ontologymanage=
rmodel.cpp:79
#19 0x00002b06fedad624 in Nepomuk::OntologyManagerModel::updateOntology (th=
is=3D0x81cdb0, data=3D at 0x7fffb5ebc6b0, ns=3D at 0x7fffb5ebc690) at /home/trueg=
/kde/dev/kde/src/4/kdebase/runtime/nepomuk/ontologymanagermodel.cpp:268
#20 0x00002b06fedab196 in Nepomuk::OntologyLoader::Private::updateOntology =
(this=3D0x81f6c0, filename=3D at 0x7fffb5ebc790) at /home/trueg/kde/dev/kde/sr=
c/4/kdebase/runtime/nepomuk/ontologyloader.cpp:117
#21 0x00002b06fedab3f2 in Nepomuk::OntologyLoader::update (this=3D0x2aaaac1=
48ed0) at /home/trueg/kde/dev/kde/src/4/kdebase/runtime/nepomuk/ontologyloa=
der.cpp:81
#22 0x00002b06fedab4e8 in Nepomuk::OntologyLoader::qt_metacall (this=3D0x2a=
aaac148ed0, _c=3DQMetaObject::InvokeMetaMethod, _id=3D0, _a=3D0x7fffb5ebc8d=
0) at /home/trueg/kde/dev/kde/build/4/kdebase/runtime/nepomuk/ontologyloade=
r.moc:65
#23 0x00002b06f85c5edf in QMetaObject::activate (sender=3D0x77c300, from_si=
gnal_index=3D4, to_signal_index=3D4, argv=3D0x0) at kernel/qobject.cpp:2992
#24 0x00002b06f85c6335 in QMetaObject::activate (sender=3D0x77c300, m=3D0x2=
b06f88ad340, local_signal_index=3D0, argv=3D0x0) at kernel/qobject.cpp:3065
#25 0x00002b06f85cff6a in QSingleShotTimer::timeout (this=3D0x77c300) at .m=
oc/debug-shared/qtimer.moc:74
#26 0x00002b06f85d008b in QSingleShotTimer::timerEvent (this=3D0x77c300) at=
 kernel/qtimer.cpp:300
#27 0x00002b06f85c501c in QObject::event (this=3D0x77c300, e=3D0x7fffb5ebd2=
00) at kernel/qobject.cpp:1096
#28 0x00002b06f915d2e9 in QApplicationPrivate::notify_helper (this=3D0x6239=
30, receiver=3D0x77c300, e=3D0x7fffb5ebd200) at kernel/qapplication.cpp:3735
#29 0x00002b06f915d60b in QApplication::notify (this=3D0x7fffb5ebd680, rece=
iver=3D0x77c300, e=3D0x7fffb5ebd200) at kernel/qapplication.cpp:3329
#30 0x00002b06f5b1a752 in KApplication::notify (this=3D0x7fffb5ebd680, rece=
iver=3D0x77c300, event=3D0x7fffb5ebd200) at /home/trueg/kde/dev/kde/src/4/k=
delibs/kdeui/kernel/kapplication.cpp:311
#31 0x00002b06f85b2520 in QCoreApplication::notifyInternal (this=3D0x7fffb5=
ebd680, receiver=3D0x77c300, event=3D0x7fffb5ebd200) at kernel/qcoreapplica=
tion.cpp:582
#32 0x00002b06f85b5c11 in QCoreApplication::sendEvent (receiver=3D0x77c300,=
 event=3D0x7fffb5ebd200) at ../../include/QtCore/../../src/corelib/kernel/q=
coreapplication.h:215
#33 0x00002b06f85e2432 in QTimerInfoList::activateTimers (this=3D0x627010) =
at kernel/qeventdispatcher_unix.cpp:563
#34 0x00002b06f85df49f in timerSourceDispatch (source=3D0x626fb0) at kernel=
/qeventdispatcher_glib.cpp:166
#35 0x00002b06fbb9e732 in g_main_context_dispatch () from /usr/lib/libglib-=
2.0.so.0
#36 0x00002b06fbb9ef75 in ?? () from /usr/lib/libglib-2.0.so.0
#37 0x00002b06fbb9f47b in g_main_context_iteration () from /usr/lib/libglib=
-2.0.so.0
#38 0x00002b06f85dee86 in QEventDispatcherGlib::processEvents (this=3D0x623=
8d0, flags=3D at 0x7fffb5ebd420) at kernel/qeventdispatcher_glib.cpp:325
#39 0x00002b06f91fa6c7 in QGuiEventDispatcherGlib::processEvents (this=3D0x=
6238d0, flags=3D at 0x7fffb5ebd470) at kernel/qguieventdispatcher_glib.cpp:204
#40 0x00002b06f85af48d in QEventLoop::processEvents (this=3D0x7fffb5ebd520,=
 flags=3D at 0x7fffb5ebd4d0) at kernel/qeventloop.cpp:146
#41 0x00002b06f85af61f in QEventLoop::exec (this=3D0x7fffb5ebd520, flags=3D=
@0x7fffb5ebd530) at kernel/qeventloop.cpp:193
#42 0x00002b06f85b2daa in QCoreApplication::exec () at kernel/qcoreapplicat=
ion.cpp:838
#43 0x00002b06f915d04a in QApplication::exec () at kernel/qapplication.cpp:=
3267


More information about the redland-dev mailing list