Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error when dlopen() fails #21

Closed
Erikvv opened this issue Nov 18, 2021 · 1 comment · Fixed by #32
Closed

Improve error when dlopen() fails #21

Erikvv opened this issue Nov 18, 2021 · 1 comment · Fixed by #32

Comments

@Erikvv
Copy link
Collaborator

Erikvv commented Nov 18, 2021

For various platform compatibility issues there is the error for the user:

Failed loading '/srv/apps/storj/vendor/storj/uplink/build/libuplink.so'

dlerror() usually contains more information about why it failed and can help the user fix the problem. I should add that to the error. Possibly improve PHP core.

@Erikvv Erikvv changed the title Better errors Better error when dlopen() fails Nov 18, 2021
@Erikvv Erikvv changed the title Better error when dlopen() fails Impreve error when dlopen() fails Nov 18, 2021
@Erikvv Erikvv changed the title Impreve error when dlopen() fails Improve error when dlopen() fails Nov 18, 2021
@Erikvv
Copy link
Collaborator Author

Erikvv commented Dec 23, 2021

Possible it can be called like so:

$ffi = FFI::cdef("char *dlerror(void);")
$ffi->dlerror();

Erikvv added a commit that referenced this issue Jun 25, 2022
When the uplink library cannot be loaded, there is currently a generic
message originating from PHP. This is in all PHP versions.

This change adds extra information which will help the user diagnose the
issue.

Example of old output:

Fatal error: Uncaught FFI\Exception: Failed loading '/app/build/libuplink-x86_64-linux.so' in /app/src/Uplink.php:42

Example of new output:

Fatal error: Uncaught FFI\Exception: Failed loading '/app/build/libuplink-x86_64-linux.so'. /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /app/build/libuplink-x86_64-linux.so) in /app/src/Uplink.php:60

Fixes #21
Erikvv added a commit that referenced this issue Jul 3, 2022
When the uplink library cannot be loaded, there is currently a generic
message originating from PHP. This is in all PHP versions.

This change adds extra information which will help the user diagnose the
issue.

Example of old output:

Fatal error: Uncaught FFI\Exception: Failed loading '/app/build/libuplink-x86_64-linux.so' in /app/src/Uplink.php:42

Example of new output:

Fatal error: Uncaught FFI\Exception: Failed loading '/app/build/libuplink-x86_64-linux.so'. /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /app/build/libuplink-x86_64-linux.so) in /app/src/Uplink.php:60

Fixes #21
Erikvv added a commit that referenced this issue Jul 20, 2022
When the uplink library cannot be loaded, there is currently a generic
message originating from PHP. This is in all PHP versions.

This change adds extra information which will help the user diagnose the
issue.

Example of old output:

Fatal error: Uncaught FFI\Exception: Failed loading '/app/build/libuplink-x86_64-linux.so' in /app/src/Uplink.php:42

Example of new output:

Fatal error: Uncaught FFI\Exception: Failed loading '/app/build/libuplink-x86_64-linux.so'. /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /app/build/libuplink-x86_64-linux.so) in /app/src/Uplink.php:60

Fixes #21
Erikvv added a commit that referenced this issue Jul 20, 2022
When the uplink library cannot be loaded, there is currently a generic
message originating from PHP. This is in all PHP versions.

This change adds extra information which will help the user diagnose the
issue.

Example of old output:

Fatal error: Uncaught FFI\Exception: Failed loading '/app/build/libuplink-x86_64-linux.so' in /app/src/Uplink.php:42

Example of new output:

Fatal error: Uncaught FFI\Exception: Failed loading '/app/build/libuplink-x86_64-linux.so'. /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /app/build/libuplink-x86_64-linux.so) in /app/src/Uplink.php:60

Fixes #21
Erikvv added a commit that referenced this issue Jul 20, 2022
When the uplink library cannot be loaded, there is currently a generic
message originating from PHP. This is in all PHP versions.

This change adds extra information which will help the user diagnose the
issue.

Example of old output:

Fatal error: Uncaught FFI\Exception: Failed loading '/app/build/libuplink-x86_64-linux.so' in /app/src/Uplink.php:42

Example of new output:

Fatal error: Uncaught FFI\Exception: Failed loading '/app/build/libuplink-x86_64-linux.so'. /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /app/build/libuplink-x86_64-linux.so) in /app/src/Uplink.php:60

Fixes #21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant