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

Owner: Nobody in particular
Requestors: GRUBER [...]

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

Subject: [PATCH] fixing coredumps in 1.08
Download (untitled) / with headers
text/plain 770b
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 $ 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"">\n<html xmlns=" 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
Download tidy.patch
text/x-diff 717b
--- 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 [...]
Download (untitled) / with headers
text/plain 223b
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!
Download (untitled) / with headers
text/plain 119b
Hi, I second the proposed patch - it solved perl.exe crash during "make test" on my Win32/strawberry (5.10.1). -- kmx
Download (untitled) / with headers
text/plain 343b
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.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to