Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the HTML-Tidy CPAN distribution.

Report information
The Basics
Id: 29593
Status: resolved
Priority: 0/
Queue: HTML-Tidy

People
Owner: Nobody in particular
Requestors: GRUBER [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.08
Fixed in: (no value)



Subject: [PATCH] fixing coredumps in 1.08
It looks like Tidy.xs does not initializes libtidy's buffers correctly, which sometimes leads to segfaults. Please note that the presense of the segfault might or might not depend on the particular OS malloc(3) implementation, so "I cannot reproduce it, case closed" is not welcome. The code is still buggy. A simple case to reproduce this problem was produced by lbr@freebsd.org: $ perl -e 'use Test::HTML::Tidy tests=>1; html_tidy_ok(qq{<?xml version="1.0" encoding="utf-8"?>\n<\!DOCTYPE html PUBLIC "-//W3C//DTD XHTML1.1//EN"\n"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n<html xmlns="http://www.w3.org/1999/ xhtml"\nxml:lang="en">\n<head><title>test</title></head><body>output</ Show quoted text
body></html>}, "");'
Please see attached patch for a fix. Cheers, \Anton.
Subject: tidy.patch
--- Tidy.xs.orig 2007-09-24 11:36:19.000000000 +0200 +++ Tidy.xs 2007-09-24 11:37:42.000000000 +0200 @@ -55,6 +55,7 @@ _tidy_messages(input, configfile, tidy_o const char* newline; int rc = 0; PPCODE: + tidyBufInit(&errbuf); rc = ( tidyOptSetValue( tdoc, TidyCharEncoding, "utf8" ) ? rc : -1 ); if ( (rc >= 0 ) && configfile && *configfile ) { @@ -117,6 +118,8 @@ _tidy_clean(input, configfile, tidy_opti const char* newline; int rc = 0; PPCODE: + tidyBufInit(&output); + tidyBufInit(&errbuf); /* Set our default first. */ /* Don't word-wrap */ rc = ( tidyOptSetInt( tdoc, TidyWrapLen, 0 ) ? rc : -1 );
From: matt [...] bodgit-n-scarper.com
Just a comment to say this patch fixed it for me trying to build 1.08 on CentOS 5 x86_64 using the version of libtidy shipped with Fedora 7. Without the patch HTML::Tidy won't pass its own tests, with the patch, all okay.
work for me too. fixes "Segmentation fault" on Debian with libtidy-dev_20081224cvs. thank you!
Hi, I second the proposed patch - it solved perl.exe crash during "make test" on my Win32/strawberry (5.10.1). -- kmx
On Fri Oct 02 06:51:28 2009, KMX wrote: Show quoted text
> Hi, > > I second the proposed patch - it solved perl.exe crash during "make > test" on my Win32/strawberry (5.10.1).
I've now used this patch successfully on about half a dozen versions of Fedora and Centos. Andy, any chance that you can package it up and do a new CPAN release? Cheers, Dave...
No longer relevant.