|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28578 segfault when tidy parses PHP code
Submitted: 2004-05-30 14:14 UTC Modified: 2004-07-15 16:57 UTC
Avg. Score:2.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: Assigned: john (profile)
Status: Closed Package: Tidy (PECL)
PHP Version: 5CVS-2004-05-30 (dev) OS: win
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
47 - 18 = ?
Subscribe to this entry?

 [2004-05-30 14:14 UTC]
Using the provided script, PHP segfaults.

Reproduce code:
$tidy = tidy_parse_string('<? ?>');


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-30 22:35 UTC] jed at jed dot bz
PHP 5.0.0RC2. Run via CLI.

I was able to reproduce this bug. My gut feeling, which I will check after I submit this debug info (I have the debugger attached at present), is that <?php ?> will parse correctly.

Unhandled exception in php.exe (PHP_TIDY.DLL): 0xC00000005: Access Violation.

Unfortunately, I do not have the debug build of PHP. Best I can offer you is this:

PHP_TIDY! 00ab93fe()

That's my call stack. Sorry. I'll get the debug version of PHP and recheck this later, if I remember.

Rechecking my initial gut suspicion, this piece of code works fine.

$tidy = tidy_parse_string('<?php ?>');

My advice at present is to not use short tags in tidy-parsed code, as tidy's logic probably does not recognize <? ?> and attempts to parse it.

However, a worthy problem for looking into.
 [2004-05-30 22:36 UTC] jed at jed dot bz
Heh, sorry. That would be 0xC0000005.
 [2004-05-31 12:17 UTC]
Works for me on linux, assigning to the maintainer.
 [2004-05-31 15:16 UTC]
I've built PHP with latest tidy lib on cygwin and it doesn't segfault.
The problem can be in the libTidy itself, as the binaries provided by the snaps machine use a very old version of the libTidy.
 [2004-06-24 19:02 UTC]
I've found this is a libtidy problem!
More info at:

The problem is that the windows binnaries use a old version of libtidy and still contain that error. Maybe its time to update this lib (it compiles in 5 minutes...)
 [2004-07-15 16:57 UTC]
Edin has updated the libtidy and the problem is solved.

Many thanks!
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Nov 27 08:05:54 2022 UTC