Segmentation fault on Data Load

thread: 10 messages  |  last: about 7 years ago  |  started: tuesday, january 10, 2012, 2:35 pm pst


#1  |  nick leung (Milpitas, CA) United States of America
Tuesday, January 10, 2012, 2:35 PM PST

I set up a new server and when I try to load the schools, I get a segmentation fault.
I mean School::LoadAll() should come from the standard codegen.
Any ideas?
Thanks!
Nick

<code>

$objSchoolArray = School::LoadAll(); //<---I get the segmentation fault here.


</code>

#2  |  Mike Ho (San Diego, CA) United States of America Qcodo Administrator
Tuesday, January 10, 2012, 3:00 PM PST

How many rows do you have in your school table?

Also, waht do you mean by “segmentation fault”?  Are you running the PHP script as a CLI and thus you're getting a segmentation fault?

Or are you running the script in a PHP script, and you're actually seeing the fcgi or apache process crash?

If it's the latter, there might also be things in the httpd access log that could help with debugging.

#3  |  nick leung (Milpitas, CA) United States of America
Tuesday, January 10, 2012, 3:08 PM PST

I have about 2000 rows in the school table.
I get a segmentation fault both running it as a CLI and php scripting and seeing the fcgi apache process crash.
It would output 'Segmentation Fault' in the CLI prompt.

In the httpd error log I get the following error:
[Tue Jan 10 14:52:42 2012] [notice] child pid 3631 exit signal Segmentation fault (11)

Any help would be greatly appreciated Mike!

#4  |  Mike Ho (San Diego, CA) United States of America Qcodo Administrator
Tuesday, January 10, 2012, 3:12 PM PST

Hmm... strange.  What if you loaded each school at a time?  Do you get an error?

Also, what happens if you do a QQ::All() query and stuff it into a cursor?

e.g.

<?php
    $objCursor 
School::QueryCursor(QQ::All());
    while (
$objSchool School::InsantiateCursor($objCursor)) {
        print(
$objSchool->Id "\r\n");
    }
?>

Let me know...

#5  |  nick leung (Milpitas, CA) United States of America
Tuesday, January 10, 2012, 3:25 PM PST

When I load one school, I still get a segmentation fault:
$objSchool = School::LoadById(1);
echo “SchoolName: " . $objSchool->Name . “\n”;

Also tried putting it into a cursor, but the InsantiateCursor method is not defined.

#6  |  nick leung (Milpitas, CA) United States of America
Tuesday, January 10, 2012, 4:33 PM PST

Do you think there might be configuration I'm missing?
I even created a raw php mysql php script to see if I could grab the data, the raw script was able to output data from the database.

Here's the raw script
<?php
$con = mysql_connect(“localhost”,”root”,””);
if (!$con)
 {
 die('Could not connect: ' . mysql_error());
 }

mysql_select_db(“uloop_prod”, $con);

$result = mysql_query(“SELECT * FROM person limit 10”);

while($row = mysql_fetch_array($result))
 {
 echo $row['first_name'] . " " . $row['last_name'];
 echo “\n”;
 }

mysql_close($con);

?>

#7  |  Mike Ho (San Diego, CA) United States of America Qcodo Administrator
Tuesday, January 10, 2012, 4:50 PM PST

Not sure... can you figure out which line actually throws the seg fault?

You may need to start putting echo() statements throughout your gen code to find out.

Also, it sounds like you're still on the v0.3.x version of qcodo... if so, note that there are several things that are incompatible with 5.3.x of PHP.

So your options at that point are to stick with 5.2.x of PHP or upgarde to v0.4.x of Qcodo.  Just a thought.

#8  |  ryanmac (Mountain View, CA) United States of America
Tuesday, January 10, 2012, 8:43 PM PST

We're using php 5.2.5.  But upgrading to Qcodo 0.4.x and php 5.3.x is on the roadmap.

#9  |  nick leung (Milpitas, CA) United States of America
Wednesday, January 11, 2012, 4:15 PM PST

The problem was a mysqli
headers and client library versions were mismatched.
We found out the problem by viewing the phpinfo.
The fix was to remove mysql totally and re-installing it.

#10  |  Mike Ho (San Diego, CA) United States of America Qcodo Administrator
Wednesday, January 11, 2012, 8:48 PM PST

Are you guys still using CentOS?  I typically use YUM to install most of the binaries from RPM, and the only thing I custom compile is PHP...

If you guys are still with MediaTemple, I've got a pretty decent build script for their (ve) line of virtual servers.  I've got a number of clients using it...



Copyright © 2005 - 2019, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.