Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Jan 2013 23:45:13 +0100 (CET)
From:      Slaven Rezic <slaven@rezic.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/174917: p5-XML-Twig and p5-XML-LibXML coexistence problem
Message-ID:  <201301022245.r02MjD9d021061@cvrsnica.herceg.de>
Resent-Message-ID: <201301022250.r02Mo1gs076912@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         174917
>Category:       ports
>Synopsis:       p5-XML-Twig and p5-XML-LibXML coexistence problem
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 02 22:50:01 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Slaven Rezic
>Release:        FreeBSD 9.0-RELEASE amd64
>Organization:
www.rezic.de
>Environment:
System: FreeBSD cvrsnica.herceg.de 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:46:30 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64

	Also happens on a 9.1-RELEASE system.

	All components here (perl, p5-XML-LibXML, p5-XML-Twig) are installed
	using packages.
	
>Description:
	A perl script which uses both XML::LibXML and XML::Twig may
	segfault when dealing with larger XML structures.

	The script below reproduces the problem. The segfault goes
	away if the "use XML::LibXML" line is removed (note that no
	XML::LibXML calls are used here at all) or if the number of
	generated elements is lowered from 20000 to 10000.

	gdb shows a very long stacktrace, with many 1000 frames.

>How-To-Repeat:
	
#!/usr/bin/perl -w

use strict;
use XML::LibXML;
use XML::Twig;

{
    my $twig = XML::Twig->new;
    my $gpx = XML::Twig::Elt->new('gpx');
    $twig->set_root($gpx);
    my $trkxml = XML::Twig::Elt->new("trk");
    $trkxml->paste(last_child => $gpx);
    for (1..20000) {
	my $trksegxml = XML::Twig::Elt->new("trkseg");
	$trksegxml->paste(last_child => $trkxml);
    }
}

__END__

>Fix:

	Not known.
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301022245.r02MjD9d021061>