hi,

like promised, here's the gdb backtrace for the php4 udm_*() functions
segfault. the segfault occurs in udm_get_res_field().

first of all the minimum .php implementation for a quick search:

<?
// lets search for the word "mp3"
$q = "mp3";
if ($udmconn = udm_alloc_agent("mysql://root@localhost/w3audio/","crc-multi")) {
        udm_set_agent_param($udmconn,  UDM_PARAM_PAGE_SIZE,    10); 
        $result = udm_find($udmconn,$q);
        echo udm_get_res_param($result,UDM_PARAM_SEARCHTIME)." sek searchtime\n";
        echo udm_get_res_param($result,UDM_PARAM_FOUND)." results.\n\n";
        // give me 4 results
        $bgn = 0; $end = 3;
        while ($bgn <= $end) {
                 echo $bgn." - ";
                 echo udm_get_res_field($result,$bgn,UDM_FIELD_TITLE)."\n";
                 echo "    ".udm_get_res_field($result,$bgn,UDM_FIELD_URL)."\n\n";
        }
        udm_free_res($result);
        udm_free_agent($udmconn);
}
?>

then run it on the commandline:

# ./php test.php
0.01 sek searchtime
1407 results.

Segmentation fault

*boof*

now lets go to gdb:

# gdb ./php
(gdb) run -q test.php
Starting program: ./php -q test.php
0.01 sek searchtime
1407 results.


Program received signal SIGSEGV, Segmentation fault.
0x8066c57 in php_if_udm_get_res_field (ht=3, return_value=0x818ac7c, this_ptr=0x0, 
return_value_used=1) at php_mnogo.c:845
845                                     RETURN_STRING((Res->Doc[row].text),1);
(gdb) backtrace
#0  0x8066c57 in php_if_udm_get_res_field (ht=3, return_value=0x818ac7c, this_ptr=0x0, 
return_value_used=1) at php_mnogo.c:845
#1  0x80e5e5b in execute (op_array=0x818d2bc) at ./zend_execute.c:1489
#2  0x80c354b in zend_execute_scripts (type=8, file_count=3) at zend.c:743
#3  0x806021b in php_execute_script (primary_file=0xbffff9b8) at main.c:1196
#4  0x805e75c in main (argc=3, argv=0xbffffa34) at cgi_main.c:733
(gdb) where
#0  0x8066c57 in php_if_udm_get_res_field (ht=3, return_value=0x818ac7c, this_ptr=0x0, 
return_value_used=1) at php_mnogo.c:845
#1  0x80e5e5b in execute (op_array=0x818d2bc) at ./zend_execute.c:1489
#2  0x80c354b in zend_execute_scripts (type=8, file_count=3) at zend.c:743
#3  0x806021b in php_execute_script (primary_file=0xbffff9b8) at main.c:1196
#4  0x805e75c in main (argc=3, argv=0xbffffa34) at cgi_main.c:733
(gdb) frame 0
#0  0x8066c57 in php_if_udm_get_res_field (ht=3, return_value=0x818ac7c, this_ptr=0x0, 
return_value_used=1) at php_mnogo.c:845
845                                     RETURN_STRING((Res->Doc[row].text),1);
(gdb) print ht
$1 = 3
(gdb) print return_value
$2 = (zval *) 0x818ac7c
(gdb) print this_ptr
$3 = (zval *) 0x0
(gdb) print return_value_used
$4 = 1
(gdb) print Res
$5 = (UDM_RESULT *) 0x0
(gdb) print Res->Doc
Cannot access memory at address 0x414.
(gdb) print Res->Doc[row]
No symbol "row" in current context.
(gdb) print Res->Doc[row].text
No symbol "row" in current context.
(gdb) 

Hopefully this is a small bug and can be fixed soon. Hopefully i could
help to find it....

Please,  if  you  know  what is causing the segmentation fault, let me
know.

Thank you

Andy


___________________________________________
If you want to unsubscribe send "unsubscribe general"
to [EMAIL PROTECTED]

Reply via email to