Error in `php’: free(): invalid pointer

Posting incase anyone else gets this, I fixed by re-doing permissions as suggested in validate.php and re-running daily.sh and everything is back to normal.

sudo chown -R librenms:librenms /opt/librenms
sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
sudo chmod -R ug=rwX /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/

daily.sh

librenms]$ ./daily.sh
Updating to latest release                         OK
Updating Composer packages                        *** Error in `php': free(): invalid pointer: 0x00007f6f15bce818 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x81489)[0x7f6f15889489]
/lib64/libnetsnmp.so.31(shutdown_mib+0x96)[0x7f6f04e70b46]
/lib64/libnetsnmp.so.31(snmp_shutdown+0x2b)[0x7f6f04e8ce0b]
/usr/lib64/php/modules/snmp.so(+0x5750)[0x7f6f05153750]
php(+0x2e2367)[0x559fa6113367]
php(+0x2d960c)[0x559fa610a60c]
php(zend_hash_graceful_reverse_destroy+0x128)[0x559fa611eaf8]
php(+0x2db12e)[0x559fa610c12e]
php(php_module_shutdown+0x2b)[0x559fa60a824b]
php(+0xebbf5)[0x559fa5f1cbf5]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f6f1582a3d5]
php(+0xebdb3)[0x559fa5f1cdb3]
======= Memory map: ========
{REDACTED}
 OK
Updated from 1.49 to 1.50                          OK
Updating SQL-Schema                                OK
Updating submodules                                OK
Cleaning up DB                                     OK
Fetching notifications                             OK
Caching PeeringDB data                             OK

error.log

2019/04/01 09:24:55 [error] 11103#11103: *1303258 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught ErrorException: include(/opt/librenms/vendor/composer/../laravel/framework/src/Illuminate/Contracts/Routing/ResponseFactory.php): failed to open stream: No such file or directory in /opt/librenms/vendor/composer/ClassLoader.php:444
Stack trace:
#0 /opt/librenms/vendor/composer/ClassLoader.php(444): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'include(/opt/li...', '/opt/librenms/l...', 444, Array)
#1 /opt/librenms/vendor/composer/ClassLoader.php(444): include()
#2 /opt/librenms/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/opt/librenms/l...')
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass('Illuminate\\Cont...')
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(14): spl_autoload_call('Illuminate\\Cont...')
#5 /opt/librenms/vendor/composer/ClassLoader.php(444): include('/opt/librenms/l...')
#6 /opt/librenms/lib...
PHP message: PHP Fatal error:  Uncaught ErrorException: include(/opt/librenms/vendor/composer/../laravel/framework/src/Illuminate/Contracts/Routing/Registrar.php): failed to open stream: No such file or directory in /opt/librenms/vendor/composer/ClassLoader.php:444
Stack trace:
#0 /opt/librenms/vendor/composer/ClassLoader.php(444): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'include(/opt/li...', '/opt/librenms/l...', 444, Array)
#1 /opt/librenms/vendor/composer/ClassLoader.php(444): include()
#2 /opt/librenms/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/opt/librenms/l...')
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass('Illuminate\\Cont...')
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/Router.php(29): spl_autoload_call('Illuminate\\Cont...')
#5 /opt/librenms/vendor/composer/ClassLoader.php
2019/04/01 09:24:55 [error] 11103#11103: *1303258 FastCGI sent in stderr: "PHP message: PHP Fatal error:  require(): Failed opening required 
1 Like

PHP crashed because of file permissions? Not cool. Hopefully, it only affects some PHP versions.

1 Like

hopefully its nothing i did :grin: I will check if it re-occurs next release

For info here are my versions

====================================
Component | Version
--------- | -------
LibreNMS  | 1.50
DB Schema | 2019_02_10_220000_add_dates_to_fdb (132)
PHP       | 7.2.16
MySQL     | 5.5.60-MariaDB
RRDTool   | 1.6.0
SNMP      | NET-SNMP 5.7.2
====================================

[OK]    Composer Version: 1.8.4
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database schema correct
php-PsrLog.noarch                       1.1.0-1.el7                   @centos7.0-x86_64-epel-channel
php-composer-ca-bundle.noarch           1.0.2-1.el7                   @centos7.0-x86_64-epel-channel
php-composer-semver.noarch              1.4.2-1.el7                   @centos7.0-x86_64-epel-channel
php-composer-spdx-licenses.noarch       1.5.0-1.el7                   @centos7.0-x86_64-epel-channel
php-composer-xdebug-handler.noarch      1.3.2-1.el7                   @centos7.0-x86_64-epel-channel
php-fedora-autoloader.noarch            1.0.0-1.el7                   @centos7.0-x86_64-epel-channel
php-jsonlint.noarch                     1.6.1-1.el7                   @centos7.0-x86_64-epel-channel
php-justinrainbow-json-schema5.noarch   5.2.8-1.el7                   @centos7.0-x86_64-epel-channel
php-paragonie-random-compat.noarch      2.0.12-1.el7                  @centos7.0-x86_64-epel-channel
php-password-compat.noarch              1.0.4-1.el7                   @centos7.0-x86_64-epel-channel
php-pear.noarch                         1:1.9.4-21.el7                @centos7.0-x86_64-base-channel
php-seld-cli-prompt.noarch              1.0.3-1.el7                   @centos7.0-x86_64-epel-channel
php-seld-phar-utils.noarch              1.0.1-1.el7                   @centos7.0-x86_64-epel-channel
php-symfony-browser-kit.noarch          2.8.12-2.el7                  @centos7.0-x86_64-epel-channel
php-symfony-class-loader.noarch         2.8.12-2.el7                  @centos7.0-x86_64-epel-channel
php-symfony-common.noarch               2.8.12-2.el7                  @centos7.0-x86_64-epel-channel
php-symfony-config.noarch               2.8.12-2.el7                  @centos7.0-x86_64-epel-channel
php-symfony-console.noarch              2.8.12-2.el7                  @centos7.0-x86_64-epel-channel
php-symfony-css-selector.noarch         2.8.12-2.el7                  @centos7.0-x86_64-epel-channel
php-symfony-debug.noarch                2.8.12-2.el7                  @centos7.0-x86_64-epel-channel
php-symfony-dependency-injection.noarch 2.8.12-2.el7                  @centos7.0-x86_64-epel-channel
php-symfony-dom-crawler.noarch          2.8.12-2.el7                  @centos7.0-x86_64-epel-channel
php-symfony-event-dispatcher.noarch     2.8.12-2.el7                  @centos7.0-x86_64-epel-channel
php-symfony-expression-language.noarch  2.8.12-2.el7                  @centos7.0-x86_64-epel-channel
php-symfony-filesystem.noarch           2.8.12-2.el7                  @centos7.0-x86_64-epel-channel
php-symfony-finder.noarch               2.8.12-2.el7                  @centos7.0-x86_64-epel-channel
php-symfony-http-foundation.noarch      2.8.12-2.el7                  @centos7.0-x86_64-epel-channel
php-symfony-http-kernel.noarch          2.8.12-2.el7                  @centos7.0-x86_64-epel-channel
php-symfony-polyfill.noarch             1.5.0-1.el7                   @centos7.0-x86_64-epel-channel
php-symfony-process.noarch              2.8.12-2.el7                  @centos7.0-x86_64-epel-channel
php-symfony-var-dumper.noarch           2.8.12-2.el7                  @centos7.0-x86_64-epel-channel
php-symfony-yaml.noarch                 2.8.12-2.el7                  @centos7.0-x86_64-epel-channel
php72w-cli.x86_64                       7.2.16-1.w7                   @centos-7-webtatic-php-testing
php72w-common.x86_64                    7.2.16-1.w7                   @centos-7-webtatic-php-testing
php72w-fpm.x86_64                       7.2.16-1.w7                   @centos-7-webtatic-php-testing
php72w-gd.x86_64                        7.2.16-1.w7                   @centos-7-webtatic-php-testing
php72w-intl.x86_64                      7.2.16-1.w7                   @centos-7-webtatic-php-testing
php72w-mbstring.x86_64                  7.2.16-1.w7                   @centos-7-webtatic-php-testing
php72w-mysqlnd.x86_64                   7.2.16-1.w7                   @centos-7-webtatic-php-testing
php72w-pdo.x86_64                       7.2.16-1.w7                   @centos-7-webtatic-php-testing
php72w-process.x86_64                   7.2.16-1.w7                   @centos-7-webtatic-php-testing
php72w-snmp.x86_64                      7.2.16-1.w7                   @centos-7-webtatic-php-testing
php72w-xml.x86_64                       7.2.16-1.w7                   @centos-7-webtatic-php-testing