View Issue Details

IDProjectCategoryView StatusLast Update
0001876XdebugInstallationpublic2021-03-17 08:37
Reporterdlr Assigned To 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionno change required 
Product Version2.9.8 
Summary0001876: ZEND_LONG_FMT error while installing xdebug on macos
Description

When trying to install xdebug for php 7.4 on my mac : pecl install xdebug I get this error during make:

cc -I. -I/private/tmp/pear/temp/xdebug -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-dlrJPgTEe/xdebug-2.9.8/include -I/private/tmp/pear/temp/pear-build-dlrJPgTEe/xdebug-2.9.8/main -I/private/tmp/pear/temp/xdebug -I/usr/local/Cellar/php/7.4.11/include/php -I/usr/local/Cellar/php/7.4.11/include/php/main -I/usr/local/Cellar/php/7.4.11/include/php/TSRM -I/usr/local/Cellar/php/7.4.11/include/php/Zend -I/usr/local/Cellar/php/7.4.11/include/php/ext -I/usr/local/Cellar/php/7.4.11/include/php/ext/date/lib -I/private/tmp/pear/temp/xdebug/src -I/private/tmp/pear/temp/pear-build-dlrJPgTEe/xdebug-2.9.8/src -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/xdebug/src/base/base.c -fno-common -DPIC -o src/base/.libs/base.o/private/tmp/pear/temp/xdebug/src/base/base.c:325:83: error: expected ')'
zend_throw_exception_ex(zend_ce_error, 0, "Maximum function nesting level of '" ZEND_LONG_FMT "' reached, aborting!", XINI_BASE(max_nesting_level));
^
/usr/local/Cellar/php/7.4.11/include/php/Zend/zend_long.h:57:28: note: expanded from macro 'ZEND_LONG_FMT'

define ZEND_LONG_FMT "%" PRId64

Additional Information

PHP 7.4.11 (cli) (built: Oct 1 2020 23:30:54) ( NTS )
System Version: macOS 10.15.7 (19H2)
Kernel Version: Darwin 19.6.0

TagsNo tags attached.
Operating System
PHP Version7.4.0-7.4.4

Activities

derick

2020-11-03 16:47

administrator   ~0005493

I can't reproduce this, and my CI that I run on OSX also does not see this problem.

Please add the full output (as a file, don't paste it) of the following commands:


cd /tmp
pecl download xdebug-2.9.8
tar -xvzf xdebug-2.9.8.tgz
cd xdebug-2.9.8
phpize
./configure
make
make install

dlr

2020-11-03 17:48

reporter   ~0005498

Hello derick,
please find here attached the output.

Let me know if you need more informations/test/outputs.
Regards

derick

2020-11-04 08:52

administrator   ~0005499

That's only the output from "make", not all the commands, which is what I asked for.

dlr

2020-11-04 09:09

reporter   ~0005500

Hello derick,
i'm sorry please find full file here attached.

Regards

derick

2020-11-11 12:48

administrator   ~0005517

In the /tmp/xdebug-2.9.8 directory, can you run the following:


cc -E -I. -I/tmp/xdebug-2.9.8 -DPHP_ATOM_INC -I/tmp/xdebug-2.9.8/include -I/tmp/xdebug-2.9.8/main -I/tmp/xdebug-2.9.8 -I/usr/local/Cellar/php/7.4.12/include/php -I/usr/local/Cellar/php/7.4.12/include/php/main -I/usr/local/Cellar/php/7.4.12/include/php/TSRM -I/usr/local/Cellar/php/7.4.12/include/php/Zend -I/usr/local/Cellar/php/7.4.12/include/php/ext -I/usr/local/Cellar/php/7.4.12/include/php/ext/date/lib -I/tmp/xdebug-2.9.8/src -DHAVE_CONFIG_H -g -O2 -c /tmp/xdebug-2.9.8/src/base/base.c -fno-common -DPIC -o /tmp/output.c.txt

And then attach the output of /tmp/output.c.txt ?

dlr

2020-11-11 16:53

reporter   ~0005518

Hello derick,
here is the requested file.

Regards
David

derick

2020-11-12 15:59

administrator   ~0005521

Last edited: 2020-11-12 15:59

FWIW, there is an Xdebug ticket for this too: https://bugs.xdebug.org/view.php?id=1876, but so far, I am puzzled on why this happens. The ZEND_LONG_FMT macro uses the PRId64 macro which your OS should define, through the inttypes.h header file.

In my case (on Linux) it is in /usr/include/inttypes.h, as:

define __PRI64_PREFIX "ll"

...

define PRId64 __PRI64_PREFIX "d"

I can see from a debugging file that you have provided that it includes the file /usr/local/include/inttypes.h. As I don't have a mac, I can't check that file.

However, somebody else has stated that the /usr/local/include/inttypes.h file does not even exist on their OSX, and that instead that it should be
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/inttypes.h instead.

Could /usr/local/include/inttypes.h have come from a weird source and messes things up? Can you attach both the /usr/local/include/inttypes.h file, and the one that you can find (perhaps) under /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/?

In any case, I don't think this is a bug in either Xdebug (or PHP), but rather a broken header somewhere on OSX.

dlr

2020-11-13 16:19

reporter   ~0005525

Yes, thats make it !
Many thanks and sorry to have bother you

derick

2020-11-14 09:48

administrator   ~0005527

That's alright. Let me know how you solved it please though? So that others that ran into this can refer back to your solution too.

derick

2021-03-17 08:37

administrator   ~0005720

Just closing this out as there was no bug in Xdebug.