This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] spurious stack-checking failures on arm-vxworks


Manually tested on arm-vxworks
Tested on i686-linux, committed on trunk.

To retrieve information on the stack area for the current task on VxWorks,
we use the taskInfoGet service and pass a pointer to a locally declared
task descriptor to fill. To offer visibility on the fields of interest for
our purposes, and for access efficieny reasons, an Ada version of the
descriptor type is locally declared as well.

The local task descriptor type layout should match what the VxWorks service
expects, and it was fine for Tornado versions up to 2.0. In Tornado 2.2, an
extra "events" field is part of the VxWorks task descriptor, and we had
not adjusted our binding declaration accordingly so were passing a pointer
to too short an object. This resulted in local frame memory clobbering with
various nasty effects, and spurious stack-checking failures as a visible
outcome.

The fix applied here consists in updating the task descriptor type to
include the missing field.

Any source program would do as a testcase, as long as it is compiled
with -fstack-check to trigger calls to the faulty run-time library routine.

2006-10-31  Olivier Hainque  <hainque@adacore.com>

	* s-stchop.ads: make this unit preelaborate. This is desirable in
	general and made mandatory by the use of this unit by s-taprop which
	is itself preelaborate.

	* s-stchop-vxworks.adb (Set_Stack_Info, Task_Descriptor type): Add
	Td_Events component.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]