Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
child pid 1789 exit signal Bus error (10)
  • I am havong this strange never seen before error and I had to go to to check Apache error_log to find it. I added new controller into my fuel app, which is just a copy of existing controller (which works). Of course when copying controller I changed the controller and file name appropriately... When I navigate to this controller index url the page doesn't display. I get browser error:
    The connection was reset
    The connection to the server was reset while the page was loading.
    The site could be temporarily unavailable or too busy. Try again in a few  moments.
    If you are unable to load any pages, check your computer's network connection.
    If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
    

    In fuel logs there is nothing. Controller's index method doesn't execute. So does not parent controller... I am going crazy after this one. I have no idea what the f*** is happening. I checked my Appache error log and this error logs every time I try to load this controller page:
    child pid 1789 exit signal Bus error (10) I tried restarting Appache, hack I even restarted computer. Went trough my code several times. Everything looks ok. Out of my reach. Can someone help me?
  • Ok following this thread I went into debugging Router class and find out that all thing crashes in this function
     protected static function parse_segments($segments, $namespace = '', $module = false)
     {
      $temp_segments = $segments;
    
      foreach (array_reverse($segments, true) as $key => $segment)
      {
       $class = $namespace.'Controller_'.\Inflector::words_to_upper(implode('_', $temp_segments));
       array_pop($temp_segments);
       if (class_exists($class))   // *** HERE IS THE CRASH *** //
       {
        return array(
         'controller'    => $class,
         'action'        => isset($segments[$key + 1]) ? $segments[$key + 1] : null,
         'method_params' => array_slice($segments, $key + 2),
        );
       }
      }
    
      // Fall back for default module controllers
      if ($module)
      {
       $class = $namespace.'Controller_'.$module;
       if (class_exists($class))
       {
        return array(
         'controller'    => $class,
         'action'        => isset($segments[0]) ? $segments[0] : null,
         'method_params' => array_slice($segments, 1),
        );
       }
      }
      return false;
     }
    
    It crashes in line if (class_exists($class)). The $class variable before this if has value "Controller_Admin_Apartments", which is the name of my controller class of-course. WTF happens here? Class exists, controller file exists in the right path.... ?!?
  • "child pid 1789 exit signal Bus error (10)" is an error related to memory, where a piece of memory is adressed that can't be accessed by Apache. This can have two major causes:
    - hardware defect. to check, run an extensive memtest on your server
    - bug in the apache code (core or one of the modules loaded) if your server has been running for quite some time without apache upgrades, I would suspect the hardware. If you have done recent apache updates, you might see if a revert fixes it.
  • Harro Verton wrote on Wednesday 11th of January 2012:
    "child pid 1789 exit signal Bus error (10)" is an error related to memory, where a piece of memory is adressed that can't be accessed by Apache. This can have two major causes:
    - hardware defect. to check, run an extensive memtest on your server
    - bug in the apache code (core or one of the modules loaded) if your server has been running for quite some time without apache upgrades, I would suspect the hardware. If you have done recent apache updates, you might see if a revert fixes it.

    This is in my local development machine:
    - no apache upgrades have been made in the last year
    - no apache configuration has been changed recently
    - it only happens in this controller which I added today Are you sure this is the only reason that can cause the problem. Why would then other controllers work? I have classes app/classes/controllers/admin/users which works without any problem. I have duplicated users into app/classes/controllers/admin/apartments and changed the controller name in php file accordingly. Users executes without any problems, the other one causes this error. Computer is running without any problems.
  • @WanWizar: I just moved the whole app to another machine to check wether this has something to do with hardware. As I was suspecting it does not! Same problem on the other machine. Why the hack would class_exists($class) crash my apache ?!
  • I honestly don't know. The framework uses class_exists($class) extensively internally, without any problems. Where exactly do you use this code? If it is in a piece of code that is being loaded by the autoloader, like _init() or __construct(), and the $class does not exist, class_exists() will trigger the autoloader to load the non-existing class, which might cause an internal PHP loop that can cause the crash. To see if this is the case, use class_exists($class, false), which does not attempt to autoload.
  • I do not use class_exists() anywhere my self. As I said in my second post I went debuggin Router class in Fuel core to see where the whole thing crashes. Look at my second post to which line of core Router class code executes and then the whole thing crashes. What I did is created new controller Controller_Admin_Apartments. If I navigate to this controller's url [url=http://localhost/myapp/public/admin/apartments]http://localhost/myapp/public/admin/apartments[/url] I get the error. And the strange thing is I also have user controllers in the same place (Controller_Admin_Users) which is totally the same except it reads different model. And if I navigate to [url=http://localhost/myapp/public/admin/users]http://localhost/myapp/public/admin/users[/url] I don't have error!! This makes me crazy, lost already 6 hours trying to find out what is happening!
    <?php
    class Controller_Admin_Apartments extends Controller_Admin 
    {
     public function action_index()
     {
      $data['apartments'] = Model_Apartment::find('all');
      $this->template->title = "Apartments";
      $this->template->content = View::forge('admin/apartments/index', $data);
     }
    }
    
  • Ok you can shoot me in the head. In Admin_Apartments controller I had this action functio
     public function action_delete($id = null)
     {
      if (apartment = Model_Apartment::find($id))
      {
       $user->delete();
    
       Session::set_flash('success', 'Deleted apartment #'.$id);
      }
      else
      {
       Session::set_flash('error', 'Could not delete apartment #'.$id);
      }
      Response::redirect('admin/apartments');
     }
    

    Note the if (apartment = Model_Apartment::find($id))!!!! I forgot $ before apartment = ... WTF?! Please shoot me! Why if Fuel not catching/logging the error here?
  • If I do that here I get
    ErrorException [ Parsing Error ]: syntax error, unexpected '='
    
    as expected...
  • Harro Verton wrote on Thursday 12th of January 2012:
    If I do that here I get
    ErrorException [ Parsing Error ]: syntax error, unexpected '='
    
    as expected...

    Whats could be wrong with my environment that I am not getting these error messages? I am using standard installation of XAMPP and my config and index.php files look ok. We already discussed this in other topic about the blank page ...
  • I haven't got a clue. I don't know XAMPP. Perhaps see if there's an update?
  • Harro Verton wrote on Thursday 12th of January 2012:
    I haven't got a clue. I don't know XAMPP. Perhaps see if there's an update?

    Installed an update, still the same though :(!
  • crazydrclaw, thank you for posting this. it's been driving me nuts since ever since i've started using fuel
  • I've added this to the troubleshooting section of the docs.
  • I get a connection reset whenever I have a syntax error as well. Any ideas? James
  • P.S. I'm running Apache 2.2.22 on FreeBSD 9. It's a pretty vanilla installation. James
  • I traced this to the same if (class_exists($class)) statement. I'm pretty sure it's an issue with autoloading. James
  • line 282 in core/autoloader.php is where I get the bus error. It's this line: include $path; Where the code for the class with the syntax error is being included. James
  • I find this very interesting: https://bugs.php.net/bug.php?id=51243 What do you guys think? James
  • I FIXED IT! It was in fact the PHP bug that I posted a little while ago that was causing the problem. It's not an issue with FuelPHP. Until the PHP bug is fixed, you'll have to disable zend-multibyte and mbstring. At least, this was an issue for me on PHP 5.3.10. Hope this helps someone, even if it's too late to help you guys :-P James

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion