Open woonoz-ac opened 9 months ago
Do you have code that is decrypting something using openssl? Does this happen with a non-static build? This smells like an upstream bug.
Hello, i use Filament with Laravel. It happens randomly, i have no specific code that make encryption. I have another version working on Laravel Forge without FrankenPHP and I have no crash.
So, if you search your entire codebase (vendor folder + your own code), there is nothing calling any of the openssl functions? Then how is it being called and crashing??
On the version without frankenphp, are you using the openssl extension there as well?
In the above stack trace there is a mention of "AES-256-CBC".
https://laravel.com/docs/10.x/encryption
As you can see , Laravel use it for cookies, secret links, etc. It's not in my code but in Filament or Laravel.
Thanks! To better help us figure this out, it would be helpful to understand what is specifically calling the code to that causes this issue (as in the exact library/methods being called in your vendor folder). This isn't something I can access or search remotely (it is on your machine, not mine), so we'll need your assistance to pinpoint what is going on.
Identifying the specific code/library causing the issue is crucial for reproducing the issue. This, in turn, will allow us to determine if this is an upstream issue or something that needs to be addressed in FrankenPHP. The clearer you can be about where the problem originates, the easier (and faster) a solution can be found. For example, if the issue lies within a specific library+version, knowing exactly which one will be incredibly valuable.
If you could also supply the output from phpinfo()
in both the frankenphp and non-frankenphp versions, that would also be valuable (potentially different versions of openssl libraries and extensions). Further does this happen when the application is completely idle (aka, no requests at all), or is it possible this is due to a request?
I reach to reproduce the crash on a page. I have this crash every refresh with always this stack:
Program terminated with signal SIGSEGV, Segmentation fault.
154 /usr/local/go/src/runtime/sys_linux_amd64.s: No such file or directory. [Current thread is 1 (LWP 168)] warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts of file /usr/local/bin/frankenphp. Use `info auto-load python-scripts [REGEXP]' to list them. (gdb) bt
Backtrace stopped: frame did not save the PC (gdb)
I will send you, the phpinfo() soon.
FrankenPHP version phpinfo()
PHP Version 8.3.2
--
PHP logo
PHP Version 8.3.2
System Linux ip-10-206-12-96.eu-west-3.compute.internal 5.10.205-195.807.amzn2.x86_64 #1 SMP Tue Jan 16 18:28:59 UTC 2024 x86_64
Build Date Feb 6 2024 00:36:16
Build System Linux buildkitsandbox 6.2.0-1019-azure #19~22.04.1-Ubuntu SMP Wed Jan 10 22:57:03 UTC 2024 x86_64 Linux
Configure Command './configure' '--prefix=' '--with-valgrind=no' '--enable-shared=no' '--enable-static=yes' '--disable-all' '--disable-cgi' '--disable-phpdbg' '--disable-cli' '--disable-fpm' '--enable-embed=static' '--disable-micro' '--disable-opcache-jit' '--enable-zts' '--disable-zend-signals' '--enable-zend-max-execution-timers' '--enable-apcu' '--enable-bcmath' '--with-bz2=/go/src/app/dist/static-php-cli/buildroot' '--enable-calendar' '--enable-ctype' '--with-curl' '--enable-dba' '--enable-dom' '--enable-exif' '--enable-fileinfo' '--enable-filter' '--with-zlib' '--with-zlib-dir=/go/src/app/dist/static-php-cli/buildroot' '--enable-gd' '--with-freetype' '--with-jpeg' '--with-webp' '--with-avif' '--with-iconv=/go/src/app/dist/static-php-cli/buildroot' '--enable-igbinary' '--enable-intl' '--with-openssl=/go/src/app/dist/static-php-cli/buildroot' '--with-openssl-dir=/go/src/app/dist/static-php-cli/buildroot' '--with-ldap=/go/src/app/dist/static-php-cli/buildroot' '--enable-mbstring' '--enable-mysqlnd' '--with-mysqli' '--enable-opcache' '--enable-pcntl' '--enable-pdo' '--with-pdo-mysql' '--with-pgsql=/go/src/app/dist/static-php-cli/buildroot' '--with-pdo-pgsql=/go/src/app/dist/static-php-cli/buildroot' '--with-sqlite3=/go/src/app/dist/static-php-cli/buildroot' '--with-pdo-sqlite' '--enable-phar' '--enable-posix' '--with-readline=/go/src/app/dist/static-php-cli/buildroot' '--enable-session' '--enable-redis' '--enable-redis-session' '--enable-redis-igbinary' '--enable-redis-lz4' '--with-liblz4=/go/src/app/dist/static-php-cli/buildroot' '--enable-simplexml' '--enable-sockets' '--with-sodium' '--enable-sysvsem' '--enable-tokenizer' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-libxml=/go/src/app/dist/static-php-cli/buildroot' '--with-zip=/go/src/app/dist/static-php-cli/buildroot' 'CFLAGS=' 'PKG_CONFIG=/go/src/app/dist/static-php-cli/buildroot/bin/pkg-config' 'PKG_CONFIG_PATH=/go/src/app/dist/static-php-cli/buildroot/lib/pkgconfig'
Server API FrankenPHP
Virtual Directory Support enabled
Configuration File (php.ini) Path /lib
Loaded Configuration File /usr/local/lib/php.ini
Scan this dir for additional .ini files (none)
Additional .ini files parsed (none)
PHP API 20230831
PHP Extension 20230831
Zend Extension 420230831
Zend Extension Build API420230831,TS
PHP Extension Build API20230831,TS
Debug Build no
Thread Safety enabled
Thread API POSIX Threads
Zend Signal Handling disabled
Zend Memory Manager enabled
Zend Multibyte Support provided by mbstring
Zend Max Execution Timers enabled
IPv6 Support enabled
DTrace Support disabled
Registered PHP Streams https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar, zip
Registered Stream Socket Transports tcp, udp, unix, udg, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3
Registered Stream Filters zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, convert.*, consumed, dechunk
Zend logoThis program makes use of the Zend Scripting Language Engine:
Zend Engine v4.3.2, Copyright (c) Zend Technologies with Zend OPcache v8.3.2, Copyright (c), by Zend Technologies
Configuration
APCu Support Enabled
Version 5.1.23
APCu Debugging Disabled
MMAP Support Enabled
MMAP File Mask no value
Serialization Support php, igbinary
Build Date Feb 6 2024 00:34:38
Directive Local Value Master Value
apc.coredump_unmap Off Off
apc.enable_cli Off Off
apc.enabled On On
apc.entries_hint 4096 4096
apc.gc_ttl 3600 3600
apc.mmap_file_mask no value no value
apc.preload_path no value no value
apc.serializer php php
apc.shm_segments 1 1
apc.shm_size 32M 32M
apc.slam_defense Off Off
apc.smart 0 0
apc.ttl 0 0
apc.use_request_time Off Off
[bcmath]
BCMath support enabled
Directive Local Value Master Value
bcmath.scale 0 0
[bz2]
BZip2 Support Enabled
Stream Wrapper support compress.bzip2://
Stream Filter support bzip2.decompress, bzip2.compress
BZip2 Version 1.0.8, 13-Jul-2019
[calendar]
Calendar support enabled
[Core]
PHP Version 8.3.2
Directive Local Value Master Value
allow_url_fopen On On
allow_url_include Off Off
arg_separator.input & &
arg_separator.output & &
auto_append_file no value no value
auto_globals_jit On On
auto_prepend_file no value no value
browscap no value no value
default_charset UTF-8 UTF-8
default_mimetype text/html text/html
disable_classes no value no value
disable_functions no value no value
display_errors Off Off
display_startup_errors Off Off
doc_root no value no value
docref_ext no value no value
docref_root no value no value
enable_dl Off Off
enable_post_data_reading On On
error_append_string no value no value
error_log /var/log/php_errors.log /var/log/php_errors.log
error_log_mode 0644 0644
error_prepend_string no value no value
error_reporting 22527 22527
expose_php On On
extension_dir /lib/php/extensions/no-debug-zts-20230831 /lib/php/extensions/no-debug-zts-20230831
fiber.stack_size no value no value
file_uploads On On
hard_timeout 2 2
highlight.comment #FF8000 #FF8000
highlight.default #0000BB #0000BB
highlight.html #000000 #000000
highlight.keyword #007700 #007700
highlight.string #DD0000 #DD0000
html_errors On On
ignore_repeated_errors Off Off
ignore_repeated_source Off Off
ignore_user_abort Off Off
implicit_flush Off Off
include_path .: .:
input_encoding no value no value
internal_encoding no value no value
log_errors On On
mail.add_x_header Off Off
mail.force_extra_parameters no value no value
mail.log no value no value
mail.mixed_lf_and_crlf Off Off
max_execution_time 30 30
max_file_uploads 20 20
max_input_nesting_level 64 64
max_input_time 60 60
max_input_vars 1000 1000
max_multipart_body_parts -1 -1
memory_limit 128M 128M
open_basedir no value no value
output_buffering 4096 4096
output_encoding no value no value
output_handler no value no value
post_max_size 8M 8M
precision 14 14
realpath_cache_size 4096K 4096K
realpath_cache_ttl 120 120
register_argc_argv Off Off
report_memleaks On On
report_zend_debug Off Off
request_order GP GP
sendmail_from no value no value
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
serialize_precision -1 -1
short_open_tag Off Off
SMTP localhost localhost
smtp_port 25 25
static-php-cli.version 2.1.0-beta.2 2.1.0-beta.2
sys_temp_dir no value no value
syslog.facility LOG_USER LOG_USER
syslog.filter no-ctrl no-ctrl
syslog.ident php php
unserialize_callback_func no value no value
upload_max_filesize 2M 2M
upload_tmp_dir no value no value
user_dir no value no value
user_ini.cache_ttl 300 300
user_ini.filename .user.ini .user.ini
variables_order EGPCS EGPCS
xmlrpc_error_number 0 0
xmlrpc_errors Off Off
zend.assertions -1 -1
zend.detect_unicode On On
zend.enable_gc On On
zend.exception_ignore_args On On
zend.exception_string_param_max_len 0 0
zend.max_allowed_stack_size 0 0
zend.multibyte Off Off
zend.reserved_stack_size 0 0
zend.script_encoding no value no value
[ctype]
ctype functions enabled
[curl]
cURL support enabled
cURL Information 8.6.0
Age 10
Features
AsynchDNS Yes
CharConv No
Debug No
GSS-Negotiate No
IDN No
IPv6 Yes
krb4 No
Largefile Yes
libz Yes
NTLM Yes
NTLMWB No
SPNEGO No
SSL Yes
SSPI No
TLS-SRP Yes
HTTP2 No
GSSAPI No
KERBEROS5 No
UNIX_SOCKETS Yes
PSL No
HTTPS_PROXY Yes
MULTI_SSL No
BROTLI Yes
ALTSVC Yes
HTTP3 No
UNICODE No
ZSTD No
HSTS Yes
GSASL No
Protocols dict, file, ftp, ftps, gopher, gophers, http, https, imap, imaps, mqtt, pop3, pop3s, rtsp, smb, smbs, smtp, smtps, telnet, tftp
Host Linux
SSL Version OpenSSL/3.2.1
ZLib Version 1.3.1
Directive Local Value Master Value
curl.cainfo no value no value
[date]
date/time support enabled
timelib version 2022.10
"Olson" Timezone Database Version 2023.4
Timezone Database internal
Default timezone UTC
Directive Local Value Master Value
date.default_latitude 31.7667 31.7667
date.default_longitude 35.2333 35.2333
date.sunrise_zenith 90.833333 90.833333
date.sunset_zenith 90.833333 90.833333
date.timezone UTC UTC
[dba]
DBA support enabled
Supported handlers cdb cdb_make inifile flatfile
Directive Local Value Master Value
dba.default_handler flatfile flatfile
[dom]
DOM/XML enabled
DOM/XML API Version 20031129
libxml Version 2.9.14
HTML Support enabled
XPath Support enabled
XPointer Support enabled
Schema Support enabled
RelaxNG Support enabled
[exif]
EXIF Support enabled
Supported EXIF Version 0220
Supported filetypes JPEG, TIFF
Multibyte decoding support using mbstring enabled
Extended EXIF tag formats Canon, Casio, Fujifilm, Nikon, Olympus, Samsung, Panasonic, DJI, Sony, Pentax, Minolta, Sigma, Foveon, Kyocera, Ricoh, AGFA, Epson
Directive Local Value Master Value
exif.decode_jis_intel JIS JIS
exif.decode_jis_motorola JIS JIS
exif.decode_unicode_intel UCS-2LE UCS-2LE
exif.decode_unicode_motorola UCS-2BE UCS-2BE
exif.encode_jis no value no value
exif.encode_unicode ISO-8859-15 ISO-8859-15
[fileinfo]
fileinfo support enabled
libmagic 543
[filter]
Input Validation and Filtering enabled
Directive Local Value Master Value
filter.default unsafe_raw unsafe_raw
filter.default_flags no value no value
[frankenphp]
Version v1.1.0
[gd]
GD Support enabled
GD Version bundled (2.1.0 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.13.2
GIF Read Support enabled
GIF Create Support enabled
JPEG Support enabled
libJPEG Version 6b
PNG Support enabled
libPNG Version 1.6.43.git
WBMP Support enabled
XBM Support enabled
WebP Support enabled
BMP Support enabled
AVIF Support enabled
TGA Read Support enabled
Directive Local Value Master Value
gd.jpeg_ignore_warning On On
[hash]
hash support enabled
Hashing Engines md2 md4 md5 sha1 sha224 sha256 sha384 sha512/224 sha512/256 sha512 sha3-224 sha3-256 sha3-384 sha3-512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru snefru256 gost gost-crypto adler32 crc32 crc32b crc32c fnv132 fnv1a32 fnv164 fnv1a64 joaat murmur3a murmur3c murmur3f xxh32 xxh64 xxh3 xxh128 haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5
[iconv]
iconv support enabled
iconv implementation libiconv
iconv library version 1.17
Directive Local Value Master Value
iconv.input_encoding no value no value
iconv.internal_encoding no value no value
iconv.output_encoding no value no value
[igbinary]
igbinary support enabled
igbinary version 3.2.15
igbinary APCu serializer ABI 0
igbinary session support yes
Directive Local Value Master Value
igbinary.compact_strings On On
[intl]
Internationalization support enabled
ICU version 74.2
ICU Data version 74.2
ICU TZData version 2023c
ICU Unicode version 15.1
Directive Local Value Master Value
intl.default_locale no value no value
intl.error_level 0 0
intl.use_exceptions Off Off
[json]
json support enabled
[ldap]
LDAP Support enabled
Total Links 0/unlimited
API Version 3001
Vendor Name OpenLDAP
Vendor Version 20607
Directive Local Value Master Value
ldap.max_links Unlimited Unlimited
[libxml]
libXML support active
libXML Compiled Version 2.9.14
libXML Loaded Version 20914
libXML streams enabled
[mbstring]
Multibyte Support enabled
Multibyte string engine libmbfl
HTTP input encoding translation disabled
libmbfl version 1.3.2
mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.
Multibyte (japanese) regex support enabled
Multibyte regex (oniguruma) version 6.9.9
Directive Local Value Master Value
mbstring.detect_order no value no value
mbstring.encoding_translation Off Off
mbstring.http_input no value no value
mbstring.http_output no value no value
mbstring.http_output_conv_mimetypes ^(text/|application/xhtml\+xml) ^(text/|application/xhtml\+xml)
mbstring.internal_encoding no value no value
mbstring.language neutral neutral
mbstring.regex_retry_limit 1000000 1000000
mbstring.regex_stack_limit 100000 100000
mbstring.strict_detection Off Off
mbstring.substitute_character no value no value
[mysqli]
MysqlI Support enabled
Client API library version mysqlnd 8.3.2
Active Persistent Links 0
Inactive Persistent Links 0
Active Links 0
Directive Local Value Master Value
mysqli.allow_local_infile Off Off
mysqli.allow_persistent On On
mysqli.default_host no value no value
mysqli.default_port 3306 3306
mysqli.default_pw no value no value
mysqli.default_socket no value no value
mysqli.default_user no value no value
mysqli.local_infile_directory no value no value
mysqli.max_links Unlimited Unlimited
mysqli.max_persistent Unlimited Unlimited
mysqli.rollback_on_cached_plink Off Off
[mysqlnd]
mysqlnd enabled
Version mysqlnd 8.3.2
Compression supported
core SSL supported
extended SSL supported
Command buffer size 4096
Read buffer size 32768
Read timeout 86400
Collecting statistics Yes
Collecting memory statistics No
Tracing n/a
Loaded plugins mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_caching_sha2_password,auth_plugin_sha256_password
API Extensions mysqli,pdo_mysql
[openssl]
OpenSSL support enabled
OpenSSL Library Version OpenSSL 3.2.1 30 Jan 2024
OpenSSL Header Version OpenSSL 3.2.1 30 Jan 2024
Openssl default config /ssl/openssl.cnf
Directive Local Value Master Value
openssl.cafile no value no value
openssl.capath no value no value
[pcntl]
pcntl support enabled
[pcre]
PCRE (Perl Compatible Regular Expressions) Support enabled
PCRE Library Version 10.42 2022-12-12
PCRE Unicode Version 14.0.0
PCRE JIT Support enabled
PCRE JIT Target x86 64bit (little endian + unaligned)
Directive Local Value Master Value
pcre.backtrack_limit 1000000 1000000
pcre.jit On On
pcre.recursion_limit 100000 100000
[PDO]
PDO support enabled
PDO drivers mysql, pgsql, sqlite
[pdo_mysql]
PDO Driver for MySQL enabled
Client API version mysqlnd 8.3.2
Directive Local Value Master Value
pdo_mysql.default_socket /tmp/mysql.sock /tmp/mysql.sock
[pdo_pgsql]
PDO Driver for PostgreSQL enabled
PostgreSQL(libpq) Version 16.1
[pdo_sqlite]
PDO Driver for SQLite 3.x enabled
SQLite Library 3.43.2
[pgsql]
PostgreSQL Support enabled
PostgreSQL (libpq) Version 16.1
Multibyte character support enabled
Active Persistent Links 0
Active Links 0
I reach to reproduce the crash on a page. I have this crash every refresh with always this stack
Yes, that tells us there is something wrong and with what. But what is the PHP code that causes the issue? I can't see your PHP code, unless you share it or point to the library causing the issue.
I can not share this code. It's not my property but i will try to create a minimalist example.
What happened?
Sometimes (every 5 minutes) i have a crash with segfault. I use the official static build 1.1.0
Build Type
Official static build
Worker Mode
No
Operating System
GNU/Linux
CPU Architecture
x86_64
Relevant log output