When a massif xtree snapshot is taken when no allocation was done,
the xtree contains no exe context.
The data structure ips_order_xecu is then szied to 0 using VG_(hintSizeXA).
m_xarray.c then allocates an empty array, while later on, a zero size
is expected to correspond to no allocated array.
Fix the problem in m_xarray.c, by not doing any allocation if the
size hint is 0.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16469
382407 vg_perf needs "--terse" command line option
382515 "Assertion 'di->have_dinfo' failed." on wine's dlls/mscoree/tests/mscoree.c
382998 xml-socket doesn't work
+383275 massif valgrind: m_xarray.c:162 (ensureSpaceXA): Assertion '!xa->arr' failed
Release 3.13.0 (15 June 2017)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vg_assert(xa->usedsizeE == 0);
vg_assert(xa->totsizeE == 0);
vg_assert(!xa->arr);
- xa->arr = xa->alloc_fn(xa->cc, n * xa->elemSzB);
- xa->totsizeE = n;
+ if (n > 0) {
+ xa->arr = xa->alloc_fn(xa->cc, n * xa->elemSzB);
+ xa->totsizeE = n;
+ }
}
static inline void ensureSpaceXA ( XArray* xa )