Possible problem with stackcheck function? SS-20021007

Joel Sherrill joel.sherrill at OARcorp.com
Mon Oct 28 22:50:47 UTC 2002



Bob Wisdom wrote:
> 
> Hi all,
> 
> The Background: I am building for gen68360 BSP using ss-20021007. I think I
> am
> having resource allocation problems with RTEMS, - I get infrequent
> unexplained bus errors / crashes, and am therefore trying to exactly
> determine the runtime resource utilisation as a first check.
> 
> The Problem: Trying to find the cause, I switched on the Stack-Dump build
> option
> and found that its printout failed with an bus error, thinking of course
> this was my resource problem showing itself, I was surprised to find that
> there seems to be a bug in the code in the function
> Stack_check_Dump_threads_usage in the file check.c in the libmisc/stackcheck
> directory:
> 
> u32_name = *(unsigned32 *)the_thread->Object.name;  <-- the extra
> indirection seems the cause.
> 
> u32_name = (unsigned32 *)the_thread->Object.name;  <-- this seems to work ok
> 
> (...well mostly, the first line seems to still get a bad task name, it
> doesn't crash the system though :-)).

That's the fix I merged from Fabrizio Pirovano
<pirovano.thysys at tiscalinet.it>.
See http://www.oarcorp.com/cgi-bin/cvsweb.cgi/rtems/c/src/libmisc/
for the changes from this recent ChangeLog entry:

2002-10-24      Fabrizio Pirovano <pirovano.thysys at tiscalinet.it>

        * capture/capture.c, monitor/mon-manager.c, stackchk/check.c:
        Patch to remove problems introduced by object name rework.

An RTEMS task name is usually 4 ASCII characters pushed together unto an
unsigned32.

> I can not be certain of course if I have done something stupid in building
> my task names and tables, so it would be good if someone could check to see
> if the stackdump problem is really there, or if its me being stupid.
> Incidentally there seems to be a lot of work-in-progress in this file.

It kind of always will be since it has to be tailored to each CPU.  But
if
you have corrections, it is open source, feel free to submit them.

> I also still get a bus-error crash if I use the "task" command in the RTEMS
> monitor program, is this related maybe?

It could be the mon-manager.c fixFabrizio made.

> One final question, is there a runtime function available to use which can
> display all the memory resources known to the kernel so I can easily
> validate my configuration, heaps, stacks, tasks etc?

You can run the spsize program which prints out the formula.

> Regards to all RTEMS users.
> Bob Wisdom (U.K.)

-- 
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



More information about the users mailing list