31 Commits

Author SHA1 Message Date
Dylan K. Taylor
5325ecee37
Deal with a whole lot of PHPStan suppressed key casting errors
closes #6534
2024-11-25 14:30:58 +00:00
Dylan K. Taylor
98380e46bf
Ignore non-fatal error types in crash handlers
ErrorToExceptionHandler currently prevents these from appearing by turning them into exceptions, but this won't always be the case.
For example, in the future we may not want to turn ALL types of E_* errors into exceptions (e.g. E_DEPRECATED).
2024-04-02 19:22:40 +01:00
Dylan K. Taylor
7ce33d9375
Migrate final remaining EnumTrait users to native enums 2023-09-08 10:34:12 +01:00
Dylan K. Taylor
5a010e8213
Merge branch 'minor-next' into stable 2023-09-06 12:06:15 +01:00
Dylan K. Taylor
690ee4c574
CrashDump: fixed empty elements in lastError trace
as shown by #6010
2023-09-06 11:24:08 +01:00
Dylan K. Taylor
31d8cc1cb5
Generate and use constants for pocketmine.yml constant names
a couple of usages of properties that no longer exist couldn't be migrated.
in addition, this revealed a couple of dead properties in the default file.

this is not an ideal solution (I'd much rather model the configs using classes and map them) but in the absence of a good and reliable library to do that, this is the next best thing.
2023-08-25 13:23:38 +01:00
Dylan K. Taylor
18ca3a37d9
CrashDump: fixed crashdump generation failure on fatal error
closes #6007
2023-08-21 14:51:54 +01:00
Dylan T
82a5ea9ed3
Allow thread errors and their traces to be properly recorded in crashdumps (#5910)
until now, any thread crash would show as a generic crash since we aren't able to get the trace from the crashed thread directly. This uses some dirty tricks to export a partially serialized stack trace to the main thread, where it can be written into a crashdump.
This enables us to see proper crash information for async tasks in the crash archive (finally!!!) as well as being able to capture RakLib errors properly.
2023-07-26 16:26:03 +01:00
Muqsit Rayyan
3948dc4f75
Remove calls to ReflectionProperty::setAccessible() (#5783)
This is a no-op in PHP 8.1 and up.
2023-05-31 14:03:14 +01:00
Alexey
172ce659b8
Use str_starts_with, str_ends_with and str_contains instead of strpos (#5485) 2022-12-31 13:02:23 +00:00
Dylan K. Taylor
d79e6354a0
Merge branch 'stable' into next-minor 2022-11-25 14:41:05 +00:00
Dylan K. Taylor
6562335120
CrashDump: fixed failure to generate crash report when error messages contain invalid characters
closes #2986
2022-11-15 22:00:20 +00:00
Dylan K. Taylor
7bcc663b60
Migrate core code to using symfony/filesystem
webmozart/path-util is retained for plugin compatibility, but is dropped in 5.0
2022-10-14 21:51:29 +01:00
Dylan K. Taylor
0e73ffe555
CrashDump: Added JIT mode to data
this is necessary for identifying JIT-specific bugs, which, unfortunately, are very common.
2022-08-25 17:39:40 +01:00
Dylan K. Taylor
38d6284671
Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
Dylan K. Taylor
221c6b8570
Remove useless @var 2022-05-17 20:46:24 +01:00
Dylan K. Taylor
d11d77d328
Modernize private property declarations in src/crash 2022-05-17 20:35:24 +01:00
Dylan K. Taylor
c6374b79b0
Improve crashdump ergonomics
hopefully this will result in less people making useless pastes that don't contain backtraces ...
2022-03-24 19:46:11 +00:00
Dylan K. Taylor
4e956d5d1d
Replace remaining disallowed operators 2022-01-20 19:23:19 +00:00
Dylan K. Taylor
75fc7a2d1f
Merge branch 'stable' into next-minor 2022-01-07 20:16:35 +00:00
Dylan K. Taylor
6d249026cc
Merge branch 'legacy/pm3' into stable 2022-01-07 20:15:15 +00:00
Dylan K. Taylor
77a74d84e2
CrashDump: phpversion() could return false for a loaded extension
if the extension wrote NULL into the zend_module_entry->version field, phpversion() will return false.
2021-12-08 19:58:28 +00:00
Dylan K. Taylor
889d048ca3
Make use of Utils::assumeNotFalse() in a bunch of places
I've stuck to only doing this in the places where I'm sure we should never get false back. Other places I'm less sure of (and I found more bugs along the way).
2021-12-08 19:39:04 +00:00
Dylan K. Taylor
8b73549355
Use JSON_THROW_ON_ERROR for json_encode() and json_decode() 2021-12-08 19:14:07 +00:00
Dylan K. Taylor
533d3aae8b
Merge branch 'stable' 2021-11-26 22:41:18 +00:00
Dylan K. Taylor
020cd7b966
CrashDump: fixed encodedData being uninitialized before getEncodedData() is called 2021-11-22 22:31:07 +00:00
Dylan K. Taylor
c37c261c0f
Separate crashdump file generation from crashdump data collection
this allows CrashDump to be used just to generate data, which will come in useful for non-crash error reporting in the future (e.g. packet decoding errors).
2021-11-22 22:19:40 +00:00
Dylan K. Taylor
4599913034
Separate crashdump rendering from crashdump data collection
this allows this code to be reused for reproducing crashdumps based on the original data.
2021-11-18 00:58:20 +00:00
Dylan K. Taylor
269231c228
Ban foreach(arrayWithStringKeys as k => v)
this is not as good as phpstan/phpstan-src#769 (e.g. array_key_first()/array_key_last() aren't covered by this, nor is array_rand()) but it does eliminate the most infuriating cases where this usually crops up.
2021-11-15 22:52:05 +00:00
Dylan K. Taylor
84f8b3eb2d
Move CrashDump to pocketmine\crash namespace 2021-11-04 19:23:45 +00:00
Dylan K. Taylor
8ac999cbd4
Use object models for crashdump generation 2021-11-04 16:55:04 +00:00