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]

PING^3 [PATCH,testsuite]gcc.dg struct-reorg prevent stack overflow and fix execution fail


Janis

In the absense of a reply from Olga, can you now approve this change?

Andy

Andy H wrote:
Olga, this is waiting on you to agree with Janis that these changes are ok.

http://gcc.gnu.org/ml/gcc-patches/2008-06/msg00822.html

Andy


Janis Johnson wrote:
On Thu, 2008-06-12 at 20:56 -0400, Andy H wrote:
The attach patch makes changes to struct-reorg.exp tests to remove test failures due to invalid test.

Test suite symbol STACK_SIZE is used to limit number of structure allocated, rather than fixed size (typically 1000) - thus avoiding stack overflow.
If STACK_SIZE if not defined, or STACK_SIZE is large enough, the existing limits are used.


A bug is removed from wo_prof_malloc_size_var.c where a random number of structures were created (0-32767) but code always modified and checked 1000 entries.
So 1 out of 32 runs would likely fail. Access is now limited to the number of structures actually created.


wo_prof_two_strs is changed to limit random number to N rather than the very odd zero..

Some but not all test omitted check of malloc return value. This is added for non-trivial allocations as a further safeguard against access violations.

XFAIL are added to some scan-ipa-dump tests which fails with AVR target.

Ok for 4.4 mainline?


2008-06-12 Andy Hutchinson <hutchinsonandy@aim.com>


* gcc.dg/struct/wo_prof_escape_substr_value.c: Limit allocation
based on STACK_SIZE.
* gcc.dg/struct/wo_prof_array_through_pointer.c: Ditto.
* gcc.dg/struct/wo_prof_escape_substr_pointer.c: Ditto.
* gcc.dg/struct/wo_prof_escape_arg_to_local.c: Limit allocation
based on STACK_SIZE. Check malloc return for NULL.
* gcc.dg/struct/w_prof_local_var.c: Ditto.
* gcc.dg/struct/wo_prof_mult_field_peeling.c: Ditto.
* gcc.dg/struct/w_prof_local_array.c: Limit allocation based on
STACK_SIZE. XFAIL AVR target.
* gcc.dg/struct/wo_prof_local_array.c: Ditto.
* gcc.dg/struct/w_prof_two_strs.c: Limit allocation based on
STACK_SIZE. Limit random size to N.
* gcc.dg/struct/wo_prof_two_strs.c: Limit allocation based on
STACK_SIZE. XFAIL AVR target. Limit random size to N.
* gcc.dg/struct/w_prof_single_str_global.c: XFAIL AVR target.
* gcc.dg/struct/wo_prof_array_field.c: Ditto.
* gcc.dg/struct/wo_prof_double_malloc.c: Ditto.
* gcc.dg/struct/wo_prof_global_array.c: Ditto.
* gcc.dg/struct/wo_prof_single_str_global.c: Ditto.
* gcc.dg/struct/wo_prof_single_str_local.c: Ditto.
* gcc.dg/struct/w_prof_global_var.c: Limit allocation based on
STACK_SIZE. Check malloc return for NULL. XFAIL AVR target.
* gcc.dg/struct/wo_prof_global_var.c: Ditto.
* gcc.dg/struct/wo_prof_local_var.c: Ditto.
* gcc.dg/struct/wo_prof_malloc_size_var.c: Access only allocated
space. Limit allocation based on STACK_SIZE. XFAIL AVR target.

Olga wrote these tests, so I'd like her to comment on the changes in case they change what's being tested; the changes look OK to me.

Janis






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