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

PHP: Turn ExitStatus into a subclass of Error #450

Closed
adamziel opened this issue May 25, 2023 · 2 comments
Closed

PHP: Turn ExitStatus into a subclass of Error #450

adamziel opened this issue May 25, 2023 · 2 comments
Labels
[Feature] PHP.wasm [Type] Bug An existing feature does not function as intended

Comments

@adamziel
Copy link
Collaborator

As seen in #416, unexpected WASM crashes throw an ExitStatus instance without any stack trace attached. This makes debugging and reporting very difficult. Emscripten does it on purpose to prevent memory leaks during shutdown, but we want to kill the entire process on failure so memory leaks are not a big issue.

This is the change we need to ensure in php.js – it could be by patching the file or re-assigning the ExitStatus value in the Playground JS library for Emscripten:

  class ExitStatus extends Error {
	  constructor(status) {
		  super(status);
		  this.name = "ExitStatus";
		  this.message = "Program terminated with exit(" + status + ")";
		  this.status = status;
	  }
  }

Kudos to @wojtekn for identifying the problem

@adamziel adamziel added [Type] Bug An existing feature does not function as intended [Feature] PHP.wasm labels May 25, 2023
@adamziel
Copy link
Collaborator Author

Fixing this could potentially give us better error information in #346

@adamziel
Copy link
Collaborator Author

adamziel commented Jun 2, 2023

Solved in #470

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] PHP.wasm [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

1 participant