Message ID | 201409021028.s82ASFsk030059@ignucius.se.axis.com |
---|---|
State | New |
Headers | show |
On Sep 2, 2014, at 3:28 AM, Hans-Peter Nilsson <hans-peter.nilsson@axis.com> wrote: > In a native x86_64-linux toolchain in which > eh-table-registration is done explicitly (i.e. dl_iterate_phdr > and PT_GNU_EH_FRAME is *not* assumed, as that eliminates the > issue), the memory overhead for exception-initialization goes > beyond the 32768 bytes assumed in badalloc1.C and the test fails > for reasons not intended by the test. > Ok to commit? Ok. If someone with deeper insight into the details wants to chime in, or robustify it some more… the test strikes me as unfortunately brittle. I’d be tempted to make it the maximal size on any system (subject to smaller systems limiting it, cause they are small).
Index: g++.old-deja/g++.eh/badalloc1.C =================================================================== --- g++.old-deja/g++.eh/badalloc1.C (revision 214810) +++ g++.old-deja/g++.eh/badalloc1.C (working copy) @@ -3,7 +3,7 @@ // itself call malloc(), and will fail if there is no more // memory available. // { dg-do run { xfail { { xstormy16-*-* *-*-darwin[3-7]* } || vxworks_rtp } } } -// Copyright (C) 2000, 2002, 2003, 2010, 2012 Free Software Foundation, Inc. +// Copyright (C) 2000, 2002, 2003, 2010, 2012, 2014 Free Software Foundation, Inc. // Contributed by Nathan Sidwell 6 June 2000 <nathan@codesourcery.com> // Check we can throw a bad_alloc exception when malloc dies. @@ -23,7 +23,10 @@ const int arena_size = 256; // FreeBSD 5 now requires over 131072 bytes. const int arena_size = 262144; #else -const int arena_size = 32768; +// Because pointers make up the bulk of our exception-initialization +// allocations, we scale by the pointer size from the original +// 32-bit-systems-based estimate. +const int arena_size = 32768 * ((sizeof (void *) + 3)/4); #endif #endif