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

Solc error log shown when application throws an error #505

Closed
miguelmtzinf opened this issue Dec 3, 2020 · 3 comments
Closed

Solc error log shown when application throws an error #505

miguelmtzinf opened this issue Dec 3, 2020 · 3 comments
Labels

Comments

@miguelmtzinf
Copy link

miguelmtzinf commented Dec 3, 2020

When my application crashes (exception thrown with no handler) the library solc (using latest version) show an error which should not be shown (since It is not an error from solc itself)

/home/myuser/solc-spike/node_modules/solc/soljson.js:32
(Module.asmGlobalArg,Module.asmLibraryArg,buffer);var __GLOBAL__I_000101=Module["__GLOBAL__I_000101"]=asm["__GLOBAL__I_000101"];var __GLOBAL__sub_I_ABIFunctions_cpp=Module["__GLOBAL__sub_I_ABIFunctions_cpp"]=asm["__GLOBAL__sub_I_ABIFunctions_cpp"];var __GLOBAL__sub_I_ABI_cpp=Module["__GLOBAL__sub_I_ABI_cpp"]=asm["__GLOBAL__sub_I_ABI_cpp"];var __GLOBAL__sub_I_ASTJsonConverter_cpp=Module["__GLOBAL__sub_I_ASTJsonConverter_cpp"]=asm["__GLOBAL__sub_I_ASTJsonConverter_cpp"];var __GLOBAL__sub_I_AST_cpp=Module["__GLOBAL__sub_I_AST_cpp"]=asm["__GLOBAL__sub_I_AST_cpp"];var __GLOBAL__sub_I_ArrayUtils_cpp=Module["__GLOBAL__sub_I_ArrayUtils_cpp"]=asm["__GLOBAL__sub_I_ArrayUtils_cpp"];var __GLOBAL__sub_I_AsmAnalysis_cpp=Module["__GLOBAL__sub_I_AsmAnalysis_cpp"]=asm["__GLOBAL__sub_I_AsmAnalysis_cpp"];var __GLOBAL__sub_I_BMC_cpp=Module["__GLOBAL__sub_I_BMC_cpp"]=asm["__GLOBAL__sub_I_BMC_cpp"];var __GLOBAL__sub_I_CHC_cpp=Module["__GLOBAL__s
abort({"errno":-21,"code":"EISDIR","syscall":"read"}). Build with -s ASSERTIONS=1 for more info.

(I think related to ESM encryption, I see old issues about this, but still happening...)

Code snippet:



const solc = require('solc');


(async () => {
  throw new Error('bla');
})()
//.catch((err) => {
//  console.log('ei')
//});

Running this code snippet will show an error from solc with no reason.... If you uncomment last 3 lines, you will remove the error. Why solc is handling uncaught exceptions?

@Leask
Copy link

Leask commented Aug 4, 2021

This may help:

// solc init
const solc = require('solc');
const uncRjc = 'unhandledRejection';
const listeners = process.listeners(uncRjc);
process.removeListener(uncRjc, listeners[listeners.length - 1]);

@cameel cameel added the bug 🐛 label Nov 3, 2021
@cameel
Copy link
Member

cameel commented Nov 3, 2021

There was a duplicate of this issue reported and I moved it to the solidity repo because it's really a problem with the binary, not solc-js. I'm not closing this one to make it visible to anyone else who would potentially want to report it but any discussion should go into ethereum/solidity#12228 instead.

@ethereum ethereum locked and limited conversation to collaborators Nov 3, 2021
@nikola-matic
Copy link
Contributor

Should be solved as of 0.8.12 (see ethereum/solidity#12228 (comment))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
No open projects
Status: Implement
Development

No branches or pull requests

4 participants