Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#64953 closed defect (fixed)

php81-mailparse @3.1.3_0: fails to load with error symbol not found in flat namespace '_mbfl_convert_filter_delete'

Reported by: slaakso (Seppo Laaksonen) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: monterey Cc: chrisminett (Chris Minett)
Port: php-mailparse, php-event

Description

With a clean install the php81-mailparse into macOS Monterey fails to load with error:

PHP Warning:  PHP Startup: Unable to load dynamic library 'mailparse.so' (tried: /opt/local/lib/php81/extensions/no-debug-non-zts-20210902/mailparse.so (dlopen(/opt/local/lib/php81/extensions/no-debug-non-zts-20210902/mailparse.so, 0x0009): symbol not found in flat namespace '_mbfl_convert_filter_delete'), /opt/local/lib/php81/extensions/no-debug-non-zts-20210902/mailparse.so.so (dlopen(/opt/local/lib/php81/extensions/no-debug-non-zts-20210902/mailparse.so.so, 0x0009): tried: '/usr/local/mysql/lib/mailparse.so.so' (no such file), '/mailparse.so.so' (no such file), '/opt/local/lib/php81/extensions/no-debug-non-zts-20210902/mailparse.so.so' (no such file))) in Unknown on line 0

Tried the install from source, but with same result. _mbfl_convert_filter_delete seems to refer to mbstring which is also installed.

Change History (8)

comment:1 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… removed
Owner: set to ryandesign
Port: @3.1.3_0 removed
Status: newassigned

comment:2 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Port: php-mailparse added; php81-mailparse removed
Status: assignedaccepted

Thank you for the report! I agree it does do that on Monterey but not on Big Sur. I am investigating.

comment:3 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

This seems to be another instance of the loader on macOS 12 being pickier than on earlier OS versions about missing symbols. (#64448 is another such case.) This symbol, as you noted, is provided by mbstring, but PHP extensions are loaded alphabetically, so at the moment that mailparse is loaded, this mbstring symbol is not yet there.

As a workaround, rename /opt/local/var/db/php81/mailparse.ini so that it comes alphabetically after mbstring.ini, for example:

sudo mv /opt/local/var/db/php81/mailparse.ini /opt/local/var/db/php81/zmailparse.ini

If you do this, be prepared to redo it if you upgrade php81-mailparse, and to undo it once a better fix is found.

I'm still trying to find out if this is a bug in mailparse or mbstring that can be fixed without needing to resort to reordering the .ini files. If not, I'll change php-mailparse so that it does rename its .ini file automatically.

comment:4 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Port: php-event added

php-event has the same problem (it depends on php-sockets):

Warning: PHP Startup: Unable to load dynamic library 'event.so' (tried: /opt/local/lib/php81/extensions/no-debug-non-zts-20210902/event.so (dlopen(/opt/local/lib/php81/extensions/no-debug-non-zts-20210902/event.so, 0x0009): symbol not found in flat namespace '_socket_ce'), /opt/local/lib/php81/extensions/no-debug-non-zts-20210902/event.so.so (dlopen(/opt/local/lib/php81/extensions/no-debug-non-zts-20210902/event.so.so, 0x0009): tried: '/opt/local/lib/php81/extensions/no-debug-non-zts-20210902/event.so.so' (no such file))) in Unknown on line 0

although curiously php-event has this problem macOS 11 and earlier too. Not sure why mailparse only has this problem on macOS 12 then.

And I've encountered it before in php-http2, and renaming the .ini file is what I did there so I'll do that here too.

comment:5 Changed 2 years ago by slaakso (Seppo Laaksonen)

OK. That will dot it.

Thank you for the prompt investigation.

comment:6 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

In 0181787b728d2570f11f7cbb9cc6adf057df7905/macports-ports (master):

php-event: Rename ini file to fix load order

Rename ini file so that this extension loads after its dependency. php
5 and 7 didn't seem to care about this but php 8 does.

See: #64953

comment:7 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In 59ce5109cb1f81fb07a4e59c37e633b1346cc640/macports-ports (master):

php-mailparse: Rename ini file to fix load order

Rename ini file so that this extension loads after its dependency. macOS
11 and earlier didn't seem to care about this but macOS 12 does.

Closes: #64953

comment:8 Changed 2 years ago by chrisminett (Chris Minett)

Cc: chrisminett added
Note: See TracTickets for help on using tickets.