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

[BUG] Freeze when trying to increase fee (or "View transaction", transaction dialog, tx preview) #6914

Closed
olso opened this issue Jan 5, 2021 · 35 comments

Comments

@olso
Copy link

olso commented Jan 5, 2021

When I click Ok, the little window closes, and then Electrum freezes.
I have to force quit.
Retried multiple times.

Version: 4.0.9
OS: Mac OS Big Sur

Screenshot 2021-01-05 at 22 59 50

@Transisto
Copy link

That's odd, been increasing fees often. Do you see something useful in the logs?
image

@olso
Copy link
Author

olso commented Jan 5, 2021

@Transisto

I/n | network | couldn't launch iface wsw6tua3xl24gsmi264zaep6seppjyrkyucpsmuxnjzyt3f3j6swshad.onion:50002:s -- CancelledError()
I/i | interface.[electrum.jochen-hoenicke.de:50005] | disconnecting due to: ErrorGettingSSLCertFromServer(ConnectError(ConnectionRefusedError(61, "Connect call failed ('88.198.39.205', 50005)")))
I/n | network | couldn't launch iface electrum.jochen-hoenicke.de:50005:s -- CancelledError()
I/i | interface.[electrum5.hodlister.co:50002] | connection established. version: ['ElectrumX 1.10.0', '1.4']
I/i | interface.[electrum5.hodlister.co:50002] | set blockchain with height 664688
I/i | interface.[electrum5.hodlister.co:50002] | skipping header 664688
I/n | network | fee_estimates {25: 83348, 10: 86895, 5: 86967, 2: 86967}
I/n | network | couldn't launch iface yuio.top:50002:s -- TimeoutError()
I/n | network | couldn't launch iface xray587.startdedicated.de:50002:s -- TimeoutError()
I/n | network | fee_histogram [[110, 103355], [102, 111125], [98, 132425], [91, 134123], [89, 135569], [87, 199042], [84, 263889], [83, 132942], [81, 226997], [79, 736240], [78, 2554146], [77, 104655], [76, 127856], [75, 119578], [74, 36182], [73, 85277], [72, 157738], [71, 71542], [70, 38580], [63, 275981], [55, 981007], [53, 524142], [44, 1076415], [39, 1073521], [34, 996136], [29, 538635], [20, 2138749], [18, 436192], [10, 1987641], [6, 2099301], [5, 1461791], [3, 2551187], [2, 1985637], [1, 13354617]]
I/n | network | fee_estimates {25: 83348, 10: 86895, 5: 86967, 2: 86967}
I/n | network | fee_estimates {25: 83348, 10: 86895, 5: 86967, 2: 86967}
I/n | network | fee_estimates {25: 83348, 10: 86895, 5: 86967, 2: 86967}
I/n | network | fee_estimates {25: 83348, 10: 86895, 5: 86967, 2: 86967}
I/n | network | fee_estimates {25: 83348, 10: 86895, 5: 86967, 2: 86967}
I/n | network | fee_estimates {25: 83348, 10: 86895, 5: 86967, 2: 86967}
I/n | network | fee_estimates {25: 83348, 10: 86895, 5: 86967, 2: 86967}
I/i | interface.[fedaykin.goip.de:50002] | disconnecting due to: ErrorGettingSSLCertFromServer(ConnectError(TimeoutError(60, "Connect call failed ('37.209.12.197', 50002)")))
I/n | network | couldn't launch iface electrum-server.ninja:50002:s -- TimeoutError()

@olso
Copy link
Author

olso commented Jan 5, 2021

I'm watching the logs, the UI is frozen, but it keeps trying to establish connection but always fails on the SSLCert error, it seems from every server

I've tried #6686 (comment) didnt help

@SomberNight
Copy link
Member

The network/interface stuff looks unrelated, ignore that.

@olso
Copy link
Author

olso commented Jan 5, 2021

There is no output to log when I click ok, weird.
I just keep seeing bunch of repeating

I/n | network | fee_estimates {25: 83348, 10: 86895, 5: 86967, 2: 86967}
I/n | network | fee_estimates {25: 83348, 10: 86895, 5: 86967, 2: 86967}
I/n | network | fee_estimates {25: 83348, 10: 86895, 5: 86967, 2: 86967}
I/n | network | fee_estimates {25: 83348, 10: 86895, 5: 86967, 2: 86967}
I/n | network | fee_estimates {25: 83348, 10: 86895, 5: 86967, 2: 86967}
I/n | network | fee_estimates {25: 83348, 10: 86895, 5: 86967, 2: 86967}
I/n | network | fee_estimates {25: 83348, 10: 86895, 5: 86967, 2: 86967}

and iface errors, nothing else

@SomberNight
Copy link
Member

Get the txid of the tx you want to replace, and go into the Console tab.

Run this:

wallet.bump_fee(tx=wallet.db.get_transaction("insert txid here"), new_fee_rate=87, coins=window.get_coins())

Does it hang?

@olso
Copy link
Author

olso commented Jan 5, 2021

@SomberNight that doesn't hang, but I also didnt notice any change after running this

is there some "broadcast" command that should be run after this?

@olso
Copy link
Author

olso commented Jan 5, 2021

Screenshot 2021-01-06 at 00 15 08

freezes after calling show_transaction

@olso
Copy link
Author

olso commented Jan 5, 2021

Screenshot 2021-01-06 at 00 28 16

also freezes after clicking on

im going to sleep now, i can continue debugging tmrow 😅

@SomberNight
Copy link
Member

Run this: [...]

that doesn't hang, but I also didnt notice any change after running this
is there some "broadcast" command that should be run after this?

Thanks. I was just curious if it is that command that hanged.

freezes after calling show_transaction

Good find!

also freezes after clicking on [View Transaction]

Does it freeze for this tx only, or for any tx in your History?

Also, any idea how many inputs the transaction has?
How much time did you try waiting when it freezes?

@olso
Copy link
Author

olso commented Jan 6, 2021

@SomberNight

Happens only for this tx

The tx is now confirmed, so I can't test the increase fee anymore

4 inputs

The freeze happens instantly from human perception

@ecdsa
Copy link
Member

ecdsa commented Jan 6, 2021

please post the tx id, so we can see how many inputs it has

@ecdsa
Copy link
Member

ecdsa commented Jan 6, 2021

does your wallet contain a large number of inputs? how many items are there in the coins tab?

@SomberNight
Copy link
Member

How much time did you try waiting when it freezes?

The freeze happens instantly from human perception

show_transaction might fetch the prev txs from the network, for a partial tx, if they are not available in the wallet.
This network operation would then run on the GUI thread and block it, with a 10 sec timeout (per input).
So in your case if there is a network issue you might have needed to wait 40 seconds.
(I've now made a small change to give user feedback about this in 85f7652)

However, thinking about it more, this could not have been the culprit in your case, as when simply clicking View Transaction in the History tab, this would not happen. (as at that time the tx is not partial)

@olso
Copy link
Author

olso commented Jan 6, 2021

@ecdsa coins is empty

@SomberNight it still freezes even now after the tx is confirmed

@SomberNight
Copy link
Member

it still freezes even now after the tx is confirmed

Oh so you can still reproduce! :)

Could you please run this in the Console tab, and then reproduce, and check the logs?
(single line)
from electrum.gui.qt.transaction_dialog import TxDialog, BaseTxDialog; from electrum.util import profiler; TxDialog.set_tx = profiler(TxDialog.set_tx); TxDialog.update = profiler(TxDialog.update); TxDialog.__init__ = profiler(TxDialog.__init__); BaseTxDialog.__init__ = profiler(BaseTxDialog.__init__); BaseTxDialog.add_tx_stats = profiler(BaseTxDialog.add_tx_stats)

This is what I see in my log after:

D | util.profiler | BaseTxDialog.add_tx_stats 0.0058
D | util.profiler | BaseTxDialog.__init__ 0.0088
D | util.profiler | BaseTxDialog.set_tx 0.0777
D | util.profiler | BaseTxDialog.update 0.0097
D | util.profiler | TxDialog.__init__ 0.0966

Alternatively, you could run from source and add print/logging statements everywhere :)

@olso
Copy link
Author

olso commented Jan 6, 2021

@SomberNight

D | util.profiler | BaseTxDialog.add_tx_stats 0.0261
D | util.profiler | BaseTxDialog.__init__ 0.0322
D | util.profiler | BaseTxDialog.set_tx 0.0002
D | util.profiler | BaseTxDialog.update 0.0039
D | util.profiler | TxDialog.__init__ 0.0370

@SomberNight
Copy link
Member

Hmmm, so the TxDialog constructor finishes...

Can you try running this then?
(restart the program before, to lose the side-effects of the previous command)
from electrum.gui.qt.transaction_dialog import TxDialog; from electrum.util import profiler; TxDialog.__init__ = profiler(TxDialog.__init__); TxDialog.show = profiler(TxDialog.show); window.show_transaction = profiler(window.show_transaction)

I get:

D | util.profiler | TxDialog.__init__ 0.0913
D | util.profiler | show 0.0198
D | util.profiler | ElectrumWindow.show_transaction 0.1111

@olso
Copy link
Author

olso commented Jan 6, 2021

@SomberNight

D | util.profiler | TxDialog.__init__ 0.0289
D | util.profiler | show 0.0162
D | util.profiler | ElectrumWindow.show_transaction 0.0457

@SomberNight
Copy link
Member

That too seems normal then.
So, just to clarify, in the History tab, you right-click on this specific tx, click View Transaction, these logs appear but the application hangs/freezes?
And if you right-click>View Transaction on a different tx instead, then the transaction dialog appears and there is no freeze?

@olso
Copy link
Author

olso commented Jan 6, 2021

@SomberNight exactly

@SomberNight
Copy link
Member

SomberNight commented Jan 6, 2021

Try menubar>Tools>Load transaction>From text.
paste text:

0200000004690db18266b603ffc58be703231cc7d22212905d091b0d9570bcef18457b8126010000006a473044022027cb7941c8f02943f30bb01ab9b0f0d063df905c49b0765c10573b0a7af0b8ec02202bdb63303b8fc3c4a113ad33b87fc4907114c93a130510808e34e91767fea511012103c3e4a7b0de10225c3dd16d9148ec9675c8b970e6c669c13583e20e61dfdd84a0fdffffff7e607b2fc69e2bece143e2a813916bc580d6f227240b36f2dd585d5fbb201879000000006a473044022018b3db095980160a28f2da295624c54aa47e71db086124d7c4197c5c44153d71022074dd56029fb152f646c60b880234c580edb504349207c7783a59fb97bbe3f34b012103291ae8a62db4c58a112d1ce28df04162be610618073be307ca922448c1163a20fdffffff8da8b3ede16d07191a7076d14dff2f089e87f4c0818dd3f0c47489992e60eb88010000006a473044022007335fbe325d0c582d3a05f66f2d8f07f71df99cef7fe1b5ca4deb0d8b4482a30220033571460656cb5e0398d789c5b9fb584a4bb2b46c370f7d0667e9f40b848e8d01210291d9d472dbb5b6a87d7ac8a739600a522abcfe308a02a858f8038a6935d68074fdffffff3d9fc09880658f08fe38e222eaa079443b3df96bfe288a95998ea6f48d1ba8df000000006a473044022065986a86ab71fdbcfe0893728c6c2c6c49ad562374ecdab4d1903049f73aa1ef02206d016931d4091bc2c34ebe07d8cd792c064aadb68aae9dfb4fa3db805f6f73f4012103a3a231ad23ee891d47136fc339f116790636e05615addf35d3863d8b68358c61fdffffff014a8ff600000000001976a914240a6ba5274a564cbbb88fca3f10f1b89fc3d4a588ac63240a00

Then click Load transaction.


If that reproduces the freeze, as a second test, please try the same, with a different wallet.
That is, create a new wallet file using Electrum, e.g. a throw-away seed, and use the menubar of that window to the load the transaction.

@olso
Copy link
Author

olso commented Jan 6, 2021

@SomberNight

  1. reproduced freeze in the original wallet
  2. doesnt freeze the new wallet

@SomberNight
Copy link
Member

Really weird... some further ideas to maybe narrow it down:

(1) try running Electrum with the --offline flag
e.g. $ ~/Downloads/Electrum.app/Contents/MacOS/run_electrum --offline

(2) try creating a new wallet file but this time from the same seed.
(to avoid confusion, let us call the original wallet file "wallet A", the unrelated throwaway wallet you created above "wallet B", and this new wallet file that has the same seed as wallet A to be "wallet C")

(3) try creating a new wallet file, "wallet D", using the xpub of the original (wallet A)
You can find the xpub at menubar>Wallet>Information, see Master Public Key

Thank you for taking the time to help debug this.

@olso
Copy link
Author

olso commented Jan 7, 2021

@SomberNight im having trouble with (3) when i tried to create wallet with xpub via "import", it doesn't let me click next

@SomberNight
Copy link
Member

in wizard, select Standard wallet>Use a master key

@SomberNight
Copy link
Member

What version of macOS are you using?
Is this with the official .dmg binary from the website? (as opposed to running from source or building your own binary)

@SeanGriffithz
Copy link

May sound silly and I have no idea how or even IF this would work, but this is what happened to me.

I was having the same problem as you, I was searching looking for answers, but I am not technically minded.

How I got around this was just by changing the theme of Electrum from Light to Dark.

After I did that, I haven't had any crashes since, and I've been able to increase my fee so that the transaction goes through.

I am open to ideas as to why this is because I would like to know this myself, or could it just be a coincidence.

@SomberNight
Copy link
Member

How I got around this was just by changing the theme of Electrum from Light to Dark.
I am open to ideas as to why this is because I would like to know this myself, or could it just be a coincidence.

That suggests this is a GUI bug. It is also platform-dependent, as there are now potentially three reports all from macOS.

What version of macOS are you using?

@SeanGriffithz
Copy link

What version of macOS are you using?

I am running macOS Big Sur Version 11.1

@SomberNight SomberNight changed the title [BUG] Freeze when trying to increase fee [BUG] Freeze when trying to increase fee (or "View transaction") Jan 30, 2021
@SomberNight
Copy link
Member

SomberNight commented Jan 30, 2021

Ok I can reproduce.

I have two VMs, one running macOS 10.15.3, the other macOS 11.0.1.
I can reproduce the freeze only on the latter, on macOS 11.
However, only when using the binary (Electrum 4.0.9), not when running from source.

As usual, the bug is caused by a macOS update...

workaround

Further, I too confirm that changing the in-app theme to "Dark" is a workaround for the issue;
the freeze only happens with the "Light" theme.

@SomberNight
Copy link
Member

As per discussion with @rdymac on IRC, the freeze happening looks to be highly correlated to there being enough tx inputs/outputs in the tx so that the vertical scrollbar needs to appear in the Transaction Dialog.

re what @olso said

  1. reproduced freeze in the original wallet
  2. doesnt freeze the new wallet

This is probably because the original wallet had a label for the tx while the new wallet did not. If there is a label then it is shown in the tx dialog, and consequently there is less vertical space for inputs/outputs.

@SomberNight
Copy link
Member

I cannot reproduce the issue using newer PyQt it seems.
Specifically, Electrum 4.0.9 packages PyQt 5.13.1, and I can repro the freeze if I build a binary myself from the 4.0.9 tag;
however if I build a binary from the 4.0.9 tag but with PyQt 5.15.2, there is no longer a freeze.

Electrum 4.0.9 intentionally packages an older version of qt, PyQt 5.13.1, as a workaround for another issue on macOS 11 ("app does not start")...
Since then however PyQt 5.15.2 has been released which fixes the "app does not start" issue, and seemingly also this "freeze" issue.

git master already packages PyQt 5.15.2 for macOS since 9e86bb1, so I am closing this issue.

@jaffacakerhubarb
Copy link

I have been having this issue on an accidentally low-fee transaction for a few days — Electrum 4.0.9, Big Sur 11.2.1.

As with the original report, Electrum locks up only when trying to 'view transaction' or fee bump, requiring a force quit, otherwise it works completely fine. I found this issue when searching for a solution, and enabling dark mode fixes it also. If I'm reading this correctly, workaround aside, this issue will go away with the next Electrum update? If so, cool. Just thought I'd throw my report into the ring.

@SomberNight SomberNight changed the title [BUG] Freeze when trying to increase fee (or "View transaction") [BUG] Freeze when trying to increase fee (or "View transaction", transaction dialog, tx preview) Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants