473,545 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with debugging code

I am writing code to price some financial options using recursive
functions.

It compiles but I get a runtime error which is caused by a memory
violation.

The problem is that the code is much too long to be suitable for
inclusion in this posting, and I don't know where the problem lies.

If anyone does have the time/willingness/extreme kindness to help me, I
would think that the simplest thing would be for them to get in touch
with me at pa**********@ya hoo.com

I can be reached by yahoo IM also. My yahoo ID is pauldepstein.

If anyone feels they could help me but only on a paid basis, please let
me know and we'll try and work something out.

Thank you,

Paul Epstein

Jan 5 '06 #1
4 1560

pauldepst...@at t.net wrote:
I am writing code to price some financial options using recursive
functions.

It compiles but I get a runtime error which is caused by a memory
violation.

The problem is that the code is much too long to be suitable for
inclusion in this posting, and I don't know where the problem lies.

If anyone does have the time/willingness/extreme kindness to help me, I
would think that the simplest thing would be for them to get in touch
with me at pa**********@ya hoo.com

I can be reached by yahoo IM also. My yahoo ID is pauldepstein.

If anyone feels they could help me but only on a paid basis, please let
me know and we'll try and work something out.

Thank you,

Paul Epstein


Sorry. On rereading the above posting, I see that readers would have
to go through an unnecessary second process to obtain my email address.

My email address is pauldepstein at yahoo dot com

Thanks again for your help and support.

Paul Epstein

Jan 5 '06 #2
pauldepst...@at t.net wrote:
I am writing code to price some financial options using recursive
functions.

It compiles but I get a runtime error which is caused by a memory
violation.

The problem is that the code is much too long to be suitable for
inclusion in this posting, and I don't know where the problem lies.

If anyone does have the time/willingness/extreme kindness to help me, I
would think that the simplest thing would be for them to get in touch
with me at pa**********@ya hoo.com

I can be reached by yahoo IM also. My yahoo ID is pauldepstein.

If anyone feels they could help me but only on a paid basis, please let
me know and we'll try and work something out.

Thank you,

Paul Epstein


Have you run through the program in your debugger? Can you boil it down
to a simple but complete example that demonstrates the same problem?
See this FAQ on posting code:

http://parashift.com/c++-faq-lite/ho...t.html#faq-5.8

Wild guess: you're overflowing your stack because of repeated
recursion. Try enlarging the stack size (perhaps in the project
settings if you're using an IDE, or maybe via a command line tool in
some flavor of unix).

Cheers! --M

Jan 5 '06 #3

mlimber wrote:
pauldepst...@at t.net wrote:
I am writing code to price some financial options using recursive
functions.

It compiles but I get a runtime error which is caused by a memory
violation.

The problem is that the code is much too long to be suitable for
inclusion in this posting, and I don't know where the problem lies.

If anyone does have the time/willingness/extreme kindness to help me, I
would think that the simplest thing would be for them to get in touch
with me at pa**********@ya hoo.com

I can be reached by yahoo IM also. My yahoo ID is pauldepstein.

If anyone feels they could help me but only on a paid basis, please let
me know and we'll try and work something out.

Thank you,

Paul Epstein


Have you run through the program in your debugger? Can you boil it down
to a simple but complete example that demonstrates the same problem?
See this FAQ on posting code:

http://parashift.com/c++-faq-lite/ho...t.html#faq-5.8

Wild guess: you're overflowing your stack because of repeated
recursion. Try enlarging the stack size (perhaps in the project
settings if you're using an IDE, or maybe via a command line tool in
some flavor of unix).

Cheers! --M


Thank you, M limber!

I think your "wild guess" is probably correct. Here is more info on
the code: I set a variable J using a function which is a member of the
parameters class.

I then access J in several places and inside recursive functions using
the line: int J = params_ptr->get_int("J") ;

if (!strncmp (in_string, "J", 100)) {return J; } is part of the
get_int function.

This accessing of J seems to work going through the loop a few times
but not on the sixth.

So your "guess" is very helpful.

I am very much a newbie and have no idea how to enlarge the stack size.

The IDE is dev c++. Of course, I would be happy to research the topic
of stack-size-enlarging-using-Dev-c++ independently. (I will google it
immediately after this posting.) I merely mention my ignorance of
this, by way of reply to your advice.

Thank you,

Paul Epstein

Jan 5 '06 #4
mlimber wrote:
pauldepst...@at t.net wrote:
I am writing code to price some financial options using recursive
functions.

It compiles but I get a runtime error which is caused by a memory
violation.

<snip>
Wild guess: you're overflowing your stack because of repeated
recursion. Try enlarging the stack size (perhaps in the project
settings if you're using an IDE, or maybe via a command line tool in
some flavor of unix).


....and of course, make sure that the recursion is bounded!

We should be able to see what's wrong by seeing the declaration of the
recursive function, the initial values passed to it, and anything inside
the function that modifies any of the values passed to it.

Ben Pope
--
I'm not just a number. To many, I'm known as a string...
Jan 5 '06 #5

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

Similar topics

11
3989
by: James | last post by:
My form and results are on one page. If I use : if ($Company) { $query = "Select Company, Contact From tblworking Where ID = $Company Order By Company ASC"; }
5
2348
by: Jerry Polyak | last post by:
Can someone give me a pointer, please. I am getting the following errors: Notice: Undefined index: sender_name in c:\program files\apache group\apache\htdocs\allinone_form.php on line 12 Notice: Undefined index: sender_email in c:\program files\apache group\apache\htdocs\allinone_form.php on line 14
6
7573
by: Ken Varn | last post by:
I am trying to remote debug a C# application but the debugger is reporting the following exception: An unhandled exception of type 'System.IO.FileLoadException' occurred in Unknown Module. Additional information: Unverifiable assembly 'FrameGrabber' failed policy check. The FrameGrabber assembly is a C++ managed DLL.
4
2651
by: VicVic | last post by:
Dear Great Experts, I have a problem and need your help! We have a Flat DLL built in C++ (CCC), and on top of it, we built another DLL built in C# (SSS), which has .Net Assembly. CCC was imported into SSS. Now we build applications using SSS as a reference, and we found some problems exist in CCC. From our applicatyion, We can Debug...
4
1518
by: Jason Hunt | last post by:
I'm hoping someone can help me out with using the Visual Studio IDE for debugging. I'm working on a Windows Forms application (it's an MDI if it matters), and I'm trying to fix a bug in my program. What's happening is when the program is running, it runs into an exception error and switches back to the Visio Studio screen. The problem is...
4
4775
by: Martin Odhelius | last post by:
Hello, I have a very fustrating problems while debugging ASP.NET applications. When I am debugging and stepping thru code (with F10 or F11) Visual Studio some times suddenly just stop responding and the only way get it up and running again is to kill the aspnet_wp.exe process. When the debugger hangs there is almost no CPU load, so it...
7
6945
by: yuanlinjiang | last post by:
I am working on converting a win32 console application from VC6 to VC7. My version is Microsoft Development Environment 2003 version 7.1.3088. The code works fine on VC6. it is a console program for scientific computation, so it has nothing to do with MFC. But it needs some other libraries such as MKL, sparselib, etc. VC7 can build the...
23
3174
by: keyser_Soze | last post by:
I have MS Visual Studio 2003 on Windows XP Pro. I have IIS running on this machine and I am trying to debug some existing code which has both ASP and ASP.NET components. When I try and launch the debugger from VS, I am told it can't because the project is of output type class library. The error indicates I should set the start action to...
9
2722
by: SAL | last post by:
Hello, I have a Dataset that I have table adapters in I designed using the designer (DataLayer). I have a business logic layer that immulates the DataLayer which may/may not have additional logic in. My business classes are, of course, decorated with the: <System.ComponentModel.DataObject() attribute. So, I drop a GridView on a webform...
4
2663
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi guys I'm working on a web app in VS2005 (.net 2.0.50727). All is working fine, except when I add a HTTPModule to my web.config file, as follows... <httpModules> <add name="UrlRewrite" type="UrlRewrite" /> </httpModules> If I do that, I get a really huge dialog box which basically says "Unable to
0
7415
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7675
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7440
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5997
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5344
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3451
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1902
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 we have to send another system
1
1030
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
726
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.