socmap / pandoc

Automatically exported from code.google.com/p/pandoc
GNU General Public License v2.0
0 stars 0 forks source link

Stack space overflow when processing reStructuredText file #297

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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

Original issue reported on code.google.com by ehetzner@gmail.com on 20 Apr 2011 at 5:53

GoogleCodeExporter commented 8 years ago
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.

Original comment by ehetzner@gmail.com on 20 Apr 2011 at 5:54

GoogleCodeExporter commented 8 years ago
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.

Original comment by fiddloso...@gmail.com on 20 Apr 2011 at 6:05

GoogleCodeExporter commented 8 years ago
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.

Original comment by fiddloso...@gmail.com on 20 Apr 2011 at 6:11

GoogleCodeExporter commented 8 years ago
Partially resolved in b42c48e91918388e6b8eaaba36f4521441128a00
which disallows note references inside notes.

Original comment by fiddloso...@gmail.com on 20 Apr 2011 at 6:44

GoogleCodeExporter commented 8 years ago
Thanks for looking into this!

Original comment by ehetzner@gmail.com on 20 Apr 2011 at 6:55

GoogleCodeExporter commented 8 years ago
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

Original comment by w...@nimblebooks.com on 13 Mar 2012 at 5:00

GoogleCodeExporter commented 8 years ago
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

Original comment by fiddloso...@gmail.com on 13 Mar 2012 at 5:06