The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Segmentation fault and bus error in Apache 2.2

Discussion in 'EasyApache' started by anithegregorian, Mar 24, 2015.

  1. anithegregorian

    anithegregorian Registered

    Joined:
    Dec 25, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I'm using Easy Apache v3.28.4 on CentOS 6.4 x86_64 to build Apache and PHP. My installation profile is:

    Code:
    ---
    "Apache":
      "optmods":
        "Access": 1
        "Actions": 1
        "Alias": 1
        "Asis": 0
        "AuthAnon": 0
        "AuthDB": 0
        "AuthDBM": 0
        "AuthDigest": 0
        "AuthLDAP": 0
        "AuthnAlias": 0
        "AuthnAnon": 0
        "AuthnDBD": 0
        "AuthnDBM": 0
        "AuthnDefault": 0
        "AuthnzLDAP": 0
        "AuthzDBM": 0
        "AuthzHost": 1
        "AuthzOwner": 0
        "Autoindex": 1
        "Bucketeer": 0
        "Cache": 1
        "CaseFilter": 0
        "CaseFilterIn": 0
        "CernMeta": 0
        "CharsetLite": 0
        "DAVFs": 1
        "DAVLock": 1
        "DBD": 0
        "DIR": 1
        "Dav": 1
        "Deflate": 1
        "DiskCache": 1
        "Distcache": 0
        "Dumpio": 0
        "Echo": 0
        "Env": 0
        "Expires": 1
        "ExtFilter": 0
        "Fastcgi": 1
        "FileCache": 1
        "Fileprotect": 1
        "Headers": 1
        "Ident": 0
        "Imagemap": 0
        "LDAP": 0
        "LogAgent": 0
        "LogConfig": 1
        "LogForensic": 0
        "LogReferer": 0
        "MPMEvent": 0
        "MPMItk": 0
        "MPMLeader": 0
        "MPMPerchild": 0
        "MPMPrefork": 1
        "MPMThreadpool": 0
        "MPMWorker": 0
        "MemCache": 1
        "Mime": 1
        "MimeMagic": 0
        "MmapStatic": 0
        "Negotiation": 1
        "OptionalFnExport": 0
        "OptionalFnImport": 0
        "OptionalHookExport": 0
        "OptionalHookImport": 0
        "PHPAsUser": 1
        "Proxy": 1
        "RaiseFDSetsize": 0
        "RaiseHardServerLimit": 0
        "Rewrite": 0
        "Setenvif": 1
        "SlowRestartPatch": 1
        "Speling": 0
        "Status": 1
        "SymlinkProtection": 0
        "UniqueId": 1
        "Userdir": 1
        "Usertrack": 0
        "Version": 0
        "VhostAlias": 0
        "Watchdog": 0
      "version": '2_2'
    "Cpanel::Easy::EAccelerator": 0
    "Cpanel::Easy::IonCubeLoader": 1
    "Cpanel::Easy::ModBandwidth": 0
    "Cpanel::Easy::ModJk": 0
    "Cpanel::Easy::ModJk5": 0
    "Cpanel::Easy::ModMono": 0
    "Cpanel::Easy::ModMono2": 0
    "Cpanel::Easy::ModPerl": 1
    "Cpanel::Easy::ModQos": 0
    "Cpanel::Easy::ModRuid2": 1
    "Cpanel::Easy::ModSec": 1
    "Cpanel::Easy::PHP5": 1
    "Cpanel::Easy::PHP5::3_29": 0
    "Cpanel::Easy::PHP5::4_38": 0
    "Cpanel::Easy::PHP5::5_22": 1
    "Cpanel::Easy::PHP5::Bcmath": 1
    "Cpanel::Easy::PHP5::Bz2": 1
    "Cpanel::Easy::PHP5::CGI": 0
    "Cpanel::Easy::PHP5::Calendar": 1
    "Cpanel::Easy::PHP5::Curl": 0
    "Cpanel::Easy::PHP5::CurlSSL": 1
    "Cpanel::Easy::PHP5::Curlwrappers": 1
    "Cpanel::Easy::PHP5::DBX": 0
    "Cpanel::Easy::PHP5::Dbase": 0
    "Cpanel::Easy::PHP5::DiscardPath": 0
    "Cpanel::Easy::PHP5::Enchant": 1
    "Cpanel::Easy::PHP5::Exif": 1
    "Cpanel::Easy::PHP5::Expat": 1
    "Cpanel::Easy::PHP5::FTP": 1
    "Cpanel::Easy::PHP5::Fastcgi": 0
    "Cpanel::Easy::PHP5::FileInfo": 0
    "Cpanel::Easy::PHP5::ForceCGIRedirect": 0
    "Cpanel::Easy::PHP5::GD": 1
    "Cpanel::Easy::PHP5::Gettext": 1
    "Cpanel::Easy::PHP5::HardPHP": 0
    "Cpanel::Easy::PHP5::Iconv": 0
    "Cpanel::Easy::PHP5::Imap": 1
    "Cpanel::Easy::PHP5::Intl": 1
    "Cpanel::Easy::PHP5::Java": 0
    "Cpanel::Easy::PHP5::MM": 0
    "Cpanel::Easy::PHP5::MagicQuotes": 0
    "Cpanel::Easy::PHP5::MailHeaders": 1
    "Cpanel::Easy::PHP5::Mbregex": 0
    "Cpanel::Easy::PHP5::Mbstring": 1
    "Cpanel::Easy::PHP5::Mcrypt": 1
    "Cpanel::Easy::PHP5::MemoryLimit": 0
    "Cpanel::Easy::PHP5::Mhash": 0
    "Cpanel::Easy::PHP5::MimeMagic": 0
    "Cpanel::Easy::PHP5::Mysql": 1
    "Cpanel::Easy::PHP5::MysqlOfSystem": 0
    "Cpanel::Easy::PHP5::Mysqli": 1
    "Cpanel::Easy::PHP5::Openssl": 1
    "Cpanel::Easy::PHP5::PDO": 1
    "Cpanel::Easy::PHP5::PDOMySQL": 1
    "Cpanel::Easy::PHP5::POSIX": 1
    "Cpanel::Easy::PHP5::Pear": 0
    "Cpanel::Easy::PHP5::Pgsql": 0
    "Cpanel::Easy::PHP5::Phar": 0
    "Cpanel::Easy::PHP5::Pspell": 0
    "Cpanel::Easy::PHP5::SNMP": 0
    "Cpanel::Easy::PHP5::SOAP": 0
    "Cpanel::Easy::PHP5::SQLite3": 0
    "Cpanel::Easy::PHP5::SafeMode": 0
    "Cpanel::Easy::PHP5::SafePHPCGI": 0
    "Cpanel::Easy::PHP5::SilenceDeprecatedPatch": 0
    "Cpanel::Easy::PHP5::Sockets": 1
    "Cpanel::Easy::PHP5::SysTimezone": 0
    "Cpanel::Easy::PHP5::TTF": 1
    "Cpanel::Easy::PHP5::Tidy": 1
    "Cpanel::Easy::PHP5::Versioning": 0
    "Cpanel::Easy::PHP5::Wddx": 0
    "Cpanel::Easy::PHP5::WithoutIconv": 0
    "Cpanel::Easy::PHP5::XSL": 1
    "Cpanel::Easy::PHP5::XmlRPC": 1
    "Cpanel::Easy::PHP5::ZendMultibyte": 0
    "Cpanel::Easy::PHP5::Zip": 1
    "Cpanel::Easy::PHP5::Zlib": 1
    "Cpanel::Easy::PHP5::cPPHPOpts": 0
    "Cpanel::Easy::PHPSuHosin": 0
    "Cpanel::Easy::SourceGuardian": 0
    "Cpanel::Easy::Tomcat::7_0": 0
    "Cpanel::Easy::Xcache": 1
    "Cpanel::Easy::Zendopt": 1
    "_meta":
      "name": 'AP_Build_Custom_03022015 (1)'
      "note": 'Custom built with Apache 2.2 and PHP 5.5'
      "revision": 'F7ibzdpWcz93tOToLJcDWhRXcMv_48VUgCm0k7Dr93k8v1B4aTHKDsMokcqUFKHV'
    
    This profile is set to run PHP in DSO mode so that Xcache is effective. Build process completes successfully; Apache and PHP run normally after installation. After a while Apache error log is flooded with Segmentation fault and Bus errors.

    On researching I found mod_security and mod_ruid2 are a nasty combination, so I tried to disable them one after another and disabling them both at once. But seg fault and bus errors still persist. The error log is very vague in description and requires more in-depth logging with GDB. It's not possible to run Apache with GDB on a live hosting dedicated server. There are also file/folder permission errors before it starts puking seg fault and bus errors.

    Here's Apache error log:
    Code:
    [Tue Mar 24 10:10:26 2015] [error] [client 122.175.11.110] ModSecurity: collections_remove_stale: Failed to access DBM file "/var/cpanel/secdatadir/resource": Permission denied [hostname "www.anirudhsethireport.com"] [uri "/wp-content/themes/financial/images/bgs/68353.png"] [unique_id "VRDquq338hUAACS9EnEAAAAX"]
    [Tue Mar 24 10:10:26 2015] [error] [client 122.175.11.110] ModSecurity: collections_remove_stale: Failed to access DBM file "/var/cpanel/secdatadir/ip": Permission denied [hostname "www.anirudhsethireport.com"] [uri "/wp-content/themes/financial/images/bgs/68353.png"] [unique_id "VRDquq338hUAACS9EnEAAAAX"]
    [Tue Mar 24 10:10:26 2015] [error] [client 115.184.207.20] ModSecurity: collections_remove_stale: Failed to access DBM file "/var/cpanel/secdatadir/resource": Permission denied [hostname "www.anirudhsethireport.com"] [uri "/wp-content/cache/page_enhanced/www.anirudhsethireport.com//category/sensex-nifty-future//_index.html_gzip"] [unique_id "VRDquq338hUAACSwD7cAAAAK"]
    [Tue Mar 24 11:00:49 2015] [notice] child pid 20741 exit signal Segmentation fault (11)
    [Tue Mar 24 11:00:50 2015] [notice] child pid 20826 exit signal Segmentation fault (11)
    [Tue Mar 24 11:00:50 2015] [notice] child pid 20827 exit signal Segmentation fault (11)
    [Tue Mar 24 11:00:51 2015] [notice] child pid 20831 exit signal Segmentation fault (11)
    [Tue Mar 24 11:00:51 2015] [notice] child pid 20832 exit signal Segmentation fault (11)
    [Tue Mar 24 11:00:52 2015] [notice] child pid 20834 exit signal Segmentation fault (11)
    [Tue Mar 24 11:00:52 2015] [notice] child pid 20837 exit signal Bus error (7)
    [Tue Mar 24 11:00:52 2015] [notice] child pid 20838 exit signal Segmentation fault (11)
    [Tue Mar 24 11:00:52 2015] [notice] child pid 20839 exit signal Bus error (7)
    [Tue Mar 24 11:00:52 2015] [notice] child pid 20842 exit signal Bus error (7)
    [Tue Mar 24 11:00:52 2015] [notice] child pid 20843 exit signal Bus error (7)
    [Tue Mar 24 11:00:53 2015] [notice] child pid 20841 exit signal Bus error (7)
    [Tue Mar 24 11:00:55 2015] [notice] child pid 20829 exit signal Segmentation fault (11)
    [Tue Mar 24 11:00:57 2015] [notice] child pid 20638 exit signal Segmentation fault (11)
    [Tue Mar 24 11:00:57 2015] [notice] child pid 20782 exit signal Bus error (7)
    [Tue Mar 24 11:00:57 2015] [notice] child pid 20785 exit signal Segmentation fault (11)
    [Tue Mar 24 11:00:58 2015] [notice] child pid 20751 exit signal Segmentation fault (11)
    [Tue Mar 24 11:00:58 2015] [notice] child pid 20793 exit signal Segmentation fault (11)
    Is there any way to run PHP 5.5 with Xcache, mod_security and mod_ruid2?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Please browse to:

    "WHM Home >> Software >> Module Installers >> PHP Extensions and Applications Package"

    Is the "PHP Extensions and Applications Package Magic User Loader" option enabled? If so, does disabling it resolve the issue?

    Thank you.
     
  3. anithegregorian

    anithegregorian Registered

    Joined:
    Dec 25, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi Mike,

    Thanks for replying. Magic User Loader is enabled. Yesterday I researched further and made a small change after reading this -> https://forums.cpanel.net/threads/why-is-apache-restarting-every-two-hours.254022/

    After enabling piped logging server seems to have regained stability. I also noticed that if I run PHP as suPHP most of the errors were gone before enabling piped logging but we have to resolve it permanantly. As of writing this, I have tried to run PHP in DSO mode (OpCode caching doesn't work with suPHP) and I will gradually enable mod_security with mod_ruid2 and see if the issue resurfaces. Fingers and toes crossed :p

    On a side note we are going to use Xcache for OpCode caching.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  5. anithegregorian

    anithegregorian Registered

    Joined:
    Dec 25, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi Mike,

    Good to hear back from you but happiness short-lived after enabling Xcache. As soon as I enabled Xcache (mod_security and mod_ruid2 are still disabled) seg fault and bus errors were back with vengeance.

    Just a hunch - Xcache is causing all the trouble. To back my hunch I am running PHP in DSO mode and so far no errors. It's strange because we've had Xcache configured and working a while back (almost a month) and it was configured to run on just one site through php.ini, until we consulted our hosting provider (Inmotion Hosting) over installation errors in OsTicket. They suggested - it's because of backward compatibility issue and you should use PHP Switch to run OsTicket. After that everything went haywire! Following that PHP Switch was removed.

    We were pretty happy with APC but, If I'm correct it's discontinued and not supported as of PHP 5.3, thus Xcache. Xcache seemed like the right candidate with similar features and configuration as in APC and its actively updated. However, now our last resort would be exploring eAccelerator. Would really like to dig deeper into what's causing seg faults and bus errors but that requires hooking Apache into GDB on a live server... sighs... :eek:

    From another angle could it be possible to tweak Apache error logging level to locate exact source of error? Here's an abstract from Apache error log:

    Code:
    Thu Mar 26 12:57:59 2015] [error] [client 61.223.205.19] File does not exist: /home/nikkainc/public_html/administrator
    [Thu Mar 26 12:58:34 2015] [error] [client 125.24.176.187] File does not exist: /home/nikkainc/public_html/wordpress
    [Thu Mar 26 12:58:35 2015] [error] [client 125.24.176.187] File does not exist: /home/nikkainc/public_html/site
    [Thu Mar 26 12:58:36 2015] [error] [client 125.24.176.187] File does not exist: /home/nikkainc/public_html/blog
    [Thu Mar 26 12:58:38 2015] [error] [client 125.24.176.187] File does not exist: /home/nikkainc/public_html/wp
    [Thu Mar 26 12:58:39 2015] [error] [client 125.24.176.187] script '/home/nikkainc/public_html/wp-login.php' not found or unable to stat
    [Thu Mar 26 12:58:41 2015] [error] [client 125.24.176.187] File does not exist: /home/nikkainc/public_html/wp-login
    [Thu Mar 26 12:58:46 2015] [error] [client 125.24.176.187] File does not exist: /home/nikkainc/public_html/administrator
    [Thu Mar 26 13:00:02 2015] [notice] child pid 4246 exit signal Bus error (7)
    [Thu Mar 26 13:00:02 2015] [notice] child pid 4683 exit signal Bus error (7)
    [Thu Mar 26 13:00:03 2015] [notice] child pid 4457 exit signal Segmentation fault (11)
    [Thu Mar 26 13:00:04 2015] [notice] child pid 2722 exit signal Bus error (7)
    [Thu Mar 26 13:00:04 2015] [notice] child pid 4370 exit signal Bus error (7)
    [Thu Mar 26 13:00:04 2015] [notice] child pid 4684 exit signal Segmentation fault (11)
    [Thu Mar 26 13:00:05 2015] [notice] child pid 3477 exit signal Segmentation fault (11)
    [Thu Mar 26 13:00:05 2015] [notice] child pid 4218 exit signal Bus error (7)
    [Thu Mar 26 13:00:05 2015] [notice] child pid 4471 exit signal Bus error (7)
    [Thu Mar 26 13:00:05 2015] [notice] child pid 4654 exit signal Bus error (7)
    [Thu Mar 26 13:00:06 2015] [notice] child pid 4596 exit signal Segmentation fault (11)
    [Thu Mar 26 13:00:06 2015] [notice] child pid 4637 exit signal Bus error (7)
    [Thu Mar 26 13:00:06 2015] [notice] child pid 4646 exit signal Bus error (7)
    [Thu Mar 26 13:00:06 2015] [notice] child pid 4867 exit signal Bus error (7)
    [Thu Mar 26 13:00:07 2015] [notice] child pid 4213 exit signal Segmentation fault (11)

    Appreciate your sound advice and support...
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page