code fails if made with debug

Jerry Needell jerry.needell at unh.edu
Thu Mar 7 16:02:32 UTC 2002


I seem to be making progress - I looked at the way the Makefile was set
up and found that even when using Make debug - the optimization level
was set to -O4.
I fixed this so the optimiztion level is O0. What I now find is that the
debug version still fails, but in a more controlled fashion. It gets int
Init and everything seems to be fine until I try to delete the Init task
when I get an memory alignment error while it is trying to free Heap
space. I shsupect this is a red-herring and that what it really
happening is the code running out of memory somewhere. It looks to me
like the code returns improperly from _Heap_Free, then dies. The
non-debug version works fine. In both cases , the application code is
compiled without optimization, so the problem seems to lie with one of
the non-optimized libraries. 
  I am very uncomfortable with my grasp of the resource allocation
aspects of RTEMS ( I sure hope the April class has enought subscribers
to happen!!) In particular, Is there some CONFIGURE setting that I
should be altering for the debug case? 


- Jerry

Joel Sherrill wrote:
> 
> Jerry Needell wrote:
> >
> > As Joel suggests, this is probably a resource issue. Unfortunately the
> > program is halting before it can call the Internal_error_Occurred
> > routing. I "think" it is a stack issue. Now my question. What is the
> > best way to add resources. I see that in the BSP start.S code the
> > constant STACK_SIZE is set to 16 * 1024. Is this the best pace to make a
> > change or is there some more configurable place in the RTEMS confdefs
> > that I should be concentrating on.
> 
> You mentioned offlist that it looked to be dying in the init thread
> before calling the C++ constructors.  This tends to indicate to me
> that a spurious interrupt is occuring since this interrupts are
> enabled at the first context switch.  This could be explained by
> HW init code that is compiled differently at low optimizations
> and is touching the hardware wrong.
> 
> > - Jerry
> >
> > Joel Sherrill wrote:
> > >
> > > Jerry Needell wrote:
> > > >
> > > > I am pulling whats left of my hair out tring to track this down. Perhaps
> > > > someone can point me in the right direction. I am using the RTEMS 4.5.1
> > > > pre3 relaease on an ERC32 (actually TSC695) board. I have built the
> > > > "normal" and VARIANT=debug versions. I am testing an application using
> > > > the o-optimize (make) and the o-debug (make debug) versions. The
> > > > o-optimize version works fine but the o-debug version crashes (processor
> > > > halts) before it even gets to Init. Does anyone have an idea where to
> > > > look for the cause.
> > >
> > > Set a breakpoint at _Internal_error_Occurred and see where it came from.
> > > I suspect a resource problem.
> > >
> > > >    This application is fairly simple. It consists of 3 very simple tasks
> > > > and on ISR. I can supply lots more gory details, but I thought I'd see
> > > > if anyone had quick response.
> > > >
> > > > BTW - I have had no problem using the make debug generated code on other
> > > > test applications so the problem is not always there for the debug
> > > > generated code.
> > > > - Thanks for any tips - Jerry
> > > > --
> > > > _______________________________________________________________________
> > > > Jerry Needell                     | Internet: jerry.needell at unh.edu
> > > > Space Science Center/Morse Hall   | Voice: (603) 862 2732
> > > > University Of New Hampshire       | FAX:   (603) 862 0311
> > > > Durham, NH 03824                  |
> > >
> > > --
> > > Joel Sherrill, Ph.D.             Director of Research & Development
> > > joel at OARcorp.com                 On-Line Applications Research
> > > Ask me about RTEMS: a free RTOS  Huntsville AL 35805
> > > Support Available                (256) 722-9985
> >
> > --
> > _______________________________________________________________________
> > Jerry Needell                     | Internet: jerry.needell at unh.edu
> > Space Science Center/Morse Hall   | Voice: (603) 862 2732
> > University Of New Hampshire       | FAX:   (603) 862 0311
> > Durham, NH 03824                  |
> 
> --
> Joel Sherrill, Ph.D.             Director of Research & Development
> joel at OARcorp.com                 On-Line Applications Research
> Ask me about RTEMS: a free RTOS  Huntsville AL 35805
>    Support Available             (256) 722-9985

-- 
_______________________________________________________________________
Jerry Needell                     | Internet: jerry.needell at unh.edu
Space Science Center/Morse Hall   | Voice: (603) 862 2732
University Of New Hampshire       | FAX:   (603) 862 0311
Durham, NH 03824                  |



More information about the users mailing list