eos icon indicating copy to clipboard operation
eos copied to clipboard

transfer string to double got fatal error!

Open dawnFromDark opened this issue 7 years ago • 6 comments

when i use this function strtod in my contract ,it will report a error like the following: image i tested many times,and you guys can test on your enviroment. my compiler is eosio-cpp version 1.6.1 and nodeos version is:v1.7.3 master branch And the strtod function is standard function,right??????

dawnFromDark avatar May 13 '19 06:05 dawnFromDark

when you execute your action which contain strtod ,it will get the error like that.

dawnFromDark avatar May 13 '19 06:05 dawnFromDark

I can reproduce this issue by calling "strtod" inside a smartcontract. looks like the implementation of "strtod" is buggy.

Error 3070002: Runtime Error Processing WASM
Error Details:
wabt execution failure (out of bounds memory access)

taokayan avatar May 14 '19 06:05 taokayan

The reason is that the current implementation of strtod uses some local variables of size larger than 8KB which results in stack underflow.

taokayan avatar May 15 '19 06:05 taokayan

The reason is that the current implementation of strtod uses some local variables of size larger than 8KB which results in stack underflow. so ,how should we to solve this,honey?

dawnFromDark avatar May 16 '19 01:05 dawnFromDark

you can implement your own strtod, or wait for the fix (in https://github.com/EOSIO/musl/pull/10) in the next version of cdt

taokayan avatar May 17 '19 02:05 taokayan

you can implement your own strtod, or wait for the fix (in EOSIO/musl#10) in the next version of cdt

ok, i will wait that, thank you.

dawnFromDark avatar May 17 '19 09:05 dawnFromDark