My favorites | Sign in
Project Home Downloads
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 297: Stack space overflow when processing reStructuredText file
3 people starred this issue and may be notified of changes. Back to list
Status:  Accepted
Owner:  ----


Sign in to add a comment
 
Reported by ehetzner@gmail.com, Apr 19, 2011
What steps will reproduce the problem?

1. curl http://docutils.sourceforge.net/docs/user/rst/demo.txt | pandoc +RTS -K16m -RTS -f rst -

What is the expected output? What do you see instead?

Instead of a conversion, I get:
  Stack space overflow: current size 8388608 bytes.
  Use `+RTS -Ksize -RTS' to increase it.

Increasing the stack size does not help.

What version of the product are you using? On what operating system?
Latest installed from cabal:
  $ pandoc --version
  pandoc 1.8.1.1
  Compiled with citeproc support.
  Copyright (C) 2006-2011 John MacFarlane

  $ uname -a
  Linux traven 2.6.35-28-generic #50-Ubuntu SMP Fri Mar 18 19:00:26 UTC 2011 i686 GNU/Linux
Apr 19, 2011
#1 ehetzner@gmail.com
Oops, cut & paste errors. Stack overflow error message is from not increasing stack size. But it fails anyhow when I increase stack size to 16M.
Apr 20, 2011
Project Member #2 fiddloso...@gmail.com
I've localized the problem to the footnote references inside footnotes.  Here's a minimal test case that causes the problem:

------

[*]_

.. [*] Footnotes may also use symbols, specified with a "*" label.
   Here's a reference to the next footnote: [*]_.

.. [*] This footnote shows the next symbol in the sequence.


Status: Accepted
Apr 20, 2011
Project Member #3 fiddloso...@gmail.com
Note:  You can get a similar infinite loop in markdown using

-----

[^1]

[^1]: my note.[^1]

A quick fix (though it would not implement the whole reST spec for footnotes) would be to forbid footnote refs inside footnotes.

Apr 20, 2011
Project Member #4 fiddloso...@gmail.com
Partially resolved in b42c48e91918388e6b8eaaba36f4521441128a00
which disallows note references inside notes.

Apr 20, 2011
#5 ehetzner@gmail.com
Thanks for looking into this!
Mar 13, 2012
#6 w...@nimblebooks.com
I just encountered the same error running pandoc against a sequence of 15 moderately large html docs tmp/?.noimg.html (each ~200 K) with the following options


~/.cabal/bin/pandoc -S tmp/?.noimg.html -o $mediatargetpath$sku".epub" --toc --epub-cover-im
age="images/"$sku."png" --epub-metadata="tmp/"$sku".dc-metadata" --include-after-body=includ
es/ebook.intro.inc --include-after-body=includes/wikilicense.html

Mar 13, 2012
Project Member #7 fiddloso...@gmail.com
Note:  This bug tracker is no longer active.  Use the github tracker instead.
The corresponding issue there is
https://github.com/jgm/pandoc/issues/352
Sign in to add a comment

Powered by Google Project Hosting