473,473 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Code snipped crashes VS - why?

You guys are going to like this. I work on a very large (500,000 line)
native C++ project. VS started crasing recently and I've similified it down
to fifty lines (took me six hours).

Why is the debugger crashing?

Microsoft Visual C++ .NET 69462-270-0000007-18536

Steps to reproduce:
1. Download/extract sample.zip
2. Open sample.sln
3. Build the project
4. Place a breakpoint in SlamemApp.cpp line 44 (at function "f"). This is
required. ALso note that the function "f" is never called.
5. Launch the app in the debugger
6. VS stops responding

There are many things I can rename/reorder/eliminate to "fix" the problem,
but I don't want to bias your analysis.

Thanks so much for your help!

Zip file here:
http://www.stankevitz.com/visualstudio/sample.zip

Chris
Nov 17 '05 #1
13 1013
> Why is the debugger crashing?

I may be on to something here. Could it be that when a function's mangled
name reaches 766 characters that VS crashes when you place a breakpoint in
the function?

Length_of_mangled_name (Works)
716 (Works)
736 (Works)
761 (Works)
766 (Does not work)
771 (Does not work)
776 (Does not work)
786 (Does not work)
846 (Does not work)

Nov 17 '05 #2
Maybe I should have just posted my code. This code freezes my version of VS
when I place a breakpoint inside the function "f". Notice function "f" is
never called. I generated this code by shrinking down my 500k line app to
these 40 lines.

I am not convinced that the issue is due to the length of the mangled name
because I can construct certain functions with much longer mangled name
lengths and it works fine.

While my original version (in the 500k line app) had a much shorter class
name, in the transition to the short version I had to increase the length of
the class name to have VS die.

Thanks for your help,

Chris
int main()
{
return 0;
}

#include <list>
#include <map>
class A;
class B;

class TSEntropyScheduleEvaluatorTSEntropyScheduleEvaluat or
{
struct S {};

enum E {};

void f(
B& a,
std::map<unsigned, int>&,
std::map<unsigned, A*>&,
std::map<unsigned, std::list<S*> >&,
std::map<unsigned, std::map<unsigned, A*> >&,
std::map<unsigned, double>&,
E g);
};

void TSEntropyScheduleEvaluatorTSEntropyScheduleEvaluat or::f(
B& a,
std::map<unsigned, int>&,
std::map<unsigned, A*>&,
std::map<unsigned, std::list<S*> >&,
std::map<unsigned, std::map<unsigned, A*> >&,
std::map<unsigned, double>&,
E g)
{

}


Nov 17 '05 #3
Chris Stankevitz <ch******@stankevitz.nospamplease.com> wrote:
Maybe I should have just posted my code. This code freezes my version of VS
when I place a breakpoint inside the function "f". [...]
I checked this (with VC7.1) and can confirm
the bug.
The IDE indeed behaves strange when I put a
breakpoint into the function. Funny enough,
it doesn't even really freeze -- I can still
operate it. (For example, I was able to open
the breakpoint window and clear the breakpoint)
It's just that it seems to wait for something.
(It's not using much CPU resources either.)
[...]

Schobi

--
Sp******@gmx.de is never read
I'm Schobi at suespammers dot org

"Coming back to where you started is not the same as never leaving"
Terry Pratchett
Nov 17 '05 #4
"Hendrik Schober" wrote
I checked this (with VC7.1) and can confirm
the bug.
The IDE indeed behaves strange when I put a
breakpoint into the function.


Hendrik,

Thanks for taking a look at this for me. Do you have any idea what how I
can work around this? This particular problem is causing my team a lot of
headache because we need to debug this function!

Thanks,

Chris
Nov 17 '05 #5
Chris Stankevitz <ch******@stankevitz.nospamplease.com> wrote:
"Hendrik Schober" wrote
I checked this (with VC7.1) and can confirm
the bug.
The IDE indeed behaves strange when I put a
breakpoint into the function.
Hendrik,

Thanks for taking a look at this for me. Do you have any idea what how I
can work around this? This particular problem is causing my team a lot of
headache because we need to debug this function!


I think you should try to solve this with
MS support. (AFAIK they don't charge if
it's a MS bug you're running into.)
Thanks,

Chris

Schobi

--
Sp******@gmx.de is never read
I'm Schobi at suespammers dot org

"Coming back to where you started is not the same as never leaving"
Terry Pratchett
Nov 17 '05 #6
The same problem is cropping up here too. I tried the code on VS 2005 Beta
2, and it works fine. I think I found a workaround though; try moving the f
function body inside the class.

"Chris Stankevitz" <ch******@stankevitz.nospamplease.com> wrote in message
news:Or**************@TK2MSFTNGP15.phx.gbl...
"Hendrik Schober" wrote
I checked this (with VC7.1) and can confirm
the bug.
The IDE indeed behaves strange when I put a
breakpoint into the function.


Hendrik,

Thanks for taking a look at this for me. Do you have any idea what how I
can work around this? This particular problem is causing my team a lot of
headache because we need to debug this function!

Thanks,

Chris

Nov 17 '05 #7
Actually, that workaround will stop working when you actually try to use f,
so pretend I didn't mention it. :) But fret not, this time I think I've
found the real problem. I'm not smart enough to know why, but VS 2003 might
be having a problem with the length of your method prototype. Comment out an
argument or hack off a few characters from the class name (at least two),
and voila, the problem goes away.

"James Park" <jp**********@SpaMMEhotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
The same problem is cropping up here too. I tried the code on VS 2005 Beta
2, and it works fine. I think I found a workaround though; try moving the
f function body inside the class.

"Chris Stankevitz" <ch******@stankevitz.nospamplease.com> wrote in message
news:Or**************@TK2MSFTNGP15.phx.gbl...
"Hendrik Schober" wrote
I checked this (with VC7.1) and can confirm
the bug.
The IDE indeed behaves strange when I put a
breakpoint into the function.


Hendrik,

Thanks for taking a look at this for me. Do you have any idea what how I
can work around this? This particular problem is causing my team a lot
of headache because we need to debug this function!

Thanks,

Chris


Nov 17 '05 #8
I was feeling pretty smart until I came across this post, haha. I guess I
should read all the posts in a thread before I reply. :) I'm a little
confused though. If you already had a handle on the problem, why did you
still need a workaround?

"Chris Stankevitz" <ch******@stankevitz.nospamplease.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Why is the debugger crashing?


I may be on to something here. Could it be that when a function's mangled
name reaches 766 characters that VS crashes when you place a breakpoint in
the function?

Length_of_mangled_name (Works)
716 (Works)
736 (Works)
761 (Works)
766 (Does not work)
771 (Does not work)
776 (Does not work)
786 (Does not work)
846 (Does not work)

Nov 17 '05 #9
problem with the length of your method prototype


Thanks for your input! I need all the help I can get.

There are many things that "fix" this problem, including
1. Shorten class name
2. move struct declaration outside of the class
3. Change random things to "ints" (e.g. change the enum argument to an int
argument)

There are 4,000 other functions in my app with longer "mangled" names that
work fine so I suspect the root problem is not "the function prototype is
too long". :-/

I appreciate your input,

Chris
Nov 17 '05 #10

"James Park" <jp**********@SpaMMEhotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I tried the code on VS 2005 Beta 2, and it works fine.

Thanks for checking that for me.
Nov 17 '05 #11
I do not have a handle on the problem. I do not understand why/how it
happens. I understand several things I can do to make the symptoms go away
in this simple test case though (like rename the class).

Renaming the class and moving the declaration of structures around isn't an
option in my real case so I am trying to figure out what is really wrong.

Thanks for the help,

Chris

"James Park" <jp**********@SpaMMEhotmail.com> wrote in message
news:eK**************@TK2MSFTNGP14.phx.gbl...
I was feeling pretty smart until I came across this post, haha. I guess I
should read all the posts in a thread before I reply. :) I'm a little
confused though. If you already had a handle on the problem, why did you
still need a workaround?

"Chris Stankevitz" <ch******@stankevitz.nospamplease.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Why is the debugger crashing?


I may be on to something here. Could it be that when a function's
mangled name reaches 766 characters that VS crashes when you place a
breakpoint in the function?

Length_of_mangled_name (Works)
716 (Works)
736 (Works)
761 (Works)
766 (Does not work)
771 (Does not work)
776 (Does not work)
786 (Does not work)
846 (Does not work)


Nov 17 '05 #12
Chris Stankevitz <ch******@stankevitz.nospamplease.com> wrote:
problem with the length of your method prototype [...]
There are 4,000 other functions in my app with longer "mangled" names that
work fine so I suspect the root problem is not "the function prototype is
too long". :-/


Nevertheless, VC does have Problems with long
identifiers as employed by templates. I just
spent many days trying to hunt for the cause
of an ICE which prevented us from porting a
fairly important piece of code to VC. In the
end it was the length of a particular class
template instance. The current VC8 beta did
compile the code successfully, but took ages
for this one file.
I was able to trigger CW9.5 to emit the full
type name in an error message and it was >15kB
long. When I managed to get it down to <10kB,
VC accepted the type in the test project I had
set up (although taking >5min to compile), but
still crashed in the real code.
In the end I had to give up and circumvent the
problem by re-designing the code in question.
It's now less flexible, but at least it works
for the cases we need it right now. When VC8
hits the shelfs, we can remove the workaround.
[...]
Chris

Schobi

--
Sp******@gmx.de is never read
I'm Schobi at suespammers dot org

"Coming back to where you started is not the same as never leaving"
Terry Pratchett
Nov 17 '05 #13
"Hendrik Schober" <Sp******@gmx.de> wrote
Nevertheless, VC does have Problems with long
identifiers as employed by templates.


Thanks for your help on this issue. I rewrote my function to avoid long
identifiers.

Chris
Nov 17 '05 #14

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

Similar topics

0
by: Duncan Smith | last post by:
Greetings. I am struggling to track down what I presume is a bug in my code. The trouble is that it only raises its head occasionally. I have managed to prune the code to the following: ...
12
by: Paul | last post by:
Hi, Global operator new and delete are overloaded and I am using stl map to store pointers, but this code crashes, can some one shed some light??? Compiler: MS VC++ 6.0 STL: Shipped with...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
11
by: Daniel Manes | last post by:
Okay, here are the facts ma'am (or mister): 1. I have a user control called "Header" and a main page called "ReportMatch". 2. I've written "code-behinds" for both the user control and the main...
2
by: Harry Simpson | last post by:
I've got a call within my .NET code to a function which uses an API call to get printer settings. When there's an error in the API call code, it crashes the .NET app. Try Catch doesn't prevent...
10
by: Mythmon | last post by:
I am trying to make a program that will basically simulate a chess clock in python. To do this I have two threads running, one that updates the currently running clock, and one that watches for a...
13
by: jc | last post by:
I have written a parser using bison and flex to read ASAP2 file for CAN communications. entire development was done in an unix environment and now the code is ready to be integrated to an existing...
5
by: Jeff | last post by:
ASP.NET 2.0 This code crashes. It generate this error: Value cannot be null. Parameter name: type I've created some custom web.config settings and this crash is related to accessing theme...
1
by: DerekBaker | last post by:
I had this code previously: void App::FillFontBox(HWND PrefsBox) { EnumFontFamilies(hdc,(LPCTSTR)NULL,(FONTENUMPROC)EnumFontNamesProc,(long)this);
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.