Skip to content
New issue

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

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

Already on GitHub? # to your account

solc-js throws an error with just a number; trouble compiling strings.js #44

Closed
tcoulter opened this issue Aug 29, 2016 · 6 comments
Closed

Comments

@tcoulter
Copy link

When you try to compile solidity stringutils's strings.sol, solc-js will throw an error with only a number as its error message. I've created a github project showing how you can reproduce the error, link below. This error was originally posted on Truffle's issue tracker here.

https://github.com/tcoulter/solc-result-bug

$ ./index.js

/Users/tim/Documents/workspace/Consensys/solcbug/node_modules/solc/soljson.js:1 (function (exports, require, module, __filename, __dirname) { var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath"normalize";var ret=nodeFS["readFil
6042264

$

@axic
Copy link
Member

axic commented Aug 29, 2016

I think those numeric errors are C++ exceptions not properly handled. Probably it is a memory offset pointer. It is printed by Emscripten and not the console.log lines you have in your demo code.

@tcoulter
Copy link
Author

tcoulter commented Aug 29, 2016

not the console.log lines you have in your demo code

Correct. Those were for me to ensure they were never reached. They can be removed.

@axic
Copy link
Member

axic commented Aug 29, 2016

@tcoulter were you able to somehow reduce string.sol to a smaller instance which still has this problem?

@tcoulter
Copy link
Author

Ah, my bad. I didn't try.

@tcoulter
Copy link
Author

I can likely give it a shot later today.

@axic
Copy link
Member

axic commented Aug 29, 2016

@tcoulter moved to ethereum/solidity#971 - can you please comment your findings there later?

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

No branches or pull requests

2 participants