#48240 [Fbk->Opn]: DBA Segmentation fault dba_nextkey

From: Date: Tue, 12 May 2009 13:30:59 +0000
Subject: #48240 [Fbk->Opn]: DBA Segmentation fault dba_nextkey
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-137202@lists.php.net to get a copy of this message
ID: 48240 User updated by: VJTD3 at VJTD3 dot com Reported By: VJTD3 at VJTD3 dot com -Status: Feedback +Status: Open Bug Type: DBM/DBA related Operating System: linux redhat fedora 10 PHP Version: 5.2.9 New Comment: <?php $dba = dba_open('database', 'c', 'db4'); dba_insert('php', 'crashed', $dba); $key = dba_nextkey($dba); echo $key.':'.dba_fetch($key, $dba)."\n"; ?> that alone will seg fault. it's happens on any database driver when dba_nextkey is used before dba_firstkey. that snippet will create a fresh database and crash to test easier. Previous Comments: ------------------------------------------------------------------------ [2009-05-12 05:25:49] jani@php.net Could you provide a test db (or does this happen with any?) somewhere? And/or a gdb backtrace of the crash? ------------------------------------------------------------------------ [2009-05-12 03:29:22] VJTD3 at VJTD3 dot com Description: ------------ DBA Segmentation fault on function dba_nextkey without dba_firstkey before dba_nextkey. Reproduce code: --------------- ./configure --enable-dba --with-db4 --disable-libxml --disable-dom --disable-simplexml --disable-libxml --disable-xml --disable-xmlreader --disable-xmlwriter --without-pear <?php $dba = dba_open('database', 'r', 'db4'); $key = dba_nextkey($dba); echo $key.':'.dba_fetch($key, $dba)."\n"; ?> db4-4.7.25-7 Expected result: ---------------- the first key by default or at least a error vs seg fault. (yes, i know dba_firstkey should be before dba_nextkey however segfaults are probably not a good reaction, defaulting to the first record or a error is better...) Actual result: -------------- seg fault ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48240&edit=1

« previous php.bugs (#137202) next »