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

fatal runtime error: failed to initiate panic, error 5 #18

Closed
dolcalmi opened this issue Aug 15, 2020 · 8 comments
Closed

fatal runtime error: failed to initiate panic, error 5 #18

dolcalmi opened this issue Aug 15, 2020 · 8 comments
Assignees

Comments

@dolcalmi
Copy link

ClientShim initialization is failing with "fatal runtime error: failed to initiate panic, error 5" (command: node ./demo/ecdsa-party2.js)

I debug it and the line that throws the fatal runtime error is https://github.com/KZen-networks/thresh-sig-js/blob/master/native/src/party2/ecdsa.rs#L99 ( I tested directly downloading the repo and with terra-thresh-wallet repo)

My Environment:

  • OS: Ubuntu 18.04.5 LTS
  • Node version: v10.19.0
  • Rust version: rustc 1.38.0-nightly (0b680cfce 2019-07-09)

Other considerations:

  • The server is running successfully (command: node ./demo/party1.js)
  • I tested updating gotham-city to v0.1.3 but still got the same error
@oleiba
Copy link
Contributor

oleiba commented Aug 16, 2020

Hey, the client implicitly expects the server to be listening on HTTP://localhost:8000.
Could you verify the server is indeed listening on this port?

@dolcalmi
Copy link
Author

dolcalmi commented Aug 16, 2020

yes, is running in that port. I didn't change default settings.

Also, not sure if is related with server connection because is just the initialization of the object (also checked class implementation and does not seems to be doing nothing weird https://github.com/KZen-networks/gotham-city/blob/master/gotham-client/src/lib.rs#L55)

ps: Also I did a test only with gotham and is working (is not a library test but just want to be sure that my OS was not blocking the port or the process)

@dolcalmi
Copy link
Author

dolcalmi commented Aug 16, 2020

I just did another test cloning gotham and adding some println (apologies I dont know rust) and the line that throws the error is https://github.com/KZen-networks/gotham-city/blob/master/gotham-client/src/lib.rs#L56

this is my fork https://github.com/dolcalmi/gotham-city/blob/master/gotham-client/src/lib.rs#L57 ( I only got the first message "gotham ClientShim before client creation http://localhost:8000" )

@oleiba
Copy link
Contributor

oleiba commented Aug 16, 2020

This may also happen if the server does not have the same share id as being queried by the client.
I'd recommend deleting the client's DB (e.g. in terra-thresh-wallet search for the directory client_db, delete it if you didn't generate any important address) and trying again ...

@dolcalmi
Copy link
Author

the last was tested in this library, also no connection was done at that point ( is just an initialization without url or connection to the server let client = reqwest::Client::new();)

@oleiba
Copy link
Contributor

oleiba commented Aug 17, 2020

I tested on a clean Ubuntu 18.04.5 LTS machine with the exact configuration you detailed, and the demo went through.
If you like, we can schedule an online debugging of the issue.

@dolcalmi
Copy link
Author

"One eternity later" and just for future reference.

the error is the same as shown here nodejs/help#2376

and related with the comment in https://docs.rs/reqwest/0.10.7/reqwest/struct.Client.html#method.new

This method panics if native TLS backend cannot be created or initialized. Use Client::builder() if you wish to handle the failure as an Error instead of panicking.

really not sure why is not linking with the OS TLS lib but I had to compile the native lib with the next command (package.json):

"build-rust": "OPENSSL_STATIC=yes OPENSSL_LIB_DIR=<openssl path> neon build -r",

you can get openssl path with:

> openssl version -d

Hope it helps

@oleiba
Copy link
Contributor

oleiba commented Aug 24, 2020

Wow. Thanks for the thorough analysis and reaching back with this info!

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

No branches or pull requests

2 participants