Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / July 2004

Tip: Looking for answers? Try searching our database.

Stack overflow in vs.net c++ program

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David W. Walker - 12 Jul 2004 10:05 GMT
I am attempting to port a C code that runs OK on a number of Linux and Unix
machines to Windows XP using Visual Studio C++. I have set the program up as
a console application, but when I try to run it I get a stack overflow:

Unhandled exception at 0x0041e715 in NewMD.exe: 0xC00000FD: Stack overflow.

The call stack is:

NewMD.exe!_chkstk() Line 91
NewMD.exe!mainCRTStartup() Line 259 +0x19
kernel32.dll!77e814c()

All this appears to be happening before my C code actually does anything.

Does anyone know what the problem is and how to fix it

Thanks
David
Daniel =?iso-8859-1?Q?Lidstr=F6m?= - 12 Jul 2004 15:10 GMT
> I am attempting to port a C code that runs OK on a number of Linux and Unix
> machines to Windows XP using Visual Studio C++. I have set the program up as
[quoted text clipped - 11 lines]
>
> Does anyone know what the problem is and how to fix it

It could be the allocation of some very large object. For example, a static
class variable that is very large. If the stack space is smaller for your
windows program than your unix program, the variable might not fit. Either
increase stack size or allocate such objects dynamically (i.e. on the
heap).

Signature

Daniel

David Brewer - 18 Jul 2004 01:59 GMT
There are number of reasons for stack overflow exception. As Daniel pointed,
program (a function??) could be allocating a very large stack space.Or,

- You are copying something to a variable on the stack, and buffer exceeds
bounds of the stack
- You are recursively calling a function and that never ends
- Incorrect function pointer casting

These are all I can think right now.

> > I am attempting to port a C code that runs OK on a number of Linux and Unix
> > machines to Windows XP using Visual Studio C++. I have set the program up as
[quoted text clipped - 17 lines]
> increase stack size or allocate such objects dynamically (i.e. on the
> heap).

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.