Any known compiler issues for CPU32? (stack corruption problem)

Matthew J Fletcher amimjf at connectfree.co.uk
Wed Feb 27 23:52:25 UTC 2002


On Wednesday 27 Feb 2002 6:51 pm, Mike Panetta wrote:
> Are there any known compiler issues when generating CPU32 code with the
> rtems binutils-2.11.2-1 or the rtems gcc2.95.3newlib1.9.0-3?  I am
> getting stack corruption on one machine, that I am not on another, both
> m68k, but one is 68030 and the other is 68332 based.  I do not think the
> corruption is occuring in BSP specific code, and since the RTEMS main
> code works on one machine and not the other, I am beginning to suspect
> the compiler.  So if anyone has had problems with the above compiler on
> a CPU32 based machine, or just know (because they are intimate with the
> compiler) that there are bugs with it for CPU32, please tell me :)  If
> anyone has an idea on how I could track down this stack corruption
> problem, I would love that kind of info too :)

i might be stupid here, but your not trying to run 68332 (i.e cpu32), code
on the not-totaly-cpu32, 68030 are you ?,.. i doubt it but what the hell,..

ok, when i was developing on 68331's we never had these problems but
we did patch gcc 2.95.3 with a special inturrupt patch that fixed problems,
with restoring regiesters (like stack pointers), after a context switch,.

here is the link,..

http://sources.redhat.com/ml/crossgcc/2000-q1/msg00304.html

> So far, all I know, is somewhere before the code gets to Init() (in
> hello sample) the stack gets messed so bad that the stack pointer is
> pointing to an address over 5000 bytes above the top of the stack!  

ok, so thats before inturrupts have even been enabled (i think), so its
probably not the above.

>In
> addition the frame pointer has been set to 0 (is that ok?). Its fine at
> boot_card(), and its fine at console_initialize() (a bsp specific
> routine in this case), but between console_initialize() and Init() it
> goes south.  I have stepped through all the code in console_initialize,
> and the stack seems fine in there too. Maybe this is just me not quite
> understanding how RTEMS initializes the stack for a process...  I do
> know, that if I let the program run without any breakpoints, it goes
> wild and overwrites itself...  Isn't that generally an indication of
> stack corruption?

is something just blowing the stack ?, do you have enough configured
is trickey to really work out how much you need, but doubleing it is
a good idea. 

i also seem to remember (but cant be sure), that rtems is running in 
priverlaged mode at this point, is it possible that come code is stomping
the stack pointer ? - ive seen stranger.

regards

---
Matthew J Fletcher		amimjf at connectfree.co.uk
Software Engineering		Matthew.Fletcher at student.shu.ac.uk
www.amimjf.org			ICQ amimjf 44193496
---
kickass.amimjf.org 2.4.17-20mdk #1 Wed Feb 20 20:45:19 CET 2002
---
Inadmissible:  Not competent to be considered.  Said of certain kinds of
testimony which juries are supposed to be unfit to be entrusted with,
and which judges, therefore, rule out, even of proceedings before themselves
alone.  Hearsay evidence is inadmissible because the person quoted was
unsworn and is not before the court for examination; yet most momentous 
actions, military, political, commercial and of every other kind, are
daily undertaken on hearsay evidence.  There is no religion in the world
that has any other basis than hearsay evidence.  Revelation is hearsay
evidence; that the Scriptures are the word of God we have only the
testimony of men long dead whose identy is not clearly established and
who are not known to have been sworn in any sense.  Under the rules of
evidence as they now exist in this country, no single assertion in the
Bible has in its support any evidence admissible in a court of law...

But as records of courts of justice are admissible, it can easily be proved
that powerful and malevolent magicians once existed and were a scourge to
mankind.  The evidence (including confession) upon which certain women
were convicted of witchcraft and executed was without a flaw; it is still
unimpeachable.  The judges' decisions based on it were sound in logic and
in law.  Nothing in any existing court was ever more thoroughly proved than
the charges of witchcraft and sorcery for which so many suffered death.
If there were no witches, human testimony and human reason are alike
destitute of value.  --Ambrose Bierce




More information about the users mailing list