473,388 Members | 1,552 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Yet another debug-to-release issue

How many times have we had a program that works toot-sweet in debug but dies
in release? Too many.

I've created .NET assembly containing a bunch of managed wrapper C++ classes
that wrap unmanged C++ classes; these unmanaged C++ classes are located in a
Win32 library file. The library is built using MFC as shared in debug but
static in release (this is how we typically to things).

The managed wrapper classes do a new on the unmanged class in the
constructor and then have pass through functions to the unmanaged class.

I have a console application that tests the wrapper assembly and all is
heavenly sweet in debug.

In release mode, the heap is corrupted before any lines are executed in the
constructor of any managed wrapper class; it is fine in the test application
right before it does a new on the managed wrapper class. _crtheap is zero in
malloc.c.

Anyone have any ideas?

Thanks.

Jon.
Nov 17 '05 #1
5 1080
I don't know how much this helps but I'm curious what would happen if
MFC library is statically linked in debug mode.

Without seeing any project settings, that seems the only difference
between debug mode and release mode.

Keep us updated.

Ramsey

Nov 17 '05 #2

It looks like CRT is not initialized.

May be here you can find some related information:
http://support.microsoft.com/?id=814472

Regards,
Oleg


Nov 17 '05 #3
I gave this some thought and will probably give this a shot in my next go at
it - Thanks for the reply.

"Ramsey" <ra********@hotmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
I don't know how much this helps but I'm curious what would happen if
MFC library is statically linked in debug mode.

Without seeing any project settings, that seems the only difference
between debug mode and release mode.

Keep us updated.

Ramsey

Nov 17 '05 #4
Looks interesting - might have to give this a try - thanks. Jon.

"Oleg Starodumov" <com-dot-debuginfo-at-oleg> wrote in message
news:ur**************@TK2MSFTNGP12.phx.gbl...

It looks like CRT is not initialized.

May be here you can find some related information:
http://support.microsoft.com/?id=814472

Regards,
Oleg



Nov 17 '05 #5
I got everything to play together by setting Use MFC as a Shared DLL and
using /MD throughout on all the components that go into building the .NET
assembly. I'd rather use Use MFC as a Static Library but perhaps creating a
DLL assembly with MFC requires the Shared version of MFC. It seems to work
so I'm moving on. Thanks all for the comments. Jon.

"jlea" <jo*@leapsoft.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I gave this some thought and will probably give this a shot in my next go at it - Thanks for the reply.

"Ramsey" <ra********@hotmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
I don't know how much this helps but I'm curious what would happen if
MFC library is statically linked in debug mode.

Without seeing any project settings, that seems the only difference
between debug mode and release mode.

Keep us updated.

Ramsey


Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Markus Dehmann | last post by:
I have a static const bool debug = false; variable in my class. Debug output goes like this, trivially: if(debug) cerr << "debug message"; Is it guaranteed that this if/then clause is always...
2
by: John A. Bailo | last post by:
When I run this line, Debug.WriteLine("I am in OnHandler2 and MyEventArgs is {0}", e.m_id); and e.m_id = "Event args for event 1" What prints in the debug window is: Event args for event...
1
by: Fred Mellender | last post by:
When I code: Debug.Assert(false, "this is a message"); it works fine, and out comes the dialog box. When I code Trace.Listeners.Clear(); Debug.Assert(false, "this is a message"); No message...
4
by: emma middlebrook | last post by:
I have a question regarding asserting ... here's some code: string GetAssertMessage() { ... prepare a message string and return it... } void SomeMethod() { ...
3
by: Gunawan | last post by:
In vs 6 I can use debug.print as alternatif debugging value at runtime. Which function that I can use in C# 2005 Express for windows form apps? TIA, Gunawan
2
by: Jeremy S. | last post by:
By default, Web.config has the following section: <compilation defaultLanguage="c#" debug="true" /> note that debug="true" There is a comment - also in the default Web.config - that states...
6
by: Christian Blackburn | last post by:
Hi Gang, I'm wondering what the VB6 equivalent of Debug.Print is? Thanks in Advance, Christian Blackburn
7
by: Tom | last post by:
How can I make code not execute for a debug build, but do execute for a production build? I have code which prompts for an account and password when the program starts up. It is a pain to have to...
0
by: zylkm | last post by:
Hi, when I compile a console project in Visual Studio 2005(C#) ,it's output is:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4...
3
by: Martin Wiechert | last post by:
Hi list, I've created a fresh build of Python 2.4.3 using the following configuration $ ./configure --with-pydebug --prefix=/usr/local/debug --enable-shared --with-fpectl --with-signal-module...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.