Strange things happen in a Windows debug build

Bug #380075 reported by Sean M. Pappalardo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Invalid
Low
Unassigned
1.7
Won't Fix
Low
Unassigned

Bug Description

When building Mixxx 1.7 branch on Windows using the msvcdebug=1 build flag, I see the following problems:

- Crash on library operations (right-clicking a song twice)
- VU meters don't work
- MIDI output is unreliable (some data gets lost)

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :
summary: - Windows debug build crash on song load
+ Windows debug build crash on library operations
description: updated
Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote : Re: Windows debug build crash on library operations

Fixed in 1.7 branch r2420

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

Oop, nope. Spoke too soon. The last thing fixed some of the problem, but it still crashes when you right-click a track, then right-click another.

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

There are no link errors now, but this is still a problem.

Revision history for this message
Albert Santoni (gamegod) wrote : Re: [Bug 380075] Re: Windows debug build crash on library operations

I'm pretty sure Adam had this bug before, and then it mysteriously
went away, which means he probably turned off msvcdebug. So I think we
can confirm that this happens on another PC too.

On Mon, May 25, 2009 at 7:35 PM, Pegasus <email address hidden> wrote:
> There are no link errors now, but this is still a problem.
>
> ** Attachment added: "Screen shot of the current error dialog"
>   http://launchpadlibrarian.net/27159408/DebugError.png
>
> --
> Windows debug build crash on library operations
> https://bugs.launchpad.net/bugs/380075
> You received this bug notification because you are a member of Mixxx
> Development Team, which is subscribed to Mixxx.
>

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote : Re: Windows debug build crash on library operations

For (my) reference: search the sconscript for msvcdebug and see everything it does. Then search the code for any cflags that msvcdebug defines. I'm thinking one of these ifdef'ed code blocks is to blame for this and other debug-only strangeness.

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

Ok, scary: all msvcdebug=1 does is:
- compiles with /MDd (use the debug version of the LIBCMT library)
- links with /DEBUG
- and disables optimizations (doesn't use /O2 /GL compiler flags and /LTCG:STATUS link flag)

I'm thinking the secret is in those missing optimization flags, specifically the LTCG one...

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

No, it's the /MDd library. If I change that back to /MD it works fine. How badly do we need that?

Revision history for this message
Adam Davison (adamdavison) wrote : Re: [Bug 380075] Re: Windows debug build crash on library operations

It causes Mixxx to be linked against the debug msvc runtime libraries,
which allows you to debug to some extent what's going on if you crash
inside a windows call of some type. It's sort of equivalent to
building against the debug version of Qt but for Windows system stuff.

2009/6/25 Pegasus <email address hidden>:
> No, it's the /MDd library. If I change that back to /MD it works fine.
> How badly do we need that?
>
> --
> Windows debug build crash on library operations
> https://bugs.launchpad.net/bugs/380075
> You received this bug notification because you are a member of Mixxx
> Development Team, which is subscribed to Mixxx.
>

Revision history for this message
Albert Santoni (gamegod) wrote :

Sean, you confirm whether this is with 64-bit, 32-bit, or both?

On Thu, Jun 25, 2009 at 8:39 AM, Adam Davison<email address hidden> wrote:
> It causes Mixxx to be linked against the debug msvc runtime libraries,
> which allows you to debug to some extent what's going on if you crash
> inside a windows call of some type. It's sort of equivalent to
> building against the debug version of Qt but for Windows system stuff.
>
> 2009/6/25 Pegasus <email address hidden>:
>> No, it's the /MDd library. If I change that back to /MD it works fine.
>> How badly do we need that?
>>
>> --
>> Windows debug build crash on library operations
>> https://bugs.launchpad.net/bugs/380075
>> You received this bug notification because you are a member of Mixxx
>> Development Team, which is subscribed to Mixxx.
>>
>
> --
> Windows debug build crash on library operations
> https://bugs.launchpad.net/bugs/380075
> You received this bug notification because you are a member of Mixxx
> Development Team, which is subscribed to Mixxx.
>

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote : Re: Windows debug build crash on library operations

Both.

summary: - Windows debug build crash on library operations
+ Windows debug build: crash on library operations and VU meters don't
+ work
Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote : Re: Windows debug build: crash on library operations and VU meters don't work

So is there something screwy with my copies of the MSVC debug libraries?? Untargeting.

description: updated
tags: added: debug library meter midi vu vumeter windows
summary: - Windows debug build: crash on library operations and VU meters don't
- work
+ Strange things happen in a Windows debug build
Revision history for this message
Phillip Whelan (pwhelan) wrote :

This is due to mix matching between libraries and programs which use different windows C/C++ runtimes. The implementation of the stack as well as stdio are different in all of them and so are their structures.

The end result is if you create a FILE pointer inside your program then a library calls fprintf with it, or if you allocate memory and pass it to a library which frees it and vice versa your program hangs.

Yet another advantage to the win32 platform, hurray!

Solution: all dependencies that are linked at build time and runtime must use the same MS C/C++ runtime.

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

If that's the case (I'll test later) should I commit debug versions of the dependencies to mixxx-win[64]lib too, Albert & Adam?

Revision history for this message
Albert Santoni (gamegod) wrote : Re: [Bug 380075] Re: Strange things happen in a Windows debug build

Yes, what Philip said is correct. If we're ever going to have separate
release and debug targets, it is necessary for us to have BOTH debug
and release builds of all precompiled libraries for Windows.

On Thu, Jul 23, 2009 at 2:39 PM, Pegasus<email address hidden> wrote:
> If that's the case (I'll test later) should I commit debug versions of
> the dependencies to mixxx-win[64]lib too, Albert & Adam?
>
> --
> Strange things happen in a Windows debug build
> https://bugs.launchpad.net/bugs/380075
> You received this bug notification because you are a member of Mixxx
> Development Team, which is subscribed to Mixxx.
>

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

Won't fix this in 1.7 anymore. This is going to seriously increase our mixxx-win*lib space if we commit all of the dependencies with debug libs as well. Do we really want to do that?

Changed in mixxx:
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Pegasus (pegasus-renegadetech)
Changed in mixxx:
assignee: Sean M. Pappalardo (pegasus-renegadetech) → nobody
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Since this one is ancient history I'm going to close it. We're pretty certain it was just a result of mixing runtimes.

Changed in mixxx:
status: Triaged → Invalid
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/5176

lock status: Metadata changes locked and limited to project staff
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.