Bugs item #1744590, was opened at 2007-06-28 00:34
Message generated for change (Comment added) made by jvolkman
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1744590&group_id=56967
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: PF/runtime
Group: Pathfinder 0.18
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Jeremy Volkman (jvolkman)
Assigned to: Peter Boncz (boncz)
Summary: XQ: segfault in descendant step
Initial Comment:
Attached is a sample XML document and a query that causes MonetDB to segfault
at the following location:
PFll_descendant (result=0xafdf6b10, iter_bat=0x819c100, ctx_bat=0x8c5c5c0,
pre_size=0x8877840, cand_bat=0x0, _one_iter=0xafdf6b60 "",
_one_ctx=0xafdf6b70 "\001", _min_iter=0xafdf6b80, _max_iter=0xafdf6b90,
_no_iter_order=0xafdf6ba0 "\001", _kind_test=0xafdf6bb0 "\200")
at ll_staircasejoin.mx:299
299 *(oid*)dst =
*(oid*)BUNtail(iter_bat,iter);
Steps to reproduce:
1. Extract archive.
2. shred_doc(<path-to-test.xml>,"test.xml");
3. MapiClient -l x test.xq
----------------------------------------------------------------------
>Comment By: Jeremy Volkman (jvolkman)
Date: 2007-07-12 07:55
Message:
Logged In: YES
user_id=1702210
Originator: YES
Stefan,
Thanks for the follow up. The query I submitted was a result of me playing
around with MonetDB/XQuery (which is blazingly fast given a valid query).
It was indeed a mistake (I was going for ".//c" as you suggested), but as
you said an invalid/inexecutable query should not crash the server. I
suppose I should have pointed out the insanity of the query with the report
-- sorry about that. :)
-Jeremy
----------------------------------------------------------------------
Comment By: Stefan Manegold (stmane)
Date: 2007-07-12 05:15
Message:
Logged In: YES
user_id=572415
Originator: NO
Jeremy,
the segfault is due to an intermediate result of 10000*100000 = 1G
elements, i.e., 8GB/16GB (32/64 bit system), that apparently cannot be
allocated/memory-mapped.
Well, indeed, we should not crash/segfault, but give a proper error
message in that case --- investigating...
However, a closer look at your query reveals the reason for such huge
intermediate result, and rises the question, whether the query is indeed
hwat you intended:
<result>
{
count(collection("test.xml")//b[count(//c) > 2])
^^^^^^^^^^^^^^
}
</result>
Due to the asolute path (//c), "count(//c) > 2" is independant/invariant
of the context!??
Unfortunately, Pathfinder does (can?) not (yet?) recognize such invariant
and factor it our of the loop of context nodes.
Hence, normal bulk-processing in MonetDB/XQuery evaluates the //c
(yielding 100000 elements) for all 10000 //b elements in bulk
("loop-lifted"), yielding an intermediate result of 10000 * 100000 = 1G
elements as mentioned above.
In case you actually wanted to count all c elements below each b element,
replacing count(//c) by count(.//c) works just fine:
<result>
{
count(collection("test.xml")//b[count(.//c) > 2])
^
}
</result>
Stefan
----------------------------------------------------------------------
Comment By: Peter Boncz (boncz)
Date: 2007-07-03 06:06
Message:
Logged In: YES
user_id=591107
Originator: NO
renamed with XQ: convention; recategorized into Pathfinder
----------------------------------------------------------------------
Comment By: Peter Boncz (boncz)
Date: 2007-07-03 06:03
Message:
Logged In: YES
user_id=591107
Originator: NO
I will have a look at this one
----------------------------------------------------------------------
Comment By: Jeremy Volkman (jvolkman)
Date: 2007-06-28 00:37
Message:
Logged In: YES
user_id=1702210
Originator: YES
The host system is Ubuntu Linux 7.04 on an Intel Pentium M w/ 2GiB RAM
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1744590&group_id=56967
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs