[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-Modules] Nasty error with HTML::Parser 3.07



On Tue, 18 Apr 2000 12:49:57 -0500 (CDT), Matthew Langford wrote:

>I've seen this error if I try to run too many test files in one running of
>MacPerl.  If you run just the one file, it shouldn't give you the error.
>I don't know what causes it, but hopefully it will be fixed by a MacPerl
>based on 5.6 RSN.

I wouldn't count on it.

I suspect this is a bug that is present for ALL versions of Perl. Only,
on MacPerl, the interpreter program stays open after the script is run.
That makes it different from Perl on other platforms.

It also indicates that using HTML::Parser v.3.07 is NOT SAFE safe to use
under mod_perl. On any platform. That is why I cc'ed the MacPerl-Modules
mailing list -- I hope you don't mind. :-)

I believe that somewhere, very likely around the time when releasing
memory, the module is modifying some things that where already freed,
and thereby corrupting areas of Perl's memory.

The next experiment may help you, or anybody else bothering to look at
the XS source, help pinpoint the cause. Me, I'm not an XS developer.

FACT:
	If you run offset.t first, and then options.t, the second script
	will fail with a "Modification of a read-only value attempted."
	on line 12, which is the line 

	    $old = $p->boolean_attribute_value("foo");


FACT:	This DOES NOT happen the first time you run options.t after you
	run a modified version of offset.t, where you turn the
	file-scoped variables that are used in the handler, into global
	variables.

In practical words, change, in offset.t, the lines

	my $sum_len = 0;
	my $count = 0;
	my $err;

into

	use vars qw($sum_len $count $err);
	$sum_len = 0;
	$count = 0;

and the error will NOT happen the first time you run options.t.

-- 
	Bart.

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-modules-request@macperl.org