php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12099 SIGSEGV bug in module sablotron
Submitted: 2001-07-12 08:11 UTC Modified: 2001-07-30 18:02 UTC
From: hulinsky at datasec dot cz Assigned:
Status: Closed Package: Sablotron XSL
PHP Version: 4.0CVS-2001-07-12 OS: Debian Linux (testing)
Private report: No CVE-ID: None
 [2001-07-12 08:11 UTC] hulinsky at datasec dot cz
SIGSEGV in sablotron module

gdb ./httpd -X
(gdb) run -X
Starting program: ./httpd -X
Program received signal SIGSEGV, Segmentation fault.
0x811824c in _efree (ptr=0x5a5a5a5a, __zend_filename=0x81a6560 "sablot.c",
    __zend_lineno=1380, __zend_orig_filename=0x0, __zend_orig_lineno=0)
    at zend_alloc.c:212
212             CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size);

#0  0x811824c in _efree (ptr=0x5a5a5a5a, __zend_filename=0x81a6560 "sablot.c",
    __zend_lineno=1380, __zend_orig_filename=0x0, __zend_orig_lineno=0)
    at zend_alloc.c:212
#1  0x80a352d in _php_sablot_error (userData=0x0, p=0x82b2280, code=76,
    level=MH_LEVEL_INFO, fields=0x8348b38) at sablot.c:1380
#2  0x4009c47d in Situation::generateMessage (this=0x82b2218, type=MT_LOG,
    code=L1_PARSING, arg1=@0x829c388, arg2=@0xbfffe050, theMessage=@0xbfffdf80)
    at situa.cpp:278
#3  0x4009c952 in Situation::message (this=0x82b2218, type=MT_LOG,
    code=L1_PARSING, arg1=@0x829c388, arg2=@0xbfffe050) at situa.cpp:343
#4  0x4009f406 in Tree::report (this=0x829c380, S=@0x82b2218, type=MT_LOG,
    code=L1_PARSING, arg1=@0x829c388, arg2=@0xbfffe050) at tree.cpp:458
#4  0x4009f406 in Tree::report (this=0x829c380, S=@0x82b2218, type=MT_LOG,
    code=L1_PARSING, arg1=@0x829c388, arg2=@0xbfffe050) at tree.cpp:458
#5  0x4009fb8d in Tree::parse (this=0x829c380, S=@0x82b2218, d=0x82dad60)
    at tree.cpp:563
#6  0x400939c8 in Processor::addLineParse (this=0x82b2280, S=@0x82b2218,
    newTree=@0x82b2284, absolute=@0xbfffe0e0, isXSL=1) at proc.cpp:549
#7  0x40093f7f in Processor::readTreeFromURI (this=0x82b2280, S=@0x82b2218,
    newTree=@0x82b2284, location=@0xbfffe180, base=@0xbfffe168, isXSL=1)
    at proc.cpp:594
#8  0x40091f71 in Processor::open (this=0x82b2280, S=@0x82b2218,
    sheetURI=0x82d2434 "/rscr/www/base/rscr/style/rz-program.xsl",
    inputURI=0x82d267c "arg:/input") at proc.cpp:270
#9  0x4009752f in SablotRunProcessor (processor_=0x82b2280,
    sheetURI=0x82d2434 "/rscr/www/base/rscr/style/rz-program.xsl",
    inputURI=0x82d267c "arg:/input", resultURI=0x82d26fc "arg:/_result",
    params=0x0, arguments=0x82d285c) at sablot.cpp:399
#10 0x80a0cfe in php_if_xslt_transform (ht=6, return_value=0x82d281c,
    this_ptr=0x0, return_value_used=0) at sablot.c:458
#11 0x814c57a in execute (op_array=0x82461cc) at ./zend_execute.c:1573
#12 0x8128ee4 in zend_execute_scripts (type=8, file_count=3) at zend.c:750
#13 0x807b86f in php_execute_script (primary_file=0xbffff818) at main.c:1277
#14 0x813ae5c in apache_php_module_main (r=0x8288824, display_source_mode=0)
    at sapi_apache.c:90
#15 0x80783f2 in send_php ()
#16 0x807842a in send_parsed_php ()
#17 0x8162169 in ap_invoke_handler ()
#18 0x8176acf in process_request_internal ()
#19 0x8176b36 in ap_process_request ()
#20 0x816da56 in child_main ()
#21 0x816dc11 in make_child ()
#22 0x816dd8c in startup_children ()
#23 0x816e3fc in standalone_main ()
#24 0x816ec2c in main ()
#25 0x4027a2db in __libc_start_main () from /lib/libc.so.6

--- php-error.log ---

Last leak repeated 23 times
zend_hash.c(1027) :  Freeing 0x0834A5E4 (7 bytes), script=/rscr/www/appserv/schema.html
sablot.c(1397) :  Freeing 0x08328244 (12 bytes), script=/rscr/www/appserv/schema.html
Last leak repeated 23 times
zend_hash.c(1027) :  Freeing 0x082E1DDC (7 bytes), script=/rscr/www/appserv/schema.html

--- apache ----
Server version: Apache/1.3.20 (Unix)
Server built:   Jul 12 2001 13:23:37
./src/httpd -l
Compiled-in modules:
  http_core.c
  mod_log_config.c
  mod_mime.c
  mod_status.c
  mod_alias.c
  mod_rewrite.c
  mod_access.c
  mod_auth.c
  mod_php4.c
  mod_gzip.c

--- php ---
PHP4.0.7-dev (last CVS)
./configure --prefix=/rscr/appserv \
                --with-apache=../apache_1.3.20 \
                --with-config-file-path=/rscr/appserv/conf \
                --with-regex=system \
                --enable-debug \
                --without-pcre-regex \
                --disable-rpath \
                --disable-session \
                --enable-memory-limit \
                --enable-sysvsem \
                --enable-sysvshm \
                --enable-shmop \
                --enable-track-vars \
                --enable-ctype \
                --enable-sockets \
                --without-pgsql \
                --with-sablot=/usr \
                --with-dom=/usr \
                --with-mysql=/usr \                --with-iconv=/usr \
                --with-ming=/usr \
                --with-zlib=/usr

--- last CVS change ---
/sablot.c/1.40/Sun Jun 24 17:50:16 2001//
I mean, look at this last change in sablot.c. It is a problem.

*** sablot/sablot.c     Thu May 24 14:42:05 2001
--- sablot.NEW/sablot.c Sun Jun 24 19:50:16 2001
***************
*** 80,93 ****
  /* ERROR Macros */

  #define SABLOT_FREE_ERROR_HANDLE(__handle)                \
!     if ((__handle).errors) {                              \
!         (__handle).errors = (__handle).errors_start.next; \
!         while ((__handle).errors) {                       \
!             S_FREE((__handle).errors->key);               \
!             S_FREE((__handle).errors->value);             \
!             (__handle).errors = (__handle).errors->next;  \
          }                                                 \
-         S_FREE((__handle).errors);                        \

      }


--- 80,97 ----
  /* ERROR Macros */

  #define SABLOT_FREE_ERROR_HANDLE(__handle)                \
!     if ((__handle).errors) { \
!               struct _php_sablot_error *current = (__handle).errors; \
!               struct _php_sablot_error *next; \
!               \
!         current = (__handle).errors_start.next; \
!         while (current != NULL) {                       \
!                       next = current->next; \
!             S_FREE(current->key);               \
!             S_FREE(current->value);             \
!                       S_FREE(current); \
!             current = next;  \
          }                                                 \
      }

<?
require "appserv.cfg";
require "db.cfg";
require $lib_dir."appserv.lib";
require $lib_dir."Schema.class";

$fp = fopen("/tmp/schema.xml", "r");
while(!feof($fp)) {
  $buf .= fread($fp, 100);
}

echo "<pre>".htmlentities($buf)."</pre>";

$parser = xslt_create();
$xsl_file = "/tmp/rz-program.xsl";
$args = array("input" => $buf);
xslt_transform($xsl_file, "arg:/input", "arg:/_result", null, $args, $result);

echo $result;
?>

schema.xml and rz-program.xsl can be any xml and xsl file.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-30 17:21 UTC] sterling@php.net
All current development is being focused on the XSLT 
module (--enable-xslt --with-xslt-sablot).  Please upgrade 
to the latest CVS and use that extension.

 [2001-07-30 17:50 UTC] sterling@php.net
I will remember to change the status.
I will remember to change the status.
I will remember to change the status.
I will remember to change the status.
I will remember to change the status.
I will remember to change the status.
I will remember to change the status.
I will remember to change the status.
I will remember to change the status.
I will remember to change the status.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 24 02:01:32 2024 UTC