#34623 [Fbk->Opn]: Segfault when selecting 'longtext' field with pdo/mysql

From: Date: Wed, 28 Sep 2005 22:18:07 +0000
Subject: #34623 [Fbk->Opn]: Segfault when selecting 'longtext' field with pdo/mysql
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85745@lists.php.net to get a copy of this message
 ID:               34623
 User updated by:  stewey at ambitious dot ca
 Reported By:      stewey at ambitious dot ca
-Status:           Feedback
+Status:           Open
 Bug Type:         PDO related
 Operating System: Mac OS X 10.4.2
 PHP Version:      5CVS-2005-09-27 (snap)
 New Comment:

No valgrind on my system :(  A brief look around suggests it 
isn't available (won't build?) on OS X.  If you know 
otherwise, or if there's an alternative tool for OS X, please 
let me know.


Previous Comments:
------------------------------------------------------------------------

[2005-09-29 00:06:46] tony2001@php.net

And what does valgrind say about it?
valgrind --tool=memcheck --leak-check=yes --num-callers=30 php
/path/to/your/script.php

------------------------------------------------------------------------

[2005-09-28 23:44:37] stewey at ambitious dot ca

Hope this helps...


(gdb) p *stmt
$1 = {
  ce = 0x712f6461, 
  properties = 0x74615f69, 
  in_get = 0, 
  in_set = 1, 
  methods = 0x72697479, 
  driver_data = 0x2f696e64, 
  executed = 0, 
  supports_placeholders = 3, 
  _reserved = 91762280, 
  column_count = 1953328163, 
  columns = 0x646f776e, 
  database_object_handle = {
    value = {
      lval = 1735549284, 
      dval = 2.0473549222889057e+190, 
      str = {
        val = 0x67726164 <Address 0x67726164 out of bounds>, 
        len = 1696742984
      }, 
      ht = 0x67726164, 
      obj = {
        handle = 1735549284, 
        handlers = 0x65223e48
      }
    }, 
    refcount = 1870078052, 
    type = 111 'o', 
    is_ref = 32 ' '
  }, 
  dbh = 0x646f776e, 
  bound_params = 0x67726164, 
  bound_param_map = 0x65206120, 
  bound_columns = 0x63686563, 
  row_count = 1802530665, 
  query_string = 0x6e742073 <Address 0x6e742073 out of 
bounds>, 
  query_stringlen = 1864397928, 
  active_query_string = 0x61742061 <Address 0x61742061 out 
of bounds>, 
  active_query_stringlen = 1847616865, 
  error_code = "rlier ", 
  lazy_object_ref = {
    value = {
      lval = 1920361842, 
      dval = 2.3894187096828918e+243, 
      str = {
        val = 0x72766572 <Address 0x72766572 out of bounds>, 
        len = 537725472
      }, 
      ht = 0x72766572, 
      obj = {
        handle = 1920361842, 
        handlers = 0x200d0a20
      }
    }, 
    refcount = 538976355, 
    type = 97 'a', 
    is_ref = 110 'n'
  }, 
  refcount = 1700881440, 
  default_fetch_type = 1769226044, 
  fetch = {
    column = 794902048, 
    cls = {
      ce = 0x2f613e20, 
      ctor_args = 0xd0a2020, 
      retval_ptr = 0x3c6c693e, 
      fci = {
        size = 1012998248, 
        function_table = 0x7265663d, 
        function_name = 0x22687474, 
        symbol_table = 0x703a2f2f, 
        retval_ptr_ptr = 0x636f6d70, 
        param_count = 1970562418, 
        params = 0x2f646570, 
        object_pp = 0x6f742f69, 
        no_separation = 110 'n'
      }, 
      fcc = {
        initialized = 110 'n', 
        function_handler = 0x74732f66, 
        calling_scope = 0x61712f64, 
        object_pp = 0x6174615f
      }
    }, 
    func = {
      function = 0x2f613e20, 
      fetch_args = 0xd0a2020, 
      object = 0x3c6c693e, 
      fci = {
        size = 1012998248, 
        function_table = 0x7265663d, 
        function_name = 0x22687474, 
        symbol_table = 0x703a2f2f, 
        retval_ptr_ptr = 0x636f6d70, 
        param_count = 1970562418, 
        params = 0x2f646570, 
        object_pp = 0x6f742f69, 
        no_separation = 110 'n'
      }, 
      fcc = {
        initialized = 110 'n', 
        function_handler = 0x74732f66, 
        calling_scope = 0x61712f64, 
        object_pp = 0x6174615f
      }, 
      values = 0x696e7465
    }, 
    into = 0x2f613e20
  }, 
  named_rewrite_template = 0x67726974 <Address 0x67726974 
out of bounds>
}
(gdb) p *stmt->methods
Cannot access memory at address 0x72697479

------------------------------------------------------------------------

[2005-09-28 23:36:56] tony2001@php.net

Still no luck in reproducing it.
Please do the following in gdb (when you got the backtrace):
gdb> p *stmt
gdb> p *stmt->methods
and paste results here.

------------------------------------------------------------------------

[2005-09-28 23:13:47] stewey at ambitious dot ca

Changing summary to read 'longtext'.

------------------------------------------------------------------------

[2005-09-28 23:11:46] stewey at ambitious dot ca

It's actually a 'longtext'. I'm very sorry for the 
misinformation. To the obvious question: yes, this makes the 
difference. If it's 'text', no problem, longtext = segfault. 
Again, I'm sorry.

Yes, I can repro via the CLI. Would you like a backtrace of 
that?


CREATE TABLE article (
  articleId int(10) unsigned NOT NULL auto_increment,
  parentId int(10) unsigned NOT NULL default '0',
  templateId int(10) unsigned NOT NULL default '0',
  title varchar(100) NOT NULL default '',
  subTitle varchar(255) default NULL,
  text longtext NOT NULL,
  creationTime timestamp NULL default NULL,
  modificationTime timestamp NULL default 
CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  state enum('Online','Offline') NOT NULL default 
'Online',
  audience enum('Private','Public') NOT NULL default 
'Private',
  childSortOrder enum
('Title','Date','Popularity','Arbitrary') NOT NULL default 
'Title',
  sortWeight int(11) NOT NULL default '0',
  PRIMARY KEY  (articleId),
  KEY parentId (parentId,templateId),
  FULLTEXT KEY title (title,subTitle,text)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/34623

-- 
Edit this bug report at http://bugs.php.net/?id=34623&edit=1


Thread (21 messages)

« previous php.bugs (#85745) next »