This repository has been archived by the owner on Sep 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Crash when generate keystore by mnemonics #62
Labels
Comments
Looks like excessive compiler optimization of the secp256k1_iOS pod. I’m also an author of it and will remove -O3 compiler optimization for it with a pod update tomorrow. If you want to try by yourself, you can change compiler flags in the corresponding .xcconfig file in a pod and do clean&build
…________________________________
From: mewehk <[email protected]>
Sent: Tuesday, April 17, 2018 1:26:59 PM
To: BANKEX/web3swift
Cc: Subscribed
Subject: [BANKEX/web3swift] Crash when generate keystore by mnemonics (#62)
This crash is only happened on Release build configuration, Debug mode is working fine
[image]<https://user-images.githubusercontent.com/4569632/38866730-69bcfc32-4274-11e8-983b-53c4490eac26.png>
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<#1>: 0x0000000182626288 libsystem_pthread.dylibpthread_kill$VARIANT$mp + 376 frame #2: 0x00000001823f3d0c libsystem_c.dylibabort + 140
* frame #3<#3>: 0x0000000105346af4 secp256k1_iosdefault_illegal_callback_fn(str=<unavailable>, data=<unavailable>) at secp256k1.c:32 [opt] frame #4: 0x00000001053479bc secp256k1_iossecp256k1_pubkey_load [inlined] secp256k1_callback_call at util.h:24 [opt]
frame #5<#5>: 0x00000001053479b0 secp256k1_iossecp256k1_pubkey_load(ctx=0x000000011378e6c0, ge=0x0000000170161a80, pubkey=<unavailable>) at secp256k1.c:152 [opt] frame #6: 0x000000010534b468 secp256k1_iossecp256k1_ec_pubkey_combine(ctx=0x000000011378e6c0, pubnonce=0x0000000170161ce8, pubnonces=, n=1) at secp256k1.c:590 [opt]
frame #7<#7>: 0x000000010540c458 web3swiftspecialized static SECP256K1.combineSerializedPublicKeys(keys=Swift.Array<Foundation.Data> @ 0x0000000170161c38, outputCompressed=<unavailable>, self=web3swift.SECP256K1) at LibSecp256k1Extension.swift:78 [opt] frame #8: 0x00000001054969d4 web3swiftspecialized 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<#9>: 0x00000001054969c8 web3swiftspecialized static Web3.Utils.publicToAddressData(self=web3swift.Web3.Utils) at Web3+Utils.swift:74 [opt] frame #10: 0x00000001053b6448 web3swiftspecialized BIP32Keystore.createNewAccount(parentNode:password:) [inlined] static web3swift.Web3.Utils.publicToAddressData(Foundation.Data) -> Swift.Optional<Foundation.Data> at BIP32Keystore.swift:0 [opt]
frame #11<#11>: 0x00000001053b643c web3swiftspecialized BIP32Keystore.createNewAccount(parentNode:password:) at Web3+Utils.swift:93 [opt] frame #12: 0x00000001053b643c web3swiftspecialized BIP32Keystore.createNewAccount(parentNode=0x00000001064bcd80, self=0x0000000113752560) at BIP32Keystore.swift:106 [opt]
frame #13<#13>: 0x00000001053b6b88 web3swiftspecialized 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 web3swiftspecialized BIP32Keystore.init(mnemonics:password:mnemonicsPassword:language:prefixPath:) at BIP32Keystore.swift:86 [opt]
frame #15<#15>: 0x00000001053add40 web3swiftBIP32Keystore.init(mnemonics:password:mnemonicsPassword:language:prefixPath:) at BIP32Keystore.swift:0 [opt]
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#62>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AGKv9wXDSw03RaKMqR3tm9Y9t_r67NXnks5tpdGDgaJpZM4TYHja>.
|
I removed -O3 link flag of secp256k1_iOS in xcconfig file, but still have the problem(after clean) |
Ok, I’ll have a thorough test on my environment. Thank you for a very quick response.
Sincerely, Alex
…________________________________
From: mewehk <[email protected]>
Sent: Tuesday, April 17, 2018 5:08:24 PM
To: BANKEX/web3swift
Cc: Alexander; Comment
Subject: Re: [BANKEX/web3swift] Crash when generate keystore by mnemonics (#62)
I removed -O3 link flag of secp256k1_iOS in xcconfig file, but still have the problem
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#62 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AGKv93uzlQ2IbFqdKCxwHCUCMRPjz4M5ks5tpgVogaJpZM4TYHja>.
|
Confirming a bug. Now hunting to the compiler flag that does it |
@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.
This crash is only happened on Release build configuration, Debug mode is working fine
web3swift version: 0.5.1
log:
[libsecp256k1] illegal argument: !secp256k1_fe_is_zero(&ge->x)
bt:
The text was updated successfully, but these errors were encountered: