unmapped memory exception, only when debugger running fast

unmapped memory exception, only when debugger running fast

Post by Jazz Fa » Mon, 26 Nov 2001 12:09:51



Hi, I am using Codewarrior 3.2 and have the following snippet (with
problem line marked):

cout << atof(item) << endl;
this->fltArys[this->fltReadPtr].fAryData[ptr1] = atof(item);     <--
             // put it into the string array holder itself, next slot
fltArys[this->fltReadPtr].lngthPtr++;                      
            // record new length of this float column

The simple program opens a file containing columns of string or integer
data, and puts each column in an array.

I can open the project, and run it ad infinitum with no problem is the
de* is turned off.

But, if I have the de* enabled, and start the debug, when it gets
to the marked line in the above snippet it gives "unmapped memory
exception."  If I dismiss the error dialogue and press command-r to try
to continue running it gives the same error and the cursor stays at the
problematic line.

BUT, if I put a break point at the line before the problem line, then
run the program then step through the line, it works just fine.  Any
ideas what's going on?

Thanks

-J

 
 
 

unmapped memory exception, only when debugger running fast

Post by Chris Co » Tue, 27 Nov 2001 11:17:21


I'd place money on an unitialized variable or array index.

Chris

In article


> Hi, I am using Codewarrior 3.2 and have the following snippet (with
> problem line marked):

> cout << atof(item) << endl;
> this->fltArys[this->fltReadPtr].fAryData[ptr1] = atof(item);     <--
>              // put it into the string array holder itself, next slot
> fltArys[this->fltReadPtr].lngthPtr++;                      
>             // record new length of this float column

> The simple program opens a file containing columns of string or integer
> data, and puts each column in an array.

> I can open the project, and run it ad infinitum with no problem is the
> de* is turned off.

> But, if I have the de* enabled, and start the debug, when it gets
> to the marked line in the above snippet it gives "unmapped memory
> exception."  If I dismiss the error dialogue and press command-r to try
> to continue running it gives the same error and the cursor stays at the
> problematic line.

> BUT, if I put a break point at the line before the problem line, then
> run the program then step through the line, it works just fine.  Any
> ideas what's going on?

> Thanks

> -J


 
 
 

unmapped memory exception, only when debugger running fast

Post by MWRo » Wed, 28 Nov 2001 03:11:59


In article


Quote:>Hi, I am using Codewarrior 3.2 and have the following snippet (with
>problem line marked):

I'd update to the 3.3  IDE you can download it from
http://www.veryComputer.com/;
search under CodeWarrior 4.

It is not uncommon for the de* to modify memory in a way that a bug
is apparent while using it that is not apparent while not debugging.  
(And sometimes the other way around).    I'd check the usual  items.  

One thing that is common when using SIOUX for output is that the
programmer will also initialize the toolbox  or use a Mac call and fail
to initialize the toolbox  and use a Mac call before the SIOUX output.

It is hard to guess but it looks to me like one thing to check in this
code is have you allocated the array where the assignment is being use.

Ron

Quote:

>cout << atof(item) << endl;
>this->fltArys[this->fltReadPtr].fAryData[ptr1] = atof(item);     <--
>             // put it into the string array holder itself, next slot
>fltArys[this->fltReadPtr].lngthPtr++;                      
>            // record new length of this float column

>The simple program opens a file containing columns of string or integer
>data, and puts each column in an array.

>I can open the project, and run it ad infinitum with no problem is the
>de* is turned off.

>But, if I have the de* enabled, and start the debug, when it gets
>to the marked line in the above snippet it gives "unmapped memory
>exception."  If I dismiss the error dialogue and press command-r to try
>to continue running it gives the same error and the cursor stays at the
>problematic line.

>BUT, if I put a break point at the line before the problem line, then
>run the program then step through the line, it works just fine.  Any
>ideas what's going on?

>Thanks

>-J

--
            GeekWare !!!
http://www.veryComputer.com/


 
 
 

unmapped memory exception, only when debugger running fast

Post by David » Wed, 28 Nov 2001 05:04:15


Are you using Handles for any storage? Make sure they are locked
before dereferencing. I had a similar bug where a seemingly unrelated
piece of code caused the bug to show itself. Very difficult to find.

-Dave


> Hi, I am using Codewarrior 3.2 and have the following snippet (with
> problem line marked):

> cout << atof(item) << endl;
> this->fltArys[this->fltReadPtr].fAryData[ptr1] = atof(item);     <--
>              // put it into the string array holder itself, next slot
> fltArys[this->fltReadPtr].lngthPtr++;                      
>             // record new length of this float column

> The simple program opens a file containing columns of string or integer
> data, and puts each column in an array.

> I can open the project, and run it ad infinitum with no problem is the
> de* is turned off.

> But, if I have the de* enabled, and start the debug, when it gets
> to the marked line in the above snippet it gives "unmapped memory
> exception."  If I dismiss the error dialogue and press command-r to try
> to continue running it gives the same error and the cursor stays at the
> problematic line.

> BUT, if I put a break point at the line before the problem line, then
> run the program then step through the line, it works just fine.  Any
> ideas what's going on?

> Thanks

> -J

 
 
 

1. why is this code causing an unmapped memory exception?

Hi everybody,

I try to change the text in an LCaption object, but the command
SetDescriptor doesn't do what I want it to do. Any idea?

      LStr255 theString;
      LCaption* theCaption = (LCaption*)mWindow->FindPaneByID(
growth_Rate_interval );
      theString.Assign( 4.5,FLOATDECIMAL,8);
      theCaption->SetDescriptor((ConstStringPtr ) theString);

mWindow is the global window variable, growth_Rate_interval is a constant
with the LCaption ID. Everytime the debugger tries to digest this line it
says there is an unmapped memory expception and stops.
Actually I tried to adapt the example from the PP book about Controls
(chapter 8), where in the lower right corner an LCaption displays the last
message.

Thanks a lot, Christian.

--
Christian Jost, Universit Paris-Sud XI, Orsay, France

2. Silly-question

3. Unmapped memory exception occurs when calling one method, but not the other

4. CD-Drives in A4000 Desktop

5. JAVA 1.0.2 VM - Unmapped Memory Exceptions - STILL

6. irix 6.2 memory usage

7. Unmapped Memory Exception

8. Substitution Webbot

9. Possible causes of Unmapped Memory Exceptions?

10. unmapped memory exception

11. unmapped memory exception?

12. ERROR: unmapped memory exception

13. Unmapped memory exception w. no local variables