Mark Wielaard 1c9a0bf58a PR217695 malloc/calloc/realloc/memalign failure doesn't set errno to ENOMEM
When one of the allocation functions in vg_replace_malloc failed
they return NULL, but didn't set errno. This is slightly tricky since
errno is implementation defined and might be a macro. In the case of
glibc ernno is defined as:

  extern int *__errno_location (void) __THROW __attribute__ ((__const__));
  #define errno (*__errno_location ())

We can use the same trick as we use for __libc_freeres in
coregrind/vg_preloaded.c. Define the function as "weak". This means
it will only be defined if another library (glibc in this case)
actually provides a definition. Otherwise it will be NULL.
So we will only call it if it is defined and one of the allocation
functions failed, returned NULL.

Include a new linux only memcheck testcase, enomem.vgtest.

https://bugs.kde.org/show_bug.cgi?id=217695
2021-02-17 13:14:41 +01:00
..
2018-09-18 22:55:57 +02:00
2014-02-09 11:10:08 +00:00
2009-08-12 00:14:44 +00:00
2014-03-20 23:00:09 +00:00
2009-08-12 00:14:44 +00:00
2003-07-13 22:35:55 +00:00
2011-10-04 03:55:04 +00:00
2006-10-17 01:26:12 +00:00
2009-08-12 00:14:44 +00:00
2011-06-26 12:41:33 +00:00
2011-06-26 12:41:33 +00:00
2011-06-26 12:41:33 +00:00
2020-12-30 13:57:39 +01:00
2012-12-08 17:54:16 +00:00
2012-12-08 17:54:16 +00:00
2012-12-08 17:54:16 +00:00
2006-10-17 01:26:12 +00:00
2006-10-17 01:26:12 +00:00
2017-05-13 10:19:16 +00:00
2017-05-13 10:19:16 +00:00
2004-06-19 18:12:36 +00:00
2006-03-08 13:24:21 +00:00
2009-05-29 00:52:17 +00:00
2003-10-09 15:40:38 +00:00
2003-10-09 15:40:38 +00:00
2004-04-13 19:11:27 +00:00
2005-09-24 19:42:41 +00:00
2005-09-24 19:42:41 +00:00
2005-09-24 19:42:41 +00:00
2006-01-19 03:56:33 +00:00
2009-06-24 04:40:22 +00:00
2006-01-19 03:56:33 +00:00
2018-06-14 17:40:08 +00:00
2018-06-14 17:40:08 +00:00
2008-03-03 01:35:41 +00:00
2006-01-20 16:47:20 +00:00
2006-01-20 16:47:20 +00:00
2006-01-20 16:47:20 +00:00
2006-01-20 14:21:28 +00:00
2006-01-20 14:21:28 +00:00
2006-01-20 14:21:28 +00:00
2006-01-20 14:21:28 +00:00
2006-01-20 14:21:28 +00:00
2005-05-24 14:46:02 +00:00