sewardj | 11818b2 | 2002-03-29 04:11:48 +0000 | [diff] [blame] | 1 | |
| 2 | #if 0 |
| 3 | /* |
| 4 | Subject: valgrind glibc suppression |
| 5 | Date: Fri, 22 Mar 2002 23:54:44 -0500 (EST) |
| 6 | From: Alex Larsson <alexl@redhat.com> |
| 7 | To: jseward@acm.org |
| 8 | |
| 9 | |
| 10 | Hi. |
| 11 | |
| 12 | I'm getting a lot of errors in __stpcpy(). I think this may be a bug in |
| 13 | glibc. I didn't analyze the stpcpy asm in detail, so it might still be a |
| 14 | valgrind bug, but it's probably a glibc bug. |
| 15 | |
| 16 | Here is a test case: |
| 17 | */ |
| 18 | #endif |
| 19 | |
| 20 | #include <string.h> |
| 21 | #include <stdlib.h> |
| 22 | |
| 23 | int main() |
| 24 | { |
| 25 | char *string; |
| 26 | char buffer[10]; |
| 27 | |
| 28 | string = malloc (1); |
| 29 | string[0] = '\0'; |
| 30 | |
| 31 | stpcpy (buffer, string); |
| 32 | } |
| 33 | |
| 34 | #if 0 |
| 35 | /* |
| 36 | Gives warnings like: |
| 37 | ==10941== Use of uninitialised CPU condition code |
| 38 | ==10941== at 0x4034B9DA: __stpcpy (__stpcpy:36) |
| 39 | ==10941== by 0x402DF627: __libc_start_main (../sysdeps/generic/libc-start.c:129) |
| 40 | ==10941== by 0x80483D1: __libc_start_main@@GLIBC_2.0 (in /home/alex/other_src/valgrind-20020320/a.out) |
| 41 | ==10941== by <bogus frame pointer> ??? |
| 42 | |
| 43 | Here is the supression i use: |
| 44 | { |
| 45 | __stpcpy(Value0) |
| 46 | Value0 |
| 47 | fun:__stpcpy |
| 48 | fun:* |
| 49 | } |
| 50 | */ |
| 51 | #endif |