Bugs item #2860037, was opened at 2009-09-16 16:33
Message generated for change (Settings changed) made by tsheyar
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2860037&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 general
Group: Pathfinder "stable"
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Axel Belinfante (axelbel)
>Assigned to: Sjoerd Mullender (sjoerd)
Summary: fatal error: aborted too deep recursion on linux
Initial Comment:
attempting to run the attached xquery results in fatal error: aborted too deep
recursion.
replacing the call to processISBN(...) by () is sufficient to 'make it
work'.
to reproduce this, it is sufficient to add a document named eprints-export.xml
with contents
<repository/>
mclient -lx -p 51012 ./convexport-dummy.xq
MAPI = mone...@localhost:51012
QUERY = declare function processISBN($fields as element()*) as element()*
ERROR = !fatal error: aborted too deep recursion
!# halted in mil_dce.c (mil_dce_worker), line 146
this is with the aug-2009 monetdb (same with the may-2009) release,
on linux:
Linux ewi865 2.6.16.21-0.8-smp #1 SMP Mon Jul 3 18:25:39 UTC 2006 x86_64 x86_64
x86_64 GNU/Linux
----------------------------------------------------------------------
>Comment By: Jan Rittinger (tsheyar)
Date: 2009-09-28 14:55
Message:
A MIL program is internally represented as a tree. Assignments are
separated by a seq operator (that builds a sequence). As the code
generation builds programs in a left-deep manner the nesting depth in
mil_dce.c depends on the number of seq operators (and thus also indirectly
on the number of MIL code lines). The conclusion is: the bigger the
program, the deeper the nesting becomes.
In the attached example the DCE sees a nesting depth of ~12.400.
It seems awkward to me to produce 'bushy' MIL plans to stay alive longer.
A better solution would be to adjust the tree walker to handle operator seq
separately and avoid the recursion fence alltogether.
Sjoerd, do you have any favourite solution in mind?
----------------------------------------------------------------------
Comment By: Stefan Manegold (stmane)
Date: 2009-09-24 15:58
Message:
This looks like when embedded in Mserver, the pf compiler (or its
optimizer) requires more stack space (due to deep recursion) than available
to compile/optimize your query:
$ diff -du /tmp/convexport.xq /tmp/convexport-dummy.xq
--- /tmp/convexport.xq 2009-09-24 15:40:01.000000000 +0200
+++ /tmp/convexport-dummy.xq 2009-09-24 15:41:47.000000000 +0200
@@ -54,7 +54,7 @@
let $ed := processNames("editor",$fl...@name eq "editors"])
let $sup := processNames("supervisor",$fl...@name eq "supervisors"])
let $asup := processNames("assistant_supervisor",$fl...@name eq
"assistant_supervisors"])
- let $isbn := processISBN($fl...@name eq "isbn" or @name eq
"isbn_13"])
+ let $isbn := ($fl...@name eq "isbn" or @name eq
"isbn_13"])
let $ep :=
<eprint>{
$cr,$ed,$sup,$asup,$isbn,
$ pf /tmp/convexport.xq > /tmp/convexport.mil
$ wc /tmp/convexport.mil
15179 60656 537972 /tmp/convexport.mil
$ pf /tmp/convexport-dummy.xq > /tmp/convexport-dummy.mil
$ wc /tmp/convexport-dummy.mil
13515 53969 478507 /tmp/convexport-dummy.mil
$ cat /tmp/eprints-export.xml
<repository/>
$ mclient -lx
-s'pf:add-doc("/tmp/eprints-export.xml","eprints-export.xml")'
$ mclient -lx -s'doc("eprints-export.xml")'
<?xml version="1.0" encoding="utf-8"?>
<repository/>
$ pf /tmp/convexport-dummy.xq | mclient -lmil
<?xml version="1.0" encoding="utf-8"?>
<XQueryResult><repository/></XQueryResult>
$ pf /tmp/convexport.xq | mclient -lmil
<?xml version="1.0" encoding="utf-8"?>
<XQueryResult><repository/></XQueryResult>
$ mclient -lx /tmp/convexport-dummy.xq
MAPI = mone...@localhost:50000
QUERY = declare function processISBN($fields as element()*) as element()*
ERROR = !fatal error: aborted too deep recursion
!# halted in
/ufs/manegold/_/scratch0/Monet/Testing/Stable/source/pathfinder/compiler/mil/mil_dce.c
(mil_dce_worker), line 146
$ mclient -lx /tmp/convexport.xq
MAPI = mone...@localhost:50000
QUERY = declare function processISBN($fields as element()*) as element()*
ERROR = !fatal error: aborted too deep recursion
!# halted in
/ufs/manegold/_/scratch0/Monet/Testing/Stable/source/pathfinder/compiler/mil/mil_dce.c
(mil_dce_worker), line 146
Maybe Jan has some idea or comment?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2860037&group_id=56967
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs