Qt SQL error on exit

Bug #1239126 reported by Chris Young
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qpdfview
Won't Fix
Low
Adam Reichold

Bug Description

Hi

I'm getting the following error on exit. This has been introduced somewhere between 0.4.4 and 0.4.6b2. I'm using Qt 4.7 (on AmigaOS 4).

QSqlDatabasePrivate::removeDatabase: connection 'qt_sql_default_connection' is still in use, all queries will cease to work.

Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello again,

from the description, I guess that this has not impeded the functionality of bookmarks or per-file settings? And it also happens on every program exit?

I guess the reason is that the database connection is not handled by the main window anymore but by a singleton that is a child of the application object itself. Problem is that I can't reproduce this, could you try to localize where in the code the message is generated? (Or is there a way that I could debug this on an AmigaOS system? Using a VM or something?)

Best regards, Adam.

Changed in qpdfview:
status: New → Incomplete
importance: Undecided → Medium
assignee: nobody → Adam Reichold (adamreichold)
Revision history for this message
Adam Reichold (adamreichold) wrote :

Most interesting would a stack trace from where QSqlDatabasePrivate::removeDatabase gets called, as the database singleton should be the only one with a reference to the connection and it should deconstruct before the application object as it is its child.

Revision history for this message
Adam Reichold (adamreichold) wrote :

Interestingly enough, building without SQL support was broken and nobody noticed. :-( But anyway, you could probably try to reinstate the previous object life cycle by adding "QObject::connect(mainWindow, SIGNAL(destroyed()), Database::instance(), SLOT(deleteLater()));" at e.g. line 433 of main.cpp, so that the Database will deconstruct before the main window...

Revision history for this message
Chris Young (chris-0zxv) wrote :

It doesn't seem to have stopped anything working, it's just an annoying message :)
Adding that line makes no difference. I might try building without SQL support (if it works now!) as I don't particularly need it anyway.

Revision history for this message
Adam Reichold (adamreichold) wrote :

Building without SQL support works with trunk, but not with the amigaos4 branch. But of course will after merging. (It's just about removing two stale Q_UNUSED statements.) But please let me know what you decide to do so I can update this bug report accordingly.

Revision history for this message
Chris Young (chris-0zxv) wrote :

I've manually patched in your SQL changes and built it without SQL. Error message gone (unsurprisingly). I'm happy to use it without the database, so you can close this.

Revision history for this message
Adam Reichold (adamreichold) wrote :

Reclassifying as low since it does not affect any functionality.

Changed in qpdfview:
importance: Medium → Low
status: Incomplete → Won't Fix
Revision history for this message
Chris Young (chris-0zxv) wrote :

I built 0.4.11.1, but building without SQL still seems to be broken?

Revision history for this message
Adam Reichold (adamreichold) wrote : Re: [Bug 1239126] Re: Qt SQL error on exit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Chris,

Am 11.08.2014 um 19:16 schrieb Chris Young:
> I built 0.4.11.1, but building without SQL still seems to be
> broken?

Could you paste the build output into a mail? Because I just tried
building with CONFIG+=without_sql using both Qt4 and Qt5 without problems.

Best regards, Adam.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBAgAGBQJT6P3JAAoJEPSSjE3STU34L+AIAKF9yr3mW3mglyodhnIzSGc7
Q4XAvmye+1iLFl5QkPaF3/JAngAM6zjI7lK86GeMg8RuPHH9UtevEPgu+kqbso/v
XAmhtzyfLFhbf7NGRKIXek/7Hu3+tIaLh9598eHLEc4PhTxJEhGO89g3OTkXIqBj
XyjLtomHiwtzr6VsPSb1ikxpgg53F+HQTPx/1OIQPYgVuodznrFX8stqL8RxHkaq
lpRCx3ZMHoOb4JIl6Hn822KNzWMIQmXpiM1ymjMr7lZUJomWYA4Pfyq4/ry7X4MJ
kHIZMRNdAHjs0Vf2umcxbiwV9n+FhaU5a0q5GkjfqMlHM0Yav9zn8FGhot+TRq8=
=D6ci
-----END PGP SIGNATURE-----

Revision history for this message
Chris Young (chris-0zxv) wrote :

I think that might be part of the problem, as qmake CONFIG+= never seems to work here - so I disabled it manually by removing -DWITH_SQL from the makefile. I'm sure that's all I did last time though?
I can get you a build log if it's still useful.

Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello again,

Am 11.08.2014 um 20:26 schrieb Chris Young:
> I think that might be part of the problem, as qmake CONFIG+= never
> seems to work here - so I disabled it manually by removing
> -DWITH_SQL from the makefile. I'm sure that's all I did last time
> though? I can get you a build log if it's still useful.

if that is the case the problem probably lies in the qmake port. Did
you try adding the CONFIG += without_sql clause to the project include
"qpdfview.pri" instead? Since the configuration doesn't seem to apply
at all, a build log is probably not necessary.

(Not sure whether that was all you had to do before, but building
without SQLite was really broken in at least two releases, i.e. even
without the WITH_SQL define.)

Best regards, Adam.

Revision history for this message
Chris Young (chris-0zxv) wrote :

I don't remember. I'll try it and get back to you.

Revision history for this message
Chris Young (chris-0zxv) wrote :

I'm sorry, I'm such an idiot. Building without SQL is working fine, I had entirely forgotten to clean the old build files, so the changes didn't actually apply. It is working now as expected.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.