Open roberthusak opened 4 years ago
@roberthusak can we implement symlink
using Mono.Unix.UnixSymbolicLinkInfo.CreateSymbolicLinkTo()
?
@roberthusak I think $x[0]
causes a fatal error in PHP which won't be handled either? Isn't it a different bug in PeachPie?
@roberthusak can we implement
symlink
usingMono.Unix.UnixSymbolicLinkInfo.CreateSymbolicLinkTo()
?
@jakubmisek That's true, we can make it work the same way as chown
. If we want to make it run on Windows as well (PHP does that since Windows Vista), we'll just need to find an appropriate way (maybe using P/Invoke as here), as .NET Standard seems not to have the API yet.
@roberthusak I think
$x[0]
causes a fatal error in PHP which won't be handled either? Isn't it a different bug in PeachPie?
In fact, it throws a catchable Error
(it seems the fatal error is caused by not catching it), try this code (tested on PHP 7.4.1):
function test($a) {
try {
echo $a[0];
} catch (Throwable $e) {
echo get_class($e);
}
}
test(new stdClass());
The reason why this error occurred at all is probably a bug in Peachpie (or some kind of incompatibility), which will require further investigation (as well as in the case of other unsuccessful tests).
Note - large getid3_quicktime.QuicktimeParseAtom
stack size might be caused when debugging since the compiler emits IndirectLocal
for each local variable to be displayed in IDE's "Locals" window.
This might help: https://github.com/peachpiecompiler/peachpie/commit/df2266aa88ef0f0ef0a235fc97e55a00df34c975
Note - large
getid3_quicktime.QuicktimeParseAtom
stack size might be caused when debugging since the compiler emitsIndirectLocal
for each local variable to be displayed in IDE's "Locals" window.This might help: df2266a
Unfortunately, this doesn't help. The stack overflow still happens even with the latest commit of Peachpie and even in Release
.
issue with stack size in getid3_quicktime.QuicktimeParseAtom
is related to https://github.com/dotnet/runtime/issues/8980
The method is too large for JIT. The solution would be for us to emit fewer temp value types on the stack.
This issue summarizes all the problems which cause WordPress PHPUnit tests to end prematurely (uncaught .NET exception, stack overflow etc.) or pollute output with extra text. Currently, they are solved by workarounds - by commenting certain parts out or by skipping. Some of them might require further investigation.
[x]
function_exists( 'add_filter' )
(see here) is replaced bytrue
even thoughadd_filter
(defined inPeachPied.WordPress
) might not be defined in the currentContext
if it's definition hasn't been included yet.[ ]
symlink
function is defined but throwsNotSupportedException
, which is not caught by PHPUnit.[x]
imagecopyresampled
doesn't support negative$src_w
and$src_h
. They should flip the image, see here.[x]
DOMDocument::loadHTML
throws an exception when parsing/
in<input readonly/>
- it thinks thatreadonly/
is a (obviously invalid) name of a parameter.[x]
XSLTProcessor::importStylesheet
doesn't supportsimplexml
.[ ]
getid3_quicktime.QuicktimeParseAtom
(see here) occupies 267 200 bytes on the call stack, causing stack overflow.[x] When
$x
is e.g.stdClass
,$x[0]
causesInvalidOperationException
, unable to be caught by PHPUnit.[ ] It seems that the MySQL connections are not closed (maybe due to a single
Context
for all tests and different behaviour of destructors?), reaching default number ofmax_connections
option in about the third of the tests (returning the error:Too many connections
). The current workaround is to increase the option manually.[x]
file_exists
doesn't take into account source files contained in PHAR archives. (it should use internalStreamWrapper
API, the same for SplFileInfo, stat, etc.)[ ] As
wp-includes/class-json.php
is excluded from WordPress compilation due to the missingPEAR_Error
class, the test ofServices_JSON
must be skipped for now.[ ] Class
GP_Locale
is dynamically downloaded and included (see here), which currently causes its definition to be output. Including it in the tests statically should prevent this from happening.