what is a segmentation fault, and why is it killing PHP on my server?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lawrence k

    #1

    what is a segmentation fault, and why is it killing PHP on my server?


    We made some changes to our server yesterday, and ever since, every
    single installation of WordPress that was on the server has stopped
    running. Other PHP scripts still run fine, but WordPress is dead.

    I logged into the server using ssh and looked the Apache error_log. The
    only thing there was a whole bunch of lines like this:

    [Fri Aug 18 18:00:25 2006] [notice] child pid 27827 exit signal
    Segmentation fault (11)


    I'm not finding any PHP errors that might tell me what is wrong with
    WordPress.

    Can anyone give me advice about what to do?

  • Andy Hassall

    #2
    Re: what is a segmentation fault, and why is it killing PHP on my server?

    On 18 Aug 2006 15:08:33 -0700, "lawrence k" <lkrubner@geoci ties.comwrote:

    Re: the subject line:



    This first hit is informative.
    >We made some changes to our server yesterday,
    What changes did you make?
    >and ever since, every
    >single installation of WordPress that was on the server has stopped
    >running. Other PHP scripts still run fine, but WordPress is dead.
    OK, so you should reverse the changes you made.

    And, this should serve as a lesson to make changes to a test server first,
    assuming this is a server where the application is worth some amount of money
    greater than zero.
    >I logged into the server using ssh and looked the Apache error_log. The
    >only thing there was a whole bunch of lines like this:
    >
    >[Fri Aug 18 18:00:25 2006] [notice] child pid 27827 exit signal
    >Segmentation fault (11)
    >
    >I'm not finding any PHP errors that might tell me what is wrong with
    >WordPress.
    >
    >Can anyone give me advice about what to do?
    PHP should never suffer a segmentation fault; if it does, then there is
    either:

    (a) a bug in PHP
    (b) a bug in a PHP extension
    (c) a bug in a library loaded by PHP core
    (d) a bug in a library loaded by a PHP extension
    (e) something bizarrely wrong with your system as a whole

    In any case:



    And to make a bug report that is possible to act on, you need a backtrace to
    identify what's causing the segfault:



    Without this it's impossible to even guess what's wrong.

    --
    Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
    http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

    Comment

    • Alvaro G. Vicario

      #3
      Re: what is a segmentation fault, and why is it killing PHP on my server?

      *** lawrence k escribió/wrote (18 Aug 2006 15:08:33 -0700):
      [Fri Aug 18 18:00:25 2006] [notice] child pid 27827 exit signal
      Segmentation fault (11)
      >
      I'm not finding any PHP errors that might tell me what is wrong with
      WordPress.
      A segfault means that the PHP interpreter crashed. It's almost certainly a
      bug or a damaged installation. WordPress code, no matter how good or bad,
      cannot do it by its own.

      You either forgot something when you did such changes to your server, or
      the new version of whatever you installed is buggy or not compatible.


      Hmmm... You aren't using Red Hat 9, are you?

      --
      -+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
      ++ Mi sitio sobre programación web: http://bits.demogracia.com
      +- Mi web de humor con rayos UVA: http://www.demogracia.com
      --

      Comment

      • lawrence k

        #4
        Re: what is a segmentation fault, and why is it killing PHP on my server?


        lawrence k wrote:
        We made some changes to our server yesterday, and ever since, every
        single installation of WordPress that was on the server has stopped
        running. Other PHP scripts still run fine, but WordPress is dead.
        >
        I logged into the server using ssh and looked the Apache error_log. The
        only thing there was a whole bunch of lines like this:
        >
        [Fri Aug 18 18:00:25 2006] [notice] child pid 27827 exit signal
        Segmentation fault (11)

        Thanks for the feedback that I got. I'm sorry if I didn't include
        enough information the first time. Here is more info:

        We have a server that we lease from Rackspace, a linux box running Red
        Hat Enterprise Linux 3. Yesterday we tried to get some e-commerce
        software going and we realized our build of PHP didn't have mhash
        installed. So we called Rackspace and asked them to rebuild our copy of
        PHP, this time including mhash. Rackspace did so. And then all of our
        WordPress blogs died.

        If you go here, you'll see that our WordPress blog is dead:



        also on the same server:



        All you'll see is what I'm echoing to the screen.

        It turns out WordPress is now dying on this line:

        $this->col_info[$i] = mysql_fetch_fie ld($this->result);

        That line is in wp-db.php (which is in the wp-includes folder).

        Other sites on our server, including PHP/MySql sites, are having no
        problem:

        accumulist.com/

        We're currently running version 4.3.2 of PHP.

        The configure command for the new build of PHP was this:

        './configure' '--host=i686-redhat-linux-gnu'
        '--build=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu'
        '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr'
        '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc'
        '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib'
        '--libexecdir=/usr/libexec' '--localstatedir=/var'
        '--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
        '--infodir=/usr/share/info' '--cache-file=../config.cache'
        '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d'
        '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic'
        '--disable-rpath' '--enable-inline-optimization' '--with-bz2'
        '--with-db4=/usr' '--with-curl' '--with-dom=/usr'
        '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr'
        '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf'
        '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv'
        '--with-mhash=/usr/lib' '--with-jpeg-dir=/usr' '--with-openssl'
        '--with-png' '--with-pspell' '--with-regex=system' '--with-xml'
        '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib'
        '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp'
        '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets'
        '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path'
        '--enable-track-vars' '--enable-trans-sid' '--enable-yp'
        '--enable-wddx' '--enable-mbstring' '--enable-mbstr-enc-trans'
        '--enable-mbregex' '--with-pear=/usr/share/pear' '--with-imap=shared'
        '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared'
        '--with-mysql=shared,/usr' '--with-pgsql=shared'
        '--with-unixODBC=shared ' '--enable-memory-limit' '--enable-bcmath'
        '--enable-shmop' '--enable-versioning' '--enable-calendar'
        '--enable-dbx' '--enable-dio' '--enable-mcal'
        '--with-apxs2filter=/usr/sbin/apxs'

        Does anyone see anything missing? I assume that
        '--with-mysql=shared,/usr' covers all the MySql stuff.

        Any ideas?

        Comment

        • lawrence k

          #5
          Re: what is a segmentation fault, and why is it killing PHP on my server?


          Andy Hassall wrote:
          On 18 Aug 2006 15:08:33 -0700, "lawrence k" <lkrubner@geoci ties.comwrote:
          I logged into the server using ssh and looked the Apache error_log. The
          only thing there was a whole bunch of lines like this:

          [Fri Aug 18 18:00:25 2006] [notice] child pid 27827 exit signal
          Segmentation fault (11)

          I'm not finding any PHP errors that might tell me what is wrong with
          WordPress.

          Can anyone give me advice about what to do?
          >
          PHP should never suffer a segmentation fault; if it does, then there is
          either:
          >
          (a) a bug in PHP
          (b) a bug in a PHP extension
          (c) a bug in a library loaded by PHP core
          (d) a bug in a library loaded by a PHP extension
          (e) something bizarrely wrong with your system as a whole

          Could something have gone wrong in the build process? If so, what? I'm
          going to call Rackspace and talk it over with them, but I'd like to do
          some research first, so I sound intelligent. But my experience building
          stuff on Linux is pretty basic.

          Comment

          • Richard Levasseur

            #6
            Re: what is a segmentation fault, and why is it killing PHP on my server?


            Andy Hassall wrote:
            On 18 Aug 2006 15:08:33 -0700, "lawrence k" <lkrubner@geoci ties.comwrote:
            >
            Re: the subject line:
            >

            >
            This first hit is informative.
            >
            We made some changes to our server yesterday,
            >
            What changes did you make?
            >
            and ever since, every
            single installation of WordPress that was on the server has stopped
            running. Other PHP scripts still run fine, but WordPress is dead.
            >
            OK, so you should reverse the changes you made.
            >
            And, this should serve as a lesson to make changes to a test server first,
            assuming this is a server where the application is worth some amount of money
            greater than zero.
            >
            I logged into the server using ssh and looked the Apache error_log. The
            only thing there was a whole bunch of lines like this:

            [Fri Aug 18 18:00:25 2006] [notice] child pid 27827 exit signal
            Segmentation fault (11)

            I'm not finding any PHP errors that might tell me what is wrong with
            WordPress.

            Can anyone give me advice about what to do?
            >
            PHP should never suffer a segmentation fault; if it does, then there is
            either:
            >
            (a) a bug in PHP
            (b) a bug in a PHP extension
            (c) a bug in a library loaded by PHP core
            (d) a bug in a library loaded by a PHP extension
            (e) something bizarrely wrong with your system as a whole
            >
            (f) Seg faults can also occur if there is too much recursion, which can
            be caused by user PHP code.

            Comment

            • Jerry Stuckle

              #7
              Re: what is a segmentation fault, and why is it killing PHP on myserver?

              Richard Levasseur wrote:
              Andy Hassall wrote:
              >
              >>On 18 Aug 2006 15:08:33 -0700, "lawrence k" <lkrubner@geoci ties.comwrote:
              >>
              >Re: the subject line:
              >>
              >http://www.google.co.uk/search?q=segmentation+fault
              >>
              >This first hit is informative.
              >>
              >>
              >>>We made some changes to our server yesterday,
              >>
              >What changes did you make?
              >>
              >>
              >>>and ever since, every
              >>>single installation of WordPress that was on the server has stopped
              >>>running. Other PHP scripts still run fine, but WordPress is dead.
              >>
              >OK, so you should reverse the changes you made.
              >>
              >And, this should serve as a lesson to make changes to a test server first,
              >>assuming this is a server where the application is worth some amount of money
              >>greater than zero.
              >>
              >>
              >>>I logged into the server using ssh and looked the Apache error_log. The
              >>>only thing there was a whole bunch of lines like this:
              >>>
              >>>[Fri Aug 18 18:00:25 2006] [notice] child pid 27827 exit signal
              >>>Segmentati on fault (11)
              >>>
              >>>I'm not finding any PHP errors that might tell me what is wrong with
              >>>WordPress.
              >>>
              >>>Can anyone give me advice about what to do?
              >>
              >PHP should never suffer a segmentation fault; if it does, then there is
              >>either:
              >>
              >(a) a bug in PHP
              >(b) a bug in a PHP extension
              >(c) a bug in a library loaded by PHP core
              >(d) a bug in a library loaded by a PHP extension
              >(e) something bizarrely wrong with your system as a whole
              >>
              >
              >
              (f) Seg faults can also occur if there is too much recursion, which can
              be caused by user PHP code.
              >
              I've also had bad PHP code cause segfaults. It shouldn't happen, but
              the interpreter isn't perfect.

              Never had good PHP code cause a segfault, so that's good enough for me :-).

              --
              =============== ===
              Remove the "x" from my email address
              Jerry Stuckle
              JDS Computer Training Corp.
              jstucklex@attgl obal.net
              =============== ===

              Comment

              • Petr Vileta

                #8
                Re: what is a segmentation fault, and why is it killing PHP on my server?

                "lawrence k" <lkrubner@geoci ties.compíse v diskusním príspevku
                news:1155954162 .827154.169910@ 74g2000cwt.goog legroups.com...
                >
                lawrence k wrote:
                [... ]
                It turns out WordPress is now dying on this line:
                >
                $this->col_info[$i] = mysql_fetch_fie ld($this->result);
                >
                Try to test mysql command out of PHP, eg. using mysql command line client.
                Is the result as you expect?
                That line is in wp-db.php (which is in the wp-includes folder).
                >
                Try to put this line into main php code without using include.

                --

                Petr Vileta, Czech republic
                (My server rejects all messages from Yahoo and Hotmail. Send me your mail
                from another non-spammer site please.)


                Comment

                • Andy Hassall

                  #9
                  Re: what is a segmentation fault, and why is it killing PHP on my server?

                  On 19 Aug 2006 04:36:42 -0700, "Richard Levasseur" <richardlev@gma il.com>
                  wrote:
                  > (a) a bug in PHP
                  > (b) a bug in a PHP extension
                  > (c) a bug in a library loaded by PHP core
                  > (d) a bug in a library loaded by a PHP extension
                  > (e) something bizarrely wrong with your system as a whole
                  >
                  >(f) Seg faults can also occur if there is too much recursion, which can
                  >be caused by user PHP code.
                  That's arguably a case of (a); the out of memory / stack overflow condition
                  should be caught and gracefully raised as a fatal error message, not as
                  segfaulting the process.

                  Although looking at bugs.php.net there's various reports of this, with the PHP
                  maintainers marking them as "Won't Fix" or "Bogus".

                  And: http://news.php.net/article.php?grou...s&article=8851

                  Admittedly, if you've already filled the stack, then calling an error handling
                  function may be a challenge ;-)

                  --
                  Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
                  http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

                  Comment

                  Working...