473,507 Members | 2,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Seg fault in PHP 5.0.3

Hello,

The following code causes a segmentation fault in PHP 5.0.3 debian package
from dotdeb.org

public static function allreadyInDatabase( $location ) {
$sql = "SELECT COUNT(*) FROM prefix_search WHERE location = :1";
$db = DB_Mysql_Singleton::getInstance();
$stm = $db->prepare( $sql );
$res = $stm->execute( $location );
return ( $res->getOne() == 1 );
}

log output:
/var/log/apache/error.log:
[Tue Dec 28 09:54:26 2004] [notice] child pid 6895 exit signal Segmentation
fault (11)

I have located the error, it should be the last line. I can do an echo
$res->getOne() and it will print 0. I can do $num = $res->getOne(); and it
will work.
Even this will work:

....
if( $res->getOne() == 1 ) {
die( "yes" );
} else {
die( "no" );
}

will print "no". But if I change it to

....
if( $res->getOne() == 1 ) {
return true;
} else {
return false;
}

it breaks. I've checked the location where the function is called.

It doesn't change a thing if I use the function in any way:
$bool = search_SearchSink::allreadyInDatabase( $location );

search_SearchSink::allreadyInDatabase( $location );

return search_SearchSink::allreadyInDatabase( $location );

if( search_SearchSink::allreadyInDatabase( $location ) ) {
...

It allways breaks... Is there any way to find the exact error, Get more log
info. Is this a known bug? Should I report it? If so, do I send all my
code?

Thanks in advance,
Rutger Claes
--
Rutger Claes rg*@rgc.tld
Replace tld with top level domain of belgium to contact me pgp:0x3B7D6BD6
The reason computer chips are so small is computers don't eat much.

Jul 17 '05 #1
0 1212

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
11383
by: Zheng Da | last post by:
Program received signal SIGSEGV, Segmentation fault. 0x40093343 in _int_malloc () from /lib/tls/libc.so.6 (gdb) bt #0 0x40093343 in _int_malloc () from /lib/tls/libc.so.6 #1 0x40094c54 in malloc...
5
2979
by: Fra-it | last post by:
Hi everybody, I'm trying to make the following code running properly, but I can't get rid of the "SEGMENTATION FAULT" error message when executing. Reading some messages posted earlier, I...
0
4066
by: Matt S | last post by:
Hello, I'm trying to build a C# client to consume an AXIS Web Service (running SOAP over HTTP). The Web Service encodes full server-side exception traces in the Soap Fault > Detail element...
3
4228
by: Moshe Kravchik | last post by:
Hi! We have a Web Service written in ATL Server and a client written in Java using Axis. When something goes wrong on the server side, it returns an HRESULT of the error which is translated into...
0
1288
by: relaxedrob | last post by:
Hi All, I have a portType such as this: <portType name="CMLeJobSoapGetEmpBrand"> <operation name="EJobGetEmpBrand"> <input message="tns:EJobEmpBrdReq" name="EJobEmpBrdReq"/> <output...
27
3318
by: Paminu | last post by:
I have a wierd problem. In my main function I print "test" as the first thing. But if I run the call to node_alloc AFTER the printf call I get a segmentation fault and test is not printed! ...
7
5859
by: pycraze | last post by:
I would like to ask a question. How do one handle the exception due to Segmentation fault due to Python ? Our bit operations and arithmetic manipulations are written in C and to some of our...
3
5134
by: madunix | last post by:
My Server is suffering bad lag (High Utlization) I am running on that server Oracle10g with apache_1.3.35/ php-4.4.2 Web visitors retrieve data from the web by php calls through oci cobnnection...
0
1638
by: Equinex | last post by:
Hi, I am trying to call a Web Service using Php and Soap. Why does the following Php 5 code return? try { //$ExchangeLoginResult = $ExchangeClient->Login(array("request" =>
3
7551
by: =?Utf-8?B?TWFucHJlZXQgU3VzaGls?= | last post by:
I am having a Webservice within which i am throwing SOAP Exceptions and therefore whenever something wrong happens a SOAP fault comes up in the response - see below: <?xml version="1.0"...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7114
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7034
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5045
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.