theseer / phpdox

Documentation generator for PHP Code using standard technology (SRC, DOCBLOCK, XML and XSLT)
http://phpdox.de
Other
599 stars 121 forks source link

Crash under Debian 9 / PHP 7.0 #343

Closed frachonl closed 6 years ago

frachonl commented 6 years ago

Using as Jenkins documentation, we upgraded recently to PHP 7.0, and face a crash now

/var/lib/jenkins/workspace/XXXXX/build/common-build/vendor/bin/phpdox --backends ; echo $?
phpDox 0.8.2-dev - Copyright (C) 2010 - 2018 by Arne Blankerts

[19.10.2018 - 09:29:56] Using config file './phpdox.xml'
[19.10.2018 - 09:29:56] Registered collector backend 'parser'
[19.10.2018 - 09:29:56] Registered enricher 'build'
[19.10.2018 - 09:29:56] Registered enricher 'git'
[19.10.2018 - 09:29:56] Registered enricher 'checkstyle'
[19.10.2018 - 09:29:56] Registered enricher 'phpcs'
[19.10.2018 - 09:29:56] Registered enricher 'pmd'
[19.10.2018 - 09:29:56] Registered enricher 'phpunit'
[19.10.2018 - 09:29:56] Registered enricher 'phploc'
[19.10.2018 - 09:29:56] Registered output engine 'xml'
[19.10.2018 - 09:29:56] Registered output engine 'html'

The following backends are registered:

   parser    PHP Parser

Oups... phpDox encountered a problem and has terminated!

It most likely means you've found a bug, so please file a report for this
and paste the following details and the stacktrace (if given) along:

PHP Version: 7.0.30-0+deb9u1 (Linux)
PHPDox Version: 0.8.2-dev
ErrorException: E_CORE_WARNING 
Location: Unknown (Line 0)

Module 'PDO' already loaded

No stacktrace available

0

What could I provide to help resolving ?

frachonl commented 6 years ago

Stracing the real Jenkins call, here is the "crash" just after correct results:

lstat("/var/lib/jenkins/workspace/XXXXX/build/common-build/vendor/theseer/phpdox/../..//phpunit/php-timer/src/Timer.php", {st_mode=S_IFREG|0644, st_size=2319, ...}) = 0
lstat("/var/lib/jenkins/workspace/XXXXX/build/common-build/vendor/theseer/phpdox/../..//phpunit/php-timer/src", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/var/lib/jenkins/workspace/XXXXX/build/common-build/vendor/theseer/phpdox/../..//phpunit/php-timer", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/var/lib/jenkins/workspace/XXXXX/build/common-build/vendor/theseer/phpdox/../..//phpunit", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/var/lib/jenkins/workspace/XXXXX/build/common-build/vendor/phpunit/php-timer/src/Timer.php", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2319, ...}) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=2319, ...}) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=2319, ...}) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=2319, ...}) = 0
mmap(NULL, 2319, PROT_READ, MAP_SHARED, 3, 0) = 0x7f5443151000
munmap(0x7f5443151000, 2319)            = 0
close(3)                                = 0
write(1, "Time: 5.67 seconds, Memory: 4.00"..., 34Time: 5.67 seconds, Memory: 4.00MB) = 34
write(1, "\n\n", 2

)                     = 2
write(2, "\n\nOups... phpDox encountered a p"..., 59

Oups... phpDox encountered a problem and has terminated!
) = 59
write(2, "\nIt most likely means you've fou"..., 75
[...]

All the files seems properly generated

drwxr-xr-x  3 jenkins jenkins  4096 oct.  19 13:35 traits
drwxr-xr-x 71 jenkins jenkins 12288 oct.  19 13:35 classes
-rw-r--r--  1 jenkins jenkins  1839 oct.  19 13:35 index.html
-rw-r--r--  1 jenkins jenkins  5511 oct.  19 13:35 namespaces.html
-rw-r--r--  1 jenkins jenkins  1650 oct.  19 13:35 traits.html
-rw-r--r--  1 jenkins jenkins  1081 oct.  19 13:35 interfaces.html
-rw-r--r--  1 jenkins jenkins 33563 oct.  19 13:35 classes.html
drwxr-xr-x  9 jenkins jenkins  4096 oct.  19 13:35 source
drwxr-xr-x  2 jenkins jenkins  4096 oct.  19 13:35 css

Any idea ?

theseer commented 6 years ago

Your PHP Environment is broken, as a CORE warning cannot be triggered from userland code:

ErrorException: E_CORE_WARNING Location: Unknown (Line 0)

Module 'PDO' already loaded

You somehow try to load the pdo.so twice, which PHP doesn't like. phpDox checkes on shutdown if any unhandled errors occured but doesn't know how to handle CORE Warnings (yet).

This technically is not a bug in phpDox.

frachonl commented 6 years ago

Ok, will investigate that way. Thanks