Qt debug/release on Windows recommendation

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Qt debug/release on Windows recommendation

Isaiah Norton-2
The Windows build instructions for Qt [1] are IMHO a little bit ambiguous about whether the Qt build type should match the Slicer build. The instructions only reference a mismatch as problematic when using plugins in Qt Designer (which I didn't need)

I built a debug Slicer against release Qt, but hit a crash on startup in PythonQt, which seems to be [2] (it's in the destructor for QVariant, maybe mismatched allocator between the app and the library).

Should the instructions specify that the Qt and Slicer build configurations *must* match?

Thanks,

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Qt debug/release on Windows recommendation

Steve Pieper-2
Hi Isaiah - 

As far as I know it's only for the designer plugins that the versions actually need to match.  I've been doing experimental builds with Qt5 lately directly downloaded from qt.io and have used the same libs for both debut and release with visual studio 2013.

Looking back at the old bug reports [2] I believe the problem was using a debug qt build with a release slicer and not the other way around.


HTH,
Steve


On Thu, Mar 30, 2017 at 5:24 PM, Isaiah Norton <[hidden email]> wrote:
The Windows build instructions for Qt [1] are IMHO a little bit ambiguous about whether the Qt build type should match the Slicer build. The instructions only reference a mismatch as problematic when using plugins in Qt Designer (which I didn't need)

I built a debug Slicer against release Qt, but hit a crash on startup in PythonQt, which seems to be [2] (it's in the destructor for QVariant, maybe mismatched allocator between the app and the library).

Should the instructions specify that the Qt and Slicer build configurations *must* match?

Thanks,

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Qt debug/release on Windows recommendation

lasso2

In Qt5 install packages usually both release and debug libraries are included. It’s very easy to verify this, as DLL filenames are different (for example: Qt5Core.dll / Qt5Cored.dll).

 

I always build a debug-only and a release-only Qt. Then there is no confusion with Qt designer and designer plugins.

 

Andras

 

From: slicer-devel [mailto:[hidden email]] On Behalf Of Steve Pieper
Sent: March 30, 2017 17:58
To: Isaiah Norton <[hidden email]>
Cc: SPL Slicer Devel <[hidden email]>
Subject: Re: [slicer-devel] Qt debug/release on Windows recommendation

 

Hi Isaiah - 

 

As far as I know it's only for the designer plugins that the versions actually need to match.  I've been doing experimental builds with Qt5 lately directly downloaded from qt.io and have used the same libs for both debut and release with visual studio 2013.

 

Looking back at the old bug reports [2] I believe the problem was using a debug qt build with a release slicer and not the other way around.

 

 

HTH,

Steve

 

 

On Thu, Mar 30, 2017 at 5:24 PM, Isaiah Norton <[hidden email]> wrote:

The Windows build instructions for Qt [1] are IMHO a little bit ambiguous about whether the Qt build type should match the Slicer build. The instructions only reference a mismatch as problematic when using plugins in Qt Designer (which I didn't need)

 

I built a debug Slicer against release Qt, but hit a crash on startup in PythonQt, which seems to be [2] (it's in the destructor for QVariant, maybe mismatched allocator between the app and the library).

 

Should the instructions specify that the Qt and Slicer build configurations *must* match?

 

Thanks,


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ

 


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Qt debug/release on Windows recommendation

Jean-Christophe Fillion-Robin
Generally speaking, mixing debug and release is not recommended.
By mixing, it is quite easy to face DLL boundaries issues. See https://msdn.microsoft.com/en-us/library/ms235460.aspx

The place where we mix release and debug is related to python. When a debug build of Slicer is generated, python is built in release. That said, we carefully include Python.h.
Jc


On Fri, Mar 31, 2017 at 12:04 AM, Andras Lasso <[hidden email]> wrote:

In Qt5 install packages usually both release and debug libraries are included. It’s very easy to verify this, as DLL filenames are different (for example: Qt5Core.dll / Qt5Cored.dll).

 

I always build a debug-only and a release-only Qt. Then there is no confusion with Qt designer and designer plugins.

 

Andras

 

From: slicer-devel [mailto:[hidden email]] On Behalf Of Steve Pieper
Sent: March 30, 2017 17:58
To: Isaiah Norton <[hidden email]>
Cc: SPL Slicer Devel <[hidden email]>
Subject: Re: [slicer-devel] Qt debug/release on Windows recommendation

 

Hi Isaiah - 

 

As far as I know it's only for the designer plugins that the versions actually need to match.  I've been doing experimental builds with Qt5 lately directly downloaded from qt.io and have used the same libs for both debut and release with visual studio 2013.

 

Looking back at the old bug reports [2] I believe the problem was using a debug qt build with a release slicer and not the other way around.

 

 

HTH,

Steve

 

 

On Thu, Mar 30, 2017 at 5:24 PM, Isaiah Norton <[hidden email]> wrote:

The Windows build instructions for Qt [1] are IMHO a little bit ambiguous about whether the Qt build type should match the Slicer build. The instructions only reference a mismatch as problematic when using plugins in Qt Designer (which I didn't need)

 

I built a debug Slicer against release Qt, but hit a crash on startup in PythonQt, which seems to be [2] (it's in the destructor for QVariant, maybe mismatched allocator between the app and the library).

 

Should the instructions specify that the Qt and Slicer build configurations *must* match?

 

Thanks,


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ

 


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ



--
+1 919 869 8849

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Qt debug/release on Windows recommendation

Isaiah Norton-2
In reply to this post by lasso2
@Steve I've done mixed builds like that in the past too, which is why I didn't think it would be an issue.

@Jc if PythonQt is linked to a different CRT then that's a reasonable explanation. I started a separate build and will debug a bit when I get a chance.

Best,
Isaiah

On Fri, Mar 31, 2017 at 12:25 AM, Jean-Christophe Fillion-Robin <[hidden email]> wrote:
Generally speaking, mixing debug and release is not recommended.
By mixing, it is quite easy to face DLL boundaries issues. See https://msdn.microsoft.com/en-us/library/ms235460.aspx

The place where we mix release and debug is related to python. When a debug build of Slicer is generated, python is built in release. That said, we carefully include Python.h.
Jc


On Fri, Mar 31, 2017 at 12:04 AM, Andras Lasso <[hidden email]> wrote:

In Qt5 install packages usually both release and debug libraries are included. It’s very easy to verify this, as DLL filenames are different (for example: Qt5Core.dll / Qt5Cored.dll).

 

I always build a debug-only and a release-only Qt. Then there is no confusion with Qt designer and designer plugins.

 

Andras

 

From: slicer-devel [mailto:[hidden email]] On Behalf Of Steve Pieper
Sent: March 30, 2017 17:58
To: Isaiah Norton <[hidden email]>
Cc: SPL Slicer Devel <[hidden email]>
Subject: Re: [slicer-devel] Qt debug/release on Windows recommendation

 

Hi Isaiah - 

 

As far as I know it's only for the designer plugins that the versions actually need to match.  I've been doing experimental builds with Qt5 lately directly downloaded from qt.io and have used the same libs for both debut and release with visual studio 2013.

 

Looking back at the old bug reports [2] I believe the problem was using a debug qt build with a release slicer and not the other way around.

 

 

HTH,

Steve

 

 

On Thu, Mar 30, 2017 at 5:24 PM, Isaiah Norton <[hidden email]> wrote:

The Windows build instructions for Qt [1] are IMHO a little bit ambiguous about whether the Qt build type should match the Slicer build. The instructions only reference a mismatch as problematic when using plugins in Qt Designer (which I didn't need)

 

I built a debug Slicer against release Qt, but hit a crash on startup in PythonQt, which seems to be [2] (it's in the destructor for QVariant, maybe mismatched allocator between the app and the library).

 

Should the instructions specify that the Qt and Slicer build configurations *must* match?

 

Thanks,


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ

 


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ



--
<a href="tel:(919)%20869-8849" value="&#43;19198698849" target="_blank">+1 919 869 8849


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Qt debug/release on Windows recommendation

Isaiah Norton-2
In reply to this post by lasso2
I debugged further, and the issue is indeed mismatched allocator and destructor. PythonQt allocates several objects directly due to expanded templates for QList<T> functions. These allocations happen in the msvcr120d debug dll:

> msvcr120d.dll!malloc(unsigned __int64 nSize) Line 60 C++
  msvcr120d.dll!operator new(unsigned __int64 size) Line 59 C++
  PythonQt.dll!QList<QVariant>::node_construct(QList<QVariant>::Node * n, const QVariant & t) Line 372 C++
  PythonQt.dll!QList<QVariant>::append(const QVariant & t) Line 512 C++
  PythonQt.dll!PythonQtConv::PyObjToQVariant(_object * val, int type) Line 1132 C++
  PythonQt.dll!PythonQtConv::PyObjToQVariant(_object * val, int type) Line 1132 C++
  PythonQt.dll!PythonQt::call(_object * callable, const QList<QVariant> & args, const QMap<QString,QVariant> & kwargs) Line 1183 C++
  PythonQt.dll!PythonQt::call(_object * object, const QString & name, const QList<QVariant> & args, const QMap<QString,QVariant> & kwargs) Line 1170 C++
  PythonQt.dll!PythonQtObjectPtr::call(const QString & callable, const QList<QVariant> & args, const QMap<QString,QVariant> & kwargs) Line 101 C++
  PythonQt.dll!PythonQtPrivate::setupSharedLibrarySuffixes() Line 1313 C++

However, deallocation happens in the regular msvcr dll (I verified that an address deallocated here was allocated from msvcr120d):
 
  ntdll.dll!RtlReportCriticalFailure () Unknown
  ntdll.dll!RtlpHeapHandleError () Unknown
  ntdll.dll!RtlpLogHeapFailure () Unknown
  ntdll.dll!RtlFreeHeap () Unknown
> msvcr120.dll!free(void * pBlock) Line 51 C
  QtCore4.dll!000000005bf79d3d() Unknown
  QtCore4.dll!000000005bfcc5e1() Unknown
  QtCore4.dll!000000005bfca062() Unknown
  QtCore4.dll!000000005bf79d35() Unknown
  QtCore4.dll!000000005bfcc5e1() Unknown
  QtCore4.dll!000000005bfca062() Unknown
  PythonQt.dll!PythonQtPrivate::setupSharedLibrarySuffixes() Line 1331 C++ 

Looking at the allocator code, I don't think there is any way this could work, so I'll stick with Slicer & Qt both in debug mode.

Thanks,
Isaiah

On Fri, Mar 31, 2017 at 11:43 AM, Isaiah Norton <[hidden email]> wrote:
@Steve I've done mixed builds like that in the past too, which is why I didn't think it would be an issue.

@Jc if PythonQt is linked to a different CRT then that's a reasonable explanation. I started a separate build and will debug a bit when I get a chance.

Best,
Isaiah

On Fri, Mar 31, 2017 at 12:25 AM, Jean-Christophe Fillion-Robin <[hidden email]> wrote:
Generally speaking, mixing debug and release is not recommended.
By mixing, it is quite easy to face DLL boundaries issues. See https://msdn.microsoft.com/en-us/library/ms235460.aspx

The place where we mix release and debug is related to python. When a debug build of Slicer is generated, python is built in release. That said, we carefully include Python.h.
Jc


On Fri, Mar 31, 2017 at 12:04 AM, Andras Lasso <[hidden email]> wrote:

In Qt5 install packages usually both release and debug libraries are included. It’s very easy to verify this, as DLL filenames are different (for example: Qt5Core.dll / Qt5Cored.dll).

 

I always build a debug-only and a release-only Qt. Then there is no confusion with Qt designer and designer plugins.

 

Andras

 

From: slicer-devel [mailto:[hidden email]] On Behalf Of Steve Pieper
Sent: March 30, 2017 17:58
To: Isaiah Norton <[hidden email]>
Cc: SPL Slicer Devel <[hidden email]>
Subject: Re: [slicer-devel] Qt debug/release on Windows recommendation

 

Hi Isaiah - 

 

As far as I know it's only for the designer plugins that the versions actually need to match.  I've been doing experimental builds with Qt5 lately directly downloaded from qt.io and have used the same libs for both debut and release with visual studio 2013.

 

Looking back at the old bug reports [2] I believe the problem was using a debug qt build with a release slicer and not the other way around.

 

 

HTH,

Steve

 

 

On Thu, Mar 30, 2017 at 5:24 PM, Isaiah Norton <[hidden email]> wrote:

The Windows build instructions for Qt [1] are IMHO a little bit ambiguous about whether the Qt build type should match the Slicer build. The instructions only reference a mismatch as problematic when using plugins in Qt Designer (which I didn't need)

 

I built a debug Slicer against release Qt, but hit a crash on startup in PythonQt, which seems to be [2] (it's in the destructor for QVariant, maybe mismatched allocator between the app and the library).

 

Should the instructions specify that the Qt and Slicer build configurations *must* match?

 

Thanks,


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ

 


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ



--
<a href="tel:(919)%20869-8849" value="&#43;19198698849" target="_blank">+1 919 869 8849



_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ