Bug 240408

Summary: lang/php7x core dumped. Reason: php7x-imap module (new issue)
Product: Ports & Packages Reporter: AS <asharp>
Component: Individual Port(s)Assignee: Torsten Zuehlsdorff <tz>
Status: Closed FIXED    
Severity: Affects Only Me CC: dpetrov67, tz, w.schwarzenfeld
Priority: --- Flags: w.schwarzenfeld: maintainer-feedback? (tz)
Version: Latest   
Hardware: amd64   
OS: Any   

Description AS 2019-09-08 07:43:14 UTC
All,

Was updating an instance and ran into a bug that's also related to imap module.

Release 12.0-p10 with latest version of port for php72 as well as php73.  

If imap is disabled, PHP (with/without ZTS) works fine:

PHP 7.3.9 (cli) (built: Sep  8 2019 02:59:59) ( ZTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.9, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.9, Copyright (c) 1999-2018, by Zend Technologies


If imap is enabled for either version (with/without ZTS), "php -v" results in a core dump.

Debugging:

GNU gdb (GDB) 8.3 [GDB v8.3 for FreeBSD]
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd12.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from php...
(gdb) run php -v
Starting program: /usr/local/bin/php php -v

Program received signal SIGSEGV, Segmentation fault.
0x0000000800af090c in strcmp () from /lib/libc.so.7
(gdb)
Comment 1 Torsten Zuehlsdorff freebsd_committer freebsd_triage 2019-09-10 22:21:31 UTC
I am afraid, I can't reproduce this bug. I tested it on 11.2 and 12.0 (both amd). I started a new jail in poudriere, compiled the extension and than called "php -v" - everything fine.

Maybe its due to an combination of modules, which has happened before. Can you show an "php -m" or "pkg info | grep php" please?

Greetings,
Torsten
Comment 2 AS 2019-09-10 23:54:32 UTC
Absolutely!

[PHP Modules]
bcmath
calendar
Core
ctype
date
dom
exif
fileinfo
filter
gd
gmp
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

FYI - had not considered that it may be a combination of modules.  Simply went through the process of elimination.  eg: remove all (by commenting line item in files located in /usr/local/etc/php) and then add one at a time back into the mix (running php -v to verify) and the first failure was when imap was placed back into the mix.

Other details that may be pertinent (or not):
- /etc/make.conf includes WITH_MPM=event
- Also using mod-php
- All components are built from /usr/ports and not installed via "pkg install"

Thanks!
Comment 3 Torsten Zuehlsdorff freebsd_committer freebsd_triage 2020-07-12 22:20:29 UTC
Aloha AS,

I just had another issue and with the help of bofh it was pinned down to php-imap. It was so similar to yours, that i remembered this PR! 

Can you check if the crashes go away, if you use php-imap with the Panda cclient option enabled?

Thanks,
Torsten
Comment 4 Torsten Zuehlsdorff freebsd_committer freebsd_triage 2020-07-13 13:48:27 UTC
After some more tests, i am positive it is fixed now. The fix is committed in:
https://svnweb.freebsd.org/changeset/ports/542132

If not please reopen the ticket and i will have another look at it!

Thank you very much!
Torsten