Does anyone successfully working with VLD and wxWidgets?

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Does anyone successfully working with VLD and wxWidgets?

Post by ONEEYEMAN »

Hi,
I have MSVC 2019 on Windows 8.1 and installed latest VLD.
Turned it on, recompiled and got following:
The application was unable to start correctly (0xc01500002). Click OK to close the application
I built wxWidgets as DLL and CRT is static.

How do I run VLD on my program?

Thank you.
catalin
Moderator
Moderator
Posts: 1618
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: Does anyone successfully working with VLD and wxWidgets?

Post by catalin »

Run your app outside VS and it should tell you which dll-s it cannot find.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Does anyone successfully working with VLD and wxWidgets?

Post by PB »

ONEEYEMAN wrote: Fri Aug 14, 2020 5:59 am I built wxWidgets as DLL and CRT is static.
Isn't this quite an odd combination, resulting into wxWidgets and the application each having its own copy of the CRT?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Does anyone successfully working with VLD and wxWidgets?

Post by ONEEYEMAN »

Hi,
PB wrote: Fri Aug 14, 2020 7:55 am
ONEEYEMAN wrote: Fri Aug 14, 2020 5:59 am I built wxWidgets as DLL and CRT is static.
Isn't this quite an odd combination, resulting into wxWidgets and the application each having its own copy of the CRT?
All I did was turn on the DLL configuration inside the minimal sample.

Thank you.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Does anyone successfully working with VLD and wxWidgets?

Post by PB »

AFAIK, the MSVC project files for the library and the samples do not have static CRT linking on.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Does anyone successfully working with VLD and wxWidgets?

Post by ONEEYEMAN »

Catalin,
catalin wrote: Fri Aug 14, 2020 7:52 am Run your app outside VS and it should tell you which dll-s it cannot find.
So this is what I did:

1. Because my app has many DLLs I included VLD in all of them and rebuild the solution.
2. When I ran the application, it ran fine, but then when I click the button on the toolbar I got following message:
Failed to load shared library 'dbloader.dll' (error 1400: The application has failed to start because its side-by-side configuration is incorrect.
3. So then I ran Dependency Walker on that library - this is my library so this should return everything that is wrong.
The result is attached.

Now this laptop has Windows 8.1 64-bit and both MSVC 2010 and MSVC 2017.
I am currently working with the latter, since 2010 didn't have a functionality I needed for C++11.

And of course without VLD everything works fine.

Any idea?

Thank you.
dep_walker.PNG
dep_walker.PNG (75.45 KiB) Viewed 1832 times
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Does anyone successfully working with VLD and wxWidgets?

Post by ONEEYEMAN »

Catalin,
I also do have a redisttributable packages starting with MSVC 2005 (see attachment).
I'm also attaching the event viewer for the error.

Thank you.
redistributable.PNG
eventlog.PNG
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Does anyone successfully working with VLD and wxWidgets?

Post by doublemax »

Have you tried adding VLD to a small sample application?

The only time i ever had issues with VLD was related to the version of dbghelp.dll. There is one shipped with VLD, but usually there's also one in C:\Windows\System32
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Does anyone successfully working with VLD and wxWidgets?

Post by ONEEYEMAN »

Hi,
OK, I did a little googling.
Turns out I was missing a manifest from the VLD.

I copied it over, rebuild everything and now I'm getting:

Code: Select all

dbloader.dll is not a valid Win32 application.
This one I don't understand at all.

@doublemax,
Yes, worked fine.
I even tried to put the possible leak code in the sample and run VLD on it - no leaks.

Thank you.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Does anyone successfully working with VLD and wxWidgets?

Post by ONEEYEMAN »

doublemax,
I don't know why and what, but after I rebuild everything couple of times it all started working.

However, to my surprise I didn't get full report:
WARNING: Visual Leak Detector detected memory leaks!
---------- Block 33808 at 0x1342CFD8: 32 bytes ----------
Leak Hash: 0x6B3B8086, Count: 1, Total 32 bytes
Call Stack (TID 1180):
Data:
4D 00 53 00 20 00 53 00 61 00 6E 00 73 00 20 00 M.S...S. a.n.s...
53 00 65 00 72 00 69 00 66 00 00 00 CD CD CD CD S.e.r.i. f.......


---------- Block 33804 at 0x1DCF6FF0: 8 bytes ----------
Leak Hash: 0x9BB73995, Count: 1, Total 8 bytes
Call Stack (TID 1180):
Data:
4C EF EC 1D 00 00 00 00 L....... ........


---------- Block 33803 at 0x1DD4EFF0: 8 bytes ----------
Leak Hash: 0x5A815182, Count: 1, Total 8 bytes
Call Stack (TID 1180):
Data:
30 EF EC 1D 00 00 00 00 0....... ........


---------- Block 33805 at 0x1DE08FF0: 8 bytes ----------
Leak Hash: 0xEEC531D6, Count: 1, Total 8 bytes
Call Stack (TID 1180):
Data:
68 EF EC 1D 00 00 00 00 h....... ........


---------- Block 33806 at 0x1DE34FD8: 32 bytes ----------
Leak Hash: 0xCB092FB8, Count: 1, Total 32 bytes
Call Stack (TID 1180):
Data:
4D 00 53 00 20 00 53 00 61 00 6E 00 73 00 20 00 M.S...S. a.n.s...
53 00 65 00 72 00 69 00 66 00 00 00 CD CD CD CD S.e.r.i. f.......


---------- Block 33810 at 0x1DEB8FD8: 32 bytes ----------
Leak Hash: 0x88EF9003, Count: 1, Total 32 bytes
Call Stack (TID 1180):
Data:
4C 00 65 00 61 00 67 00 75 00 65 00 73 00 20 00 L.e.a.g. u.e.s...
74 00 61 00 62 00 6C 00 65 00 00 00 CD CD CD CD t.a.b.l. e.......


---------- Block 33809 at 0x1DED0FF0: 8 bytes ----------
Leak Hash: 0x3E5218BB, Count: 1, Total 8 bytes
Call Stack (TID 1180):
Data:
E0 EF EC 1D 00 00 00 00 ........ ........


---------- Block 33802 at 0x1DF04FF0: 8 bytes ----------
Leak Hash: 0x182DA9F3, Count: 1, Total 8 bytes
Call Stack (TID 1180):
Data:
14 EF EC 1D 00 00 00 00 ........ ........


---------- Block 33799 at 0x1DF16FF0: 8 bytes ----------
Leak Hash: 0x3B3606EF, Count: 1, Total 8 bytes
Call Stack (TID 1180):
Data:
C0 EE EC 1D 00 00 00 00 ........ ........


---------- Block 33800 at 0x1DF4EFF0: 8 bytes ----------
Leak Hash: 0x9D745911, Count: 1, Total 8 bytes
Call Stack (TID 1180):
Data:
DC EE EC 1D 00 00 00 00 ........ ........


---------- Block 33801 at 0x1E00AFF0: 8 bytes ----------
Leak Hash: 0x50BA3637, Count: 1, Total 8 bytes
Call Stack (TID 1180):
Data:
F8 EE EC 1D 00 00 00 00 ........ ........


---------- Block 33807 at 0x1E00CFD8: 32 bytes ----------
Leak Hash: 0x3B22D719, Count: 1, Total 32 bytes
Call Stack (TID 1180):
Data:
4D 00 53 00 20 00 53 00 61 00 6E 00 73 00 20 00 M.S...S. a.n.s...
53 00 65 00 72 00 69 00 66 00 00 00 CD CD CD CD S.e.r.i. f.......


Visual Leak Detector detected 12 memory leaks (624 bytes).
Largest number used: 480824 bytes.
Total allocations: 3552431 bytes.
Visual Leak Detector is now exiting.
I was hoping to get a backtrace to the places where the allocation happens, but I don't see it unfortunately.
All I see is - " (TID 1180):".
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Does anyone successfully working with VLD and wxWidgets?

Post by doublemax »

vld.h must be included in every source file where you want to detect memory leaks. Did you do that?
Use the source, Luke!
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Does anyone successfully working with VLD and wxWidgets?

Post by utelle »

doublemax wrote: Sun Aug 16, 2020 8:43 am vld.h must be included in every source file where you want to detect memory leaks.
AFAIK this is not correct. The header file vld.h has to be included in at least one source file of each compilation unit (executable or DLL), for which leak detection is desired. Including it in more than one source file doesn't harm, but makes no difference.
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Does anyone successfully working with VLD and wxWidgets?

Post by utelle »

ONEEYEMAN wrote: Sun Aug 16, 2020 3:34 am However, to my surprise I didn't get full report:
[...]
I was hoping to get a backtrace to the places where the allocation happens, but I don't see it unfortunately.
All I see is - " (TID 1180):".
I had similar issues with VLD, which went away after recompiling VLD with the latest version of Visual C++ 2015 and then reinstalling it.

VLD version 2.5.1 works for Visual C++ 2008-2015, but has issues with Visual C++ 2017 and 2019. There exists a separate VLD version 2.6.0 for Visual C++ 2019. However, I can't comment on that version, because I haven't tested it yet.

EDIT: I found this article regarding VLD and Visual C++ 2017. Maybe the same procedure can be applied to VLD and VIsual C++ 2019.
Post Reply