[plexippus-xpath-devel] issues with large xml documents

Kevin Raison raison at chatsubo.net
Wed Feb 2 00:52:41 UTC 2011


First, I want to say thanks for this xpath library;  it has kept me from 
being forced to do my work in Java!

Unfortunately, I have run into some issues when trying to handle very 
large documents.  sbcl runs out of stack space when trying simple 
queries (xpath:evaluate "c://ODM/Study" stp-doc) on a document like the 
one here http://chatsubo.net/~raison/test.xml:

Control stack exhausted (no more space for function call frames).
This is probably due to heavily nested or infinitely recursive function
calls, or a tail call that SBCL cannot or has not optimized away.

PROCEED WITH CAUTION.
    [Condition of type SB-KERNEL::CONTROL-STACK-EXHAUSTED]

Restarts:
  0: [RETRY] Retry SLIME REPL evaluation request.
  1: [*ABORT] Return to SLIME's top level.
  2: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" 
RUNNING {1003ECC601}>)

Backtrace:
   0: (SB-KERNEL::CONTROL-STACK-EXHAUSTED-ERROR)
   1: ("foreign function: call_into_lisp")
   2: ("foreign function: post_signal_tramp")
   3: (SB-IMPL::GET2 :INVALID-VALUE-FOR-UNESCAPED-REGISTER-STORAGE 
:INVALID-VALUE-FOR-UNESCAPED-REGISTER-STORAGE)
   4: (SB-C::CLASS-INFO-OR-LOSE :FUNCTION)
   5: (SB-C::TYPE-INFO-OR-LOSE :FUNCTION :DEFINITION)
   6: (SB-INT:INFO :FUNCTION :DEFINITION XPATH::AXIS-DESCENDANT-OR-SELF NIL)
   7: (SB-KERNEL:FDEFINITION-OBJECT XPATH::AXIS-DESCENDANT-OR-SELF NIL)
   8: (SB-KERNEL:%COERCE-CALLABLE-TO-FUN XPATH::AXIS-DESCENDANT-OR-SELF)
   9: (XPATH::MAPPEND-PIPE XPATH::AXIS-DESCENDANT-OR-SELF 
(#.(CXML-STP:TEXT #| :PARENT of type ELEMENT |# :DATA "\n        ") . 
#<CLOSURE # {100C2DD279}>))
  10: (XPATH::MAPPEND-PIPE ..)
  11: (XPATH::MAPPEND-PIPE ..)
  12: (XPATH::PIPE-TAIL ..)
  13: ((LAMBDA ()))
  14: (XPATH::PIPE-TAIL ..)
  15: ((LAMBDA ()))
  16: (XPATH::PIPE-TAIL ..)
  17: ((LAMBDA ()))
  18: (XPATH::PIPE-TAIL ..)
  19: ((LAMBDA ()))
  20: (XPATH::PIPE-TAIL ..)
  21: ((LAMBDA ()))
  22: (XPATH::PIPE-TAIL ..)
  23: ((LAMBDA ()))
  24: (XPATH::PIPE-TAIL ..)
  25: ((LAMBDA ()))
  26: (XPATH::PIPE-TAIL ..)
  27: (XPATH::MAPPEND-PIPE ..)

If you follow the trace, it is XPATH::MAPPEND-PIPEs all the way down. 
Any help is appreciated.  I have already tried upping my stack space 
size by a factor of 5 (to 10 megs) with no luck.

Thanks,
Kevin




More information about the plexippus-xpath-devel mailing list