Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Crash when generate keystore by mnemonics #62

Closed
mewehk opened this issue Apr 17, 2018 · 6 comments
Closed

Crash when generate keystore by mnemonics #62

mewehk opened this issue Apr 17, 2018 · 6 comments
Labels

Comments

@mewehk
Copy link

mewehk commented Apr 17, 2018

This crash is only happened on Release build configuration, Debug mode is working fine
image

web3swift version: 0.5.1

log:
[libsecp256k1] illegal argument: !secp256k1_fe_is_zero(&ge->x)

bt:

* thread #21, queue = 'com.apple.root.default-qos', stop reason = signal SIGABRT
    frame #0: 0x00000001824852ec libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x0000000182626288 libsystem_pthread.dylib`pthread_kill$VARIANT$mp + 376
    frame #2: 0x00000001823f3d0c libsystem_c.dylib`abort + 140
  * frame #3: 0x0000000105346af4 secp256k1_ios`default_illegal_callback_fn(str=<unavailable>, data=<unavailable>) at secp256k1.c:32 [opt]
    frame #4: 0x00000001053479bc secp256k1_ios`secp256k1_pubkey_load [inlined] secp256k1_callback_call at util.h:24 [opt]
    frame #5: 0x00000001053479b0 secp256k1_ios`secp256k1_pubkey_load(ctx=0x000000011378e6c0, ge=0x0000000170161a80, pubkey=<unavailable>) at secp256k1.c:152 [opt]
    frame #6: 0x000000010534b468 secp256k1_ios`secp256k1_ec_pubkey_combine(ctx=0x000000011378e6c0, pubnonce=0x0000000170161ce8, pubnonces=<unavailable>, n=1) at secp256k1.c:590 [opt]
    frame #7: 0x000000010540c458 web3swift`specialized static SECP256K1.combineSerializedPublicKeys(keys=Swift.Array<Foundation.Data> @ 0x0000000170161c38, outputCompressed=<unavailable>, self=web3swift.SECP256K1) at LibSecp256k1Extension.swift:78 [opt]
    frame #8: 0x00000001054969d4 web3swift`specialized static Web3.Utils.publicToAddressData(_:) [inlined] static web3swift.SECP256K1.combineSerializedPublicKeys(keys: Swift.Array<Foundation.Data>, outputCompressed: Swift.Bool) -> Swift.Optional<Foundation.Data> at Web3+Utils.swift:0 [opt]
    frame #9: 0x00000001054969c8 web3swift`specialized static Web3.Utils.publicToAddressData(self=web3swift.Web3.Utils) at Web3+Utils.swift:74 [opt]
    frame #10: 0x00000001053b6448 web3swift`specialized BIP32Keystore.createNewAccount(parentNode:password:) [inlined] static web3swift.Web3.Utils.publicToAddressData(Foundation.Data) -> Swift.Optional<Foundation.Data> at BIP32Keystore.swift:0 [opt]
    frame #11: 0x00000001053b643c web3swift`specialized BIP32Keystore.createNewAccount(parentNode:password:) at Web3+Utils.swift:93 [opt]
    frame #12: 0x00000001053b643c web3swift`specialized BIP32Keystore.createNewAccount(parentNode=0x00000001064bcd80, self=0x0000000113752560) at BIP32Keystore.swift:106 [opt]
    frame #13: 0x00000001053b6b88 web3swift`specialized BIP32Keystore.init(mnemonics:password:mnemonicsPassword:language:prefixPath:) [inlined] web3swift.BIP32Keystore.createNewAccount(parentNode: web3swift.HDNode, password: Swift.String) throws -> () at BIP32Keystore.swift:0 [opt]
    frame #14: 0x00000001053b6b74 web3swift`specialized BIP32Keystore.init(mnemonics:password:mnemonicsPassword:language:prefixPath:) at BIP32Keystore.swift:86 [opt]
    frame #15: 0x00000001053add40 web3swift`BIP32Keystore.init(mnemonics:password:mnemonicsPassword:language:prefixPath:) at BIP32Keystore.swift:0 [opt]
@shamatar
Copy link
Contributor

shamatar commented Apr 17, 2018 via email

@mewehk
Copy link
Author

mewehk commented Apr 17, 2018

I removed -O3 link flag of secp256k1_iOS in xcconfig file, but still have the problem(after clean)

@shamatar
Copy link
Contributor

shamatar commented Apr 17, 2018 via email

@skywinder skywinder added the bug label Apr 18, 2018
@shamatar
Copy link
Contributor

Confirming a bug. Now hunting to the compiler flag that does it

@shamatar
Copy link
Contributor

@mewehk

Please verify the latest version from master branch. Your issue should be fixed in #65 .

Sincerely, Alex

@mewehk
Copy link
Author

mewehk commented Apr 20, 2018

@shamatar Thank you so much. Yes, it's working

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants