Subject: | coredumps on various inputs in Perl 5.8.5 |
Date: | Tue, 01 Jul 2008 11:03:43 -0400 |
To: | bug-Text-Markdown [...] rt.cpan.org |
From: | J Chapman Flack <jflack [...] math.purdue.edu> |
This is not a duplicate of 36203, but 36203 could turn out to be a
special case of this.
I have an installation of IkiWiki, which you can think of as a wrapper
that runs Markdown on a whole bunch of files in sequence within a single
Perl instance. It has been rock solid with an older version of
Text::Markdown for over a year. I upgraded to IkiWiki 2.50 last week
(without changing the Text::Markdown version) - still rock solid.
Yesterday, I upgraded to Text::Markdown 1.0.19 to make the MultiMarkdown
features available. (Currently, nothing in my wiki /uses/ any
MultiMarkdown features, and the multimarkdown option is off in
ikiwiki.setup, so the only change is upgrading the module to 1.0.19 and
using it on a bunch of existing Markdown files that caused no problems
before.)
Now I get coredumps when rebuilding the wiki. I first noticed that the
coredump always occurred on the same wiki page, so I looked for
something in the content of that page, but nothing I changed made a
difference. I then added a shuffle() in IkiWiki::Render just to shake up
the order of rendering pages, and now it doesn't dump on the same page
every time, but it alwsys dumps on some page a ways into the list. So
I don't think any specific page content has anything to do with it. It
acts like some small cumulative data structure damage might be happening
with every page rendered until the process finally falls on its face.
When I upgraded to Text::Markdown 1.0.19 I noticed that List::MoreUtils
got installed as a new prerequisite, and includes native code - a prime
suspect when coredumps are involved. But according to the
List::MoreUtils docs, you can set LIST_MOREUTILS_PP in the environment
to have it use pure Perl implementations instead, and that doesn't
change my results, so the trouble seems to be elsewhere (or the
environment variable doesn't really do what the docs say, which I
haven't tried very hard to check).
Before I added the shuffle(), the symptom was always the same
Segmentation fault on the same file. After the shuffle, not only
does the failure occur on different files, but it can be a segfault,
a bus error, or even panic messages from Perl (nice because they'll
give a location in the Perl source). Here's a sample:
Attempt to free unreferenced scalar: SV 0xa98f18 at
.../lib/site_perl/5.8.5/Text/Markdown.pm line 997.
panic: regfree data code '' at
.../lib/site_perl/5.8.5/Text/Markdown.pm line 997.
Bus Error(coredump)
(gdb) info stack
#0 0x0008d370 in Perl_pp_entersub ()
#1 0x000843a8 in Perl_runops_standard ()
#2 0x00028ed0 in S_call_body ()
#3 0x00028bc8 in Perl_call_sv ()
#4 0x0002cbf8 in S_call_list_body ()
#5 0x0002c7e4 in Perl_call_list ()
#6 0x00058f58 in Perl_newATTRSUB ()
#7 0x00055724 in Perl_utilize ()
#8 0x0004d544 in Perl_yyparse ()
#9 0x000bb2d0 in S_doeval ()
#10 0x000bd1f0 in Perl_pp_entereval ()
#11 0x000843a8 in Perl_runops_standard ()
#12 0x000283d8 in S_run_body ()
#13 0x00027fe0 in perl_run ()
#14 0x00024c08 in main ()
Segmentation Fault(coredump)
(gdb) info stack
#0 0x0006d0a4 in Perl_pregfree ()
#1 0x000b2a18 in Perl_pp_regcomp ()
#2 0x000843a8 in Perl_runops_standard ()
#3 0x00028ed0 in S_call_body ()
#4 0x00028bc8 in Perl_call_sv ()
#5 0x0002cbf8 in S_call_list_body ()
#6 0x0002c7e4 in Perl_call_list ()
#7 0x00058f58 in Perl_newATTRSUB ()
#8 0x00055724 in Perl_utilize ()
#9 0x0004d544 in Perl_yyparse ()
#10 0x000bb2d0 in S_doeval ()
#11 0x000bd1f0 in Perl_pp_entereval ()
#12 0x000843a8 in Perl_runops_standard ()
#13 0x000283d8 in S_run_body ()
#14 0x00027fe0 in perl_run ()
#15 0x00024c08 in main ()
I haven't found any workaround so it looks like I'll have to downgrade
to get operational again.
Chapman Flack
Dept. of Mathematics
Purdue University