|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27342 zend_fetch_debug_backtrace segfault
Submitted: 2004-02-21 05:24 UTC Modified: 2004-04-07 11:37 UTC
From: Assigned:
Status: Closed Package: Tidy (PECL)
PHP Version: 5CVS-2004-03-15 OS: linux x86_64
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:
28 - 15 = ?
Subscribe to this entry?

 [2004-02-21 05:24 UTC]
Using the given reproduce code, php segfaults.

Reproduce code:
$html = '<p>test</I>';

$config = array('foo' => 'bar');

$tidy = tidy_parse_string($html, $config);

echo tidy_config_count($tidy);

Expected result:

Actual result:
$ gdb php
GNU gdb 2003-09-20-cvs (cygwin-special)
(gdb) run tidy.php
Starting program: /cygdrive/c/php/php.exe tidy.php
---Type <return> to continue, or q <return> to quit---

Program received signal SIGSEGV, Segmentation fault.
0x1000a974 in zend_fetch_debug_backtrace () from /cygdrive/c/php/php5ts.dll


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-22 19:31 UTC]
Can not reproduce using latest tidy version and latest CVS checkout. 

 [2004-02-23 09:33 UTC]
Hi sniper!

Using latest snapshot from, I still receive a segfault:

Program received signal SIGSEGV, Segmentation fault.
0x1000a974 in zend_fetch_debug_backtrace () from /cygdrive/c/php/php5ts.dll
(gdb) bt
#0  0x1000a974 in zend_fetch_debug_backtrace ()
   from /cygdrive/c/php/php5ts.dll
#1  0x00a00350 in ?? ()
#2  0x00362718 in ?? ()
 [2004-02-23 13:20 UTC]
You need to get better backtrace. (dunno how you enable debug symbols in there)

Tidy throws an exception with your code, and seems like that somehow crashes on windows. Maybe ZTS related..dunno.

 [2004-02-24 06:36 UTC]
I've compiled PHP my self in cygwin (instead of using a snapshot from

It just outputs:
$ gdb php-debug
(gdb) run bug.php
Starting program: /home/Nuno/php5/sapi/cli/php-debug.exe bug.php

Fatal error: Uncaught exception 'tidy_exception' with message 'Unknown Tidy Conf
iguration Option 'foo'' in /home/Nuno/php5/sapi/cli/bug.php:6
Stack trace:
#0 {main}
  thrown in /home/Nuno/php5/sapi/cli/bug.php on line 6

Program exited with code 0377.
(gdb) bt
No stack.

I think this doesn't help much, but I think should distribute binaries with DEBUG symbols (as it is for debugging purposes).
It seems it only segfaults with the binary from
If you send me a snapshot with DEBUG symbols built in that machine, I may test it.
 [2004-02-24 10:00 UTC]
Just FYI, snaps box is not for debug purposes. Its "if we were 
releasing PHP today you would get this". 
 [2004-02-24 12:05 UTC]
well..then there's surely something wrong with the snaps since  those won't work but self-compiled one works? :)

 [2004-02-24 13:01 UTC]
I've compiled with Cygwin/gcc.
Maybe the problem is in the microsoft VC compiler...
 [2004-02-26 10:46 UTC]
This code also segfaults:
$tidy = tidy_parse_file('bogus.htm');

where bogus.htm file doesn't exist
 [2004-03-09 19:30 UTC]
Does not crash using latest CVS snapshot.
(neither the first script or the non-existing file test)

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Dec 03 15:05:54 2022 UTC