Topic: PHP 7.0 Zend Segfault

Hi all,

I've run into a recent issue with an old app we have and I'm kind of stuck.  The code hasn't been modified in a LONG time and it just stopped working for no apparent reason.

In the app, when you submit a POST request to a certain part it triggers a segfault and the FPM child process exits.  I ran a stack trace on the process and I see the following.

12:18:41 lstat("PATH/library/Zend/Config.php", 0x7ffeab808380) = -1 ENOENT (No such file or directory)
12:18:41 lstat("PATH/application/models/Zend/Config.php", 0x7ffeab808380) = -1 ENOENT (No such file or directory)
12:18:41 lstat("PATH/application/forms/Zend/Config.php", 0x7ffeab808380) = -1 ENOENT (No such file or directory)
12:18:41 lstat("PATH/application/plugins/Zend/Config.php", 0x7ffeab808380) = -1 ENOENT (No such file or directory)
12:18:41 fcntl(3, F_SETLKW, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=0, l_len=1}) = 0
12:18:41 fcntl(3, F_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=0, l_len=1}) = 0
12:18:41 stat("PATH/Zend/Config.php", {st_mode=S_IFREG|0644, st_size=12911, ...}) = 0
12:18:41 --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=0} ---
12:18:41 +++ killed by SIGSEGV +++

Next, I produced a core dump of the issue and when I analyze that I see the following.

1313        } while (0);
1314    #endif
1316        if (EXPECTED(heap->free_slot[bin_num] != NULL)) {
1317            zend_mm_free_slot *p = heap->free_slot[bin_num];
1318            heap->free_slot[bin_num] = p->next_free_slot;
1319            return (void*)p;
1320        } else {
1321            return zend_mm_alloc_small_slow(heap, bin_num ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1322        }

The app stopped working somewhere around January.  It's not used very often so I don't know exactly when it stopped.  I do know there have been no code changes to it though.

I can see the following updates to PHP 7.0 occurred recently.

Jan 22 04:21:33 Updated: php70-php.x86_64 7.0.33-16.el7.remi
Jan 24 02:52:00 Updated: php70-php.x86_64 7.0.33-17.el7.remi
Feb 19 01:56:47 Updated: php70-php.x86_64 7.0.33-18.el7.remi

I tried downgrading to -17 but that didn't fix it.  -16 isn't available in the repo any longer so I couldn't try it.

Any ideas what might cause this?


Re: PHP 7.0 Zend Segfault

Changes in 16, 17, 18... are only security fixes.
BTW, older versions are available in the store ex,

Check what have changed in the stack, can be some extensions (php-pecl...)

Desktop: Fedora 31 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test