Bug#841951: bitcoin-qt segfaults on startup

2016-10-29 Thread Erik de Castro Lopo
Anthony Towns wrote:

> Okay, that makes it a Qt/GL bug afaics then. Might be worth trying the
> attached. I get:
> 
>  $ g++ -o test test.cpp -lX11 -lGL -Wall -W
>  $ ./test
>  config 0 alphaSize 0
>  config 1 alphaSize 0
>  config 2 alphaSize 0
> ...
>  config 36 alphaSize 0
>  config 37 alphaSize 0
>  config 38 alphaSize 8
>  config 39 alphaSize 8
> 
> I'm guessing you'll get some visual==NULL!! warnings


Indeed. I get single `visual==NULL` at:


config 0 alphaSize 0
config 1 alphaSize 0
config 2 alphaSize 0
config 3 alphaSize 0
config 4 alphaSize 0
config 5 alphaSize 0
config 6 alphaSize 0
config 7 alphaSize 0
config 8 alphaSize 0
config 9 alphaSize 0
config 10 alphaSize 0
config 11 alphaSize 0
config 12 alphaSize 0
config 13 alphaSize 0
config 14 alphaSize 0
config 15 alphaSize 0
config 16 alphaSize 0
config 17 alphaSize 0
config 18 alphaSize 8
config 19 alphaSize 8
config 20 alphaSize 8
config 21 alphaSize 8
config 22 alphaSize 8
config 23 alphaSize 8
config 24 alphaSize 8
config 25 alphaSize 8
config 25 visual==NULL!!
config 26 alphaSize 8
config 27 alphaSize 8
config 28 alphaSize 8
config 29 alphaSize 8
config 30 alphaSize 8
config 31 alphaSize 8
config 32 alphaSize 8
config 33 alphaSize 8
config 34 alphaSize 8
config 35 alphaSize 8
config 36 alphaSize 0
config 37 alphaSize 0
config 38 alphaSize 8
config 39 alphaSize 8

every time I run the program.

> as well at which
> point you might be able to work out what's going on?

Well I suspect that must be the one config that bitcoin-qt is
trying to use. Should this debian bug be moved to another package?
If so, which one?

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/



Bug#841951: bitcoin-qt segfaults on startup

2016-10-26 Thread Anthony Towns
On Wed, Oct 26, 2016 at 07:04:35PM +1100, Erik de Castro Lopo wrote:
> Anthony Towns wrote:
> > Maybe
> >  /usr/lib/x86_64-linux-gnu/qt5/examples/widgets/desktop/systray/systray
> > might reproduce the crash?
> Indeed it does! Gdb backtrace follows.

Okay, that makes it a Qt/GL bug afaics then. Might be worth trying the
attached. I get:

 $ g++ -o test test.cpp -lX11 -lGL -Wall -W
 $ ./test
 config 0 alphaSize 0
 config 1 alphaSize 0
 config 2 alphaSize 0
...
 config 36 alphaSize 0
 config 37 alphaSize 0
 config 38 alphaSize 8
 config 39 alphaSize 8

I'm guessing you'll get some visual==NULL!! warnings as well at which
point you might be able to work out what's going on?

Cheers,
aj

#include 
#include 
#include 
#include 
#include 
#include 

int main(void) {
Display *display = XOpenDisplay(NULL);
int screen = DefaultScreen( display );

// should be:
//   int drawableBit = 1;
//   QSurfaceFormat format = window()->requestedFormat();
//   QVector spec = qglx_buildSpec(format, drawableBit);
//   visual_attribs = spec.constData()
// but we'll try allowing anything... :-/
static int visual_attribs[] = { None };

int confcount = 0;
GLXFBConfig *configs;
configs = glXChooseFBConfig(display, screen, visual_attribs, );

if (configs == NULL) {
printf("configs was null, confcount is %d\n", confcount);
return 0;
}

for (int i = 0; i < confcount; i++) {
int alphaSize;
glXGetFBConfigAttrib(display,configs[i],GLX_ALPHA_SIZE,);
printf("config %d alphaSize %d\n", i, alphaSize);
XVisualInfo *visual = glXGetVisualFromFBConfig(display, configs[i]);
if (visual == NULL) {
printf("config %d visual==NULL!!\n", i);
}
}
return 0;
}


Bug#841951: bitcoin-qt segfaults on startup

2016-10-26 Thread Erik de Castro Lopo
Anthony Towns wrote:

> Maybe
> 
>  /usr/lib/x86_64-linux-gnu/qt5/examples/widgets/desktop/systray/systray
> 
> might reproduce the crash?

Indeed it does! Gdb backtrace follows.

Erik

> gdb --args 
> /usr/lib/x86_64-linux-gnu/qt5/examples/widgets/desktop/systray/systray
GNU gdb (Debian 7.11.1-2) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from 
/usr/lib/x86_64-linux-gnu/qt5/examples/widgets/desktop/systray/systray...(no 
debugging symbols found)...done.
(gdb) r
Starting program: 
/usr/lib/x86_64-linux-gnu/qt5/examples/widgets/desktop/systray/systray 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffec111700 (LWP 16297)]
[New Thread 0x7fffe1129700 (LWP 16298)]
[New Thread 0x7fffdbb8f700 (LWP 16299)]
[New Thread 0x7fffdb38e700 (LWP 16300)]

Thread 1 "systray" received signal SIGSEGV, Segmentation fault.
qglx_findConfig (display=display@entry=0x43fde0, screen=screen@entry=0, 
format=..., drawableBit=drawableBit@entry=1)
at glxconvenience/qglxconvenience.cpp:157
157 glxconvenience/qglxconvenience.cpp: No such file or directory.
(gdb) bt
#0  qglx_findConfig (display=display@entry=0x43fde0, screen=screen@entry=0, 
format=..., drawableBit=drawableBit@entry=1)
at glxconvenience/qglxconvenience.cpp:157
#1  0x77fec29d in qglx_findVisualInfo (display=0x43fde0, screen=0, 
format=0x6c87f8)
at glxconvenience/qglxconvenience.cpp:192
#2  0x77efb3bd in QXcbWindow::create (this=0x6c87a0) at 
qxcbwindow.cpp:416
#3  0x77ee67b1 in QXcbIntegration::createPlatformWindow 
(this=, window=0x6c6af0)
at qxcbintegration.cpp:203
#4  0x772cf2fc in QWindowPrivate::create (this=0x6c6b50, 
recursive=recursive@entry=false)
at kernel/qwindow.cpp:395
#5  0x772cf6ab in QWindow::create (this=this@entry=0x6c6af0) at 
kernel/qwindow.cpp:555
#6  0x778e84e4 in QWidgetPrivate::create_sys (this=this@entry=0x6c6840, 
window=window@entry=0, 
initializeWindow=initializeWindow@entry=true, 
destroyOldWindow=destroyOldWindow@entry=true)
at kernel/qwidget.cpp:1467
#7  0x778e7b9d in QWidget::create (this=0x6c67e0, 
window=window@entry=0, 
initializeWindow=initializeWindow@entry=true, 
destroyOldWindow=destroyOldWindow@entry=true)
at kernel/qwidget.cpp:1331
#8  0x778e7fce in QWidgetPrivate::createWinId (this=) at 
kernel/qwidget.cpp:2556
#9  0x778e8859 in QWidget::createWinId (this=this@entry=0x6c67e0) at 
kernel/qwidget.cpp:2575
#10 0x77c40f02 in QSystemTrayIconSys::addToTray (this=0x6c67e0) at 
util/qsystemtrayicon_x11.cpp:139
#11 0x77c4116c in QSystemTrayIconSys::QSystemTrayIconSys 
(this=0x6c67e0, qIn=)
at util/qsystemtrayicon_x11.cpp:131
#12 0x77c41322 in QSystemTrayIconPrivate::install_sys 
(this=this@entry=0x6c5dd0)
at util/qsystemtrayicon_x11.cpp:270
#13 0x77c22477 in QSystemTrayIcon::setVisible (this=, 
visible=)
at util/qsystemtrayicon.cpp:271
#14 0x00406660 in ?? ()
#15 0x004046e3 in ?? ()
#16 0x765ee2b1 in __libc_start_main (main=0x404680, argc=1, 
argv=0x7fffe438, init=, 
fini=, rtld_fini=, stack_end=0x7fffe428) 
at ../csu/libc-start.c:291
#17 0x00404819 in ?? ()

-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/



Bug#841951: bitcoin-qt segfaults on startup

2016-10-26 Thread Anthony Towns
On Tue, Oct 25, 2016 at 07:16:45PM +1100, Erik de Castro Lopo wrote:
> Thread 1 "bitcoin-qt" received signal SIGSEGV, Segmentation fault.
> qglx_findConfig (display=display@entry=0x56151080, screen=screen@entry=0, 
> format=..., 
> drawableBit=drawableBit@entry=1) at glxconvenience/qglxconvenience.cpp:157
> 157   glxconvenience/qglxconvenience.cpp: No such file or directory.
> (gdb) bt
> #0  qglx_findConfig (display=display@entry=0x56151080, 
> screen=screen@entry=0, format=..., 
> drawableBit=drawableBit@entry=1) at glxconvenience/qglxconvenience.cpp:157

That line is apparently:

   XRenderPictFormat *pictFormat = XRenderFindVisualFormat(display, 
visual->visual);

which presumably means "visual" is NULL. "visual" is:

   XVisualInfo *visual = glXGetVisualFromFBConfig(display, chosenConfig);

which "Returns NULL if config is not a valid GLXFBConfig." but
chosenConfig is "configs[i]" which is returned from glXChooseFBConfig,
so as far as I can see the only way it can plausibly be invalid is if
your OpenGL stuff is broken for some reason? Qt could actually check for
a NULL return and do "chosenConfig=NULL; continue;" though I guess.

> #13 0x76ef1477 in QSystemTrayIcon::setVisible (this=, 
> visible=)
> at util/qsystemtrayicon.cpp:271

Maybe

 /usr/lib/x86_64-linux-gnu/qt5/examples/widgets/desktop/systray/systray

might reproduce the crash?

Cheers,
aj



Bug#841951: bitcoin-qt segfaults on startup

2016-10-25 Thread Erik de Castro Lopo
Anthony Towns wrote:

> > Starting program: /home/erikd/Local/bin/bitcoin-qt
> 
> That's an odd location for the packaged binary?

Yeah, gdb-ed the wrong binary. The correct binary does the same.

> bitcoin-qt's working fine for me with the same versions of the libraries
> as you have, so I'll downgrade this report.
> 
> Some things you might like to try if you haven't already:
> 
>  - try running
> /usr/lib/x86_64-linux-gnu/qt5/examples/gui/analogclock/analogclock
>from qtbase5-examples to see if simple qt programs fail?

That works fine.

>  - running "bitcoin-qt -regtest" to eliminate downloading the blockchain
>and contacting peers while debugging

That segfaults. Very similar to before.

>  - installing bitcoind, and trying it in headless mode to avoid qt and
>graphics related bugs

That fine also, suggesting its either qt or graphics driver related (also
as suggested by the backtrace).

>  - use "ssh -X" to get into your new desktop from somewhere else, and
>run bitcoin-qt from there, to perhaps eliminate any problems related
>to graphics drivers?

Crashed X displaying to another machine as well.

> > There doesn't seem to be any debug symbols available for libqt5gui5 so
> > I was not able to debug this futher.
> 
> Have you tried installing the qtbase5-dbg and related packages? That
> seems to give me useful debug info.

Ok, now I have debug symbols. BT follows.

Erik


> gdb --args /usr/bin/bitcoin-qt -regtest
GNU gdb (Debian 7.11.1-2) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/bitcoin-qt...(no debugging symbols found)...done.
(gdb) r
Starting program: /usr/bin/bitcoin-qt -regtest
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe9215700 (LWP 14921)]
[New Thread 0x7fffdc84d700 (LWP 14935)]
[New Thread 0x7fffd7fff700 (LWP 14936)]
[New Thread 0x7fffd77fe700 (LWP 14943)]
[New Thread 0x7fffd6bdd700 (LWP 14944)]
[New Thread 0x7fffd63dc700 (LWP 14945)]
[New Thread 0x7fffd57bd700 (LWP 14946)]
[New Thread 0x7fffd4fbc700 (LWP 14947)]
[New Thread 0x7fffb700 (LWP 14958)]
[Thread 0x7fffb700 (LWP 14958) exited]
[New Thread 0x7fffbf7fe700 (LWP 14959)]
[New Thread 0x7fffbeffd700 (LWP 14960)]
[New Thread 0x7fffbe7fc700 (LWP 14961)]
[Thread 0x7fffbeffd700 (LWP 14960) exited]
[New Thread 0x7fffbdffb700 (LWP 14962)]
[New Thread 0x7fffbd7fa700 (LWP 14963)]
[New Thread 0x7fffbcff9700 (LWP 14964)]
[New Thread 0x7fffa3fff700 (LWP 14965)]

Thread 1 "bitcoin-qt" received signal SIGSEGV, Segmentation fault.
qglx_findConfig (display=display@entry=0x56151080, screen=screen@entry=0, 
format=..., 
drawableBit=drawableBit@entry=1) at glxconvenience/qglxconvenience.cpp:157
157 glxconvenience/qglxconvenience.cpp: No such file or directory.
(gdb) bt
#0  qglx_findConfig (display=display@entry=0x56151080, 
screen=screen@entry=0, format=..., 
drawableBit=drawableBit@entry=1) at glxconvenience/qglxconvenience.cpp:157
#1  0x77fe529d in qglx_findVisualInfo (display=0x56151080, 
screen=0, format=0x57016b68)
at glxconvenience/qglxconvenience.cpp:192
#2  0x7fffeb1693bd in QXcbWindow::create (this=0x57016b10) at 
qxcbwindow.cpp:416
#3  0x7fffeb1547b1 in QXcbIntegration::createPlatformWindow 
(this=, window=0x5701c0d0)
at qxcbintegration.cpp:203
#4  0x7659e2fc in QWindowPrivate::create (this=0x56f44360, 
recursive=recursive@entry=false)
at kernel/qwindow.cpp:395
#5  0x7659e6ab in QWindow::create (this=this@entry=0x5701c0d0) at 
kernel/qwindow.cpp:555
#6  0x76bb74e4 in QWidgetPrivate::create_sys 
(this=this@entry=0x57014ea0, window=window@entry=0, 
initializeWindow=initializeWindow@entry=true, 
destroyOldWindow=destroyOldWindow@entry=true)
at kernel/qwidget.cpp:1467
#7  0x76bb6b9d in QWidget::create (this=0x56c23970, 
window=window@entry=0, 
initializeWindow=initializeWindow@entry=true, 
destroyOldWindow=destroyOldWindow@entry=true)
at kernel/qwidget.cpp:1331
#8  0x76bb6fce in QWidgetPrivate::createWinId (this=) at 
kernel/qwidget.cpp:2556
#9  0x76bb7859 in QWidget::createWinId (this=this@entry=0x56c23970) 
at kernel/qwidget.cpp:2575
#10 0x76f0ff02 in QSystemTrayIconSys::addToTray 

Bug#841951: bitcoin-qt segfaults on startup

2016-10-24 Thread Anthony Towns
> Just got a new machine, installed bitcoin-qt, ran it and got an
> immediate segfault. Re-running get the same result.
>
> Backtrace from GDB:
>
> (gdb) r
> Starting program: /home/erikd/Local/bin/bitcoin-qt

That's an odd location for the packaged binary?

> [Thread debugging using libthread_db enabled]
> Using host libthread_db library
> "/lib/x86_64-linux-gnu/libthread_db.so.1".
> [New Thread 0x7fffe9967700 (LWP 21490)]
> [New Thread 0x7fffdcfa1700 (LWP 21491)]
> [New Thread 0x7fffd7fff700 (LWP 21492)]
> 
> Thread 1 "bitcoin-qt" received signal SIGSEGV, Segmentation fault.

bitcoin-qt's working fine for me with the same versions of the libraries
as you have, so I'll downgrade this report.

Some things you might like to try if you haven't already:

 - try running
/usr/lib/x86_64-linux-gnu/qt5/examples/gui/analogclock/analogclock
   from qtbase5-examples to see if simple qt programs fail?
 - running "bitcoin-qt -regtest" to eliminate downloading the blockchain
   and contacting peers while debugging
 - installing bitcoind, and trying it in headless mode to avoid qt and
   graphics related bugs
 - use "ssh -X" to get into your new desktop from somewhere else, and
   run bitcoin-qt from there, to perhaps eliminate any problems related
   to graphics drivers?

> There doesn't seem to be any debug symbols available for libqt5gui5 so
> I was not able to debug this futher.

Have you tried installing the qtbase5-dbg and related packages? That
seems to give me useful debug info.

Cheers,
aj



Bug#841951: bitcoin-qt segfaults on startup

2016-10-24 Thread Erik de Castro Lopo
Package: bitcoin-qt
Version: 0.13.0-0.1
Severity: important

Dear Maintainer,

Just got a new machine, installed bitcoin-qt, ran it and got an immediate
segfault. Re-running get the same result.

Backtrace from GDB:

(gdb) r
Starting program: /home/erikd/Local/bin/bitcoin-qt 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe9967700 (LWP 21490)]
[New Thread 0x7fffdcfa1700 (LWP 21491)]
[New Thread 0x7fffd7fff700 (LWP 21492)]

Thread 1 "bitcoin-qt" received signal SIGSEGV, Segmentation fault.
0x77fe50e2 in ?? () from 
/usr/lib/x86_64-linux-gnu/qt5/plugins/xcbglintegrations/libqxcb-glx-integration.so
(gdb) bt
#0  0x77fe50e2 in ?? () from 
/usr/lib/x86_64-linux-gnu/qt5/plugins/xcbglintegrations/libqxcb-glx-integration.so
#1  0x77fe529d in ?? () from 
/usr/lib/x86_64-linux-gnu/qt5/plugins/xcbglintegrations/libqxcb-glx-integration.so
#2  0x7fffeb8bb3bd in QXcbWindow::create() () from 
/usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#3  0x7fffeb8a67b1 in QXcbIntegration::createPlatformWindow(QWindow*) const 
()
   from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#4  0x768042fc in QWindowPrivate::create(bool) () from 
/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#5  0x76e1d4e4 in QWidgetPrivate::create_sys(unsigned long long, bool, 
bool) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#6  0x76e1cb9d in QWidget::create(unsigned long long, bool, bool) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#7  0x77175f02 in ?? () from 
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#8  0x7717616c in ?? () from 
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#9  0x77176322 in ?? () from 
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#10 0x77157477 in QSystemTrayIcon::setVisible(bool) () from 
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#11 0x555d62d4 in QSystemTrayIcon::show (this=)
at /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qsystemtrayicon.h:95
#12 BitcoinGUI::createTrayIcon (this=this@entry=0x56454510, 
networkStyle=networkStyle@entry=0x56310c90)
at qt/bitcoingui.cpp:534
#13 0x555d844a in BitcoinGUI::BitcoinGUI (this=0x56454510, 
platformStyle=0x562f1180, 
networkStyle=0x56310c90, parent=) at 
qt/bitcoingui.cpp:177
#14 0x555c50de in BitcoinApplication::createWindow 
(this=0x7fffe020, networkStyle=0x56310c90)
at qt/bitcoin.cpp:358
#15 0x555baafa in main (argc=, argv=0x7fffe498) at 
qt/bitcoin.cpp:662


There doesn't seem to be any debug symbols available for libqt5gui5 so
I was not able to debug this futher.

Cheers,
Erik

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (900, 'testing'), (800, 'unstable'), (500, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: arm64, armhf, i386

Kernel: Linux 4.7.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_AU.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages bitcoin-qt depends on:
ii  libboost-chrono1.61.0   1.61.0+dfsg-3
ii  libboost-filesystem1.61.0   1.61.0+dfsg-3
ii  libboost-program-options1.61.0  1.61.0+dfsg-3
ii  libboost-system1.61.0   1.61.0+dfsg-3
ii  libboost-thread1.61.0   1.61.0+dfsg-3
ii  libc6   2.24-3
ii  libdb5.3++  5.3.28-12
ii  libevent-2.0-5  2.0.21-stable-2+b1
ii  libevent-pthreads-2.0-5 2.0.21-stable-2+b1
ii  libgcc1 1:6.2.0-6
ii  libminiupnpc10  1.9.20140610-2.1
ii  libprotobuf10   3.0.0-7
ii  libqrencode33.4.4-1+b1
ii  libqt5core5a5.6.1+dfsg-3+b1
ii  libqt5dbus5 5.6.1+dfsg-3+b1
ii  libqt5gui5  5.6.1+dfsg-3+b1
ii  libqt5network5  5.6.1+dfsg-3+b1
ii  libqt5widgets5  5.6.1+dfsg-3+b1
ii  libssl1.0.2 1.0.2j-1
ii  libstdc++6  6.2.0-6
ii  libzmq5 4.1.5-2

bitcoin-qt recommends no packages.

bitcoin-qt suggests no packages.

-- no debconf information