LearnBitcoin

Bitcoin Dev Archive 2013

Coin Control, Send crash on MacOS X

3 messages, 1 to 4 Dec 2013. Started by Warren Togami.

Warren Togami (2), Wladimir J. van der Laan

Permalink Original thread on gnusha.org

Warren Togami permalink original

https://github.com/litecoin-project/bitcoinomg/commits/0.8.5-OMG6 http://download1.rpmfusion.org/~warren/bitcoin-0.8.5-OMG6/ I've been backporting patches from master and Litecoin to make a Bitcoin 0.8 client with more features. It works quite well on Linux and Win32.

http://pastebin.com/g8QqheGc Today we discovered a rare crash that can happen on MacOS X. toffoo and coblee reproduced it on MacOS X 10.9 and I reproduced it on 10.6.8. It seems to be some kind of race condition involving SendCoinsEntry::clear().

   1. 11  QtGui                               0x00e28141
   QWidget::setFocus(Qt::FocusReason) + 289
   2. 12  org.bitcoinfoundation.Bitcoin-Qt    0x002ca665
   SendCoinsEntry::clear() + 101

This build was made with Xcode 3.2.6 on MacOS X with MacPorts qt4-mac qt-4.8.4, roughly meant to approximate Gavin's build environment for the 0.8.x releases.

With this unfamiliar build environment I have been unsuccessful at building master so I am unable to confirm if this crash exists there. I am trying qt-4.8.5 next ... but even if I manage to build it, it is exceedingly difficult to reproduce...

Warren

Warren Togami in reply to Warren Togami permalink original

On Sun, Dec 1, 2013 at 1:19 AM, Wladimir <laanwj@gmail•com> wrote:

Quoted text (31 lines)
> On Sun, Dec 1, 2013 at 12:05 PM, Warren Togami Jr. <wtogami@gmail•com>wrote:
>
>> https://github.com/litecoin-project/bitcoinomg/commits/0.8.5-OMG6
>> http://download1.rpmfusion.org/~warren/bitcoin-0.8.5-OMG6/
>> I've been backporting patches from master and Litecoin to make a Bitcoin
>> 0.8 client with more features.  It works quite well on Linux and Win32.
>>
>> http://pastebin.com/g8QqheGc
>> Today we discovered a rare crash that can happen on MacOS X. toffoo and
>> coblee reproduced it on MacOS X 10.9 and I reproduced it on 10.6.8. It
>> seems to be some kind of race condition involving SendCoinsEntry::clear().
>>
>>
>>    1. 11  QtGui                               0x00e28141
>>    QWidget::setFocus(Qt::FocusReason) + 289
>>    2. 12  org.bitcoinfoundation.Bitcoin-Qt    0x002ca665
>>    SendCoinsEntry::clear() + 101
>>
>>
> I don't think the setFocus should be in clear() in the first place. It
> conflates clearing the widgets and changing the focus.
>
> If the automatic focus change is desirable at all it could be moved to a
> seperate function "focusPayTo".
>
> In any case it's just a nicety and should just be removed if it causes
> problems.
>
> Wladimir
>
>

Did as you suggested, removed both setFocus() calls that happen after Send is clicked

http://pastebin.com/j4adDpsM Now it crashes in something else within qt.

I'm trying other things...

Warren

Wladimir J. van der Laan in reply to Warren Togami permalink original
Quoted text (10 lines)
>
> Did as you suggested, removed both setFocus() calls that happen after Send
>> is clicked
>>
>
> http://pastebin.com/j4adDpsM
> Now it crashes in something else within qt.
>
> I'm trying other things...
>

As I've said to you on IRC before, I think the problem is with this loop:

https://github.com/bitcoin/bitcoin/blob/master/src/qt/sendcoinsdialog.cpp#L261

This deletes widgets, but Qt may still be referring to them internally, and "Deleting a QObject while pending events are waiting to be delivered can cause a crash."

Can you try replacing with ->deleteLater()?

Wladimir