1 2004-06-04 Per Bothner <per@bothner.com>
3 * configure.in (LIBMUDFLAPTH): Fix thinko.
5 * configure.in: Check for more headers.
6 * mf-hooks2.c: Conditionalize on HAVE_SYS_SOCKET_H etc.
8 * mf-runtime.c: In two places conditionalize on SIUSR1 rather than
9 HAVE_SIGNAL as mingw has signal.h but not SIUSR1.
11 2004-06-01 Andreas Jaeger <aj@suse.de>
13 * configure.in: Handle multilibs, support
14 --enable-version-specific-runtime-libs.
15 * Makefile.am (lib_LTLIBRARIES): Rename to ...
16 (toolexeclib_LTLIBRARIES): this for multilib support.
17 * Makefile.in: Regenerated.
18 * configure: Regenerated.
19 * aclocal.m4: Regenerated.
20 * config.h.in: Regenerated.
21 * testsuite/Makefile.in: Regenerated.
23 2004-06-01 Andreas Jaeger <aj@suse.de>
25 * testsuite/lib/libmudflap.exp (libmudflap-init): Handle
26 multilibs, using multilib directory instead of hardcoded path.
29 2004-05-21 Frank Ch. Eigler <fche@redhat.com>
31 * Makefile.am (AM_MAKEFLAGS): Pass RUNTESTFLAGS.
34 2004-05-18 Kaz Kojima <kkojima@gcc.gnu.org>
36 * acinclude.m4 (lt_cv_deplibs_check_method): Use pass_all on sh*.
37 * aclocal.m4, configure: Rebuilt.
39 2004-05-17 Frank Ch. Eigler <fche@redhat.com>
41 * lib/libmudflap.exp (libmudflap-init): For C++ test cases only,
42 import some build settings from libstdc++-v3 testsuite_flags.
43 * .../cfrags.exp, .../c++frags.exp, .../cthfrags.exp: Corresponding
44 changes to pass test language.
46 * mf-runtime.c (__mfu_check): Poison the cache with antidote for
47 quicker mode-nop handling.
49 2004-03-25 Frank Ch. Eigler <fche@redhat.com>
51 * mf-impl.h: Added libgcc license header.
53 2004-03-20 Frank Ch. Eigler <fche@redhat.com>
55 * mf-hooks[123].c, mf-runtime.c, mf-heuristics.c:
56 Added libgcc license header.
57 * mf-hooks3.c (__mf_0fn_pthread_create): Correct arg constness.
58 (pthread_create): Simplify stack allocation syntax.
60 2004-03-08 Loren J. Rittle <ljrittle@acm.org>
62 * mf-hooks2.c: Support FreeBSD.
63 (WRAP_gets): Avoid gets().
64 * testsuite/libmudflap.c/pass-stratcliff.c: Do not
65 test unimplemented mem/str calls on FreeBSD.
66 * testsuite/libmudflap.c/pass21-frag.c: Do not include
67 <alloca.h> on FreeBSD.
69 2004-01-30 Frank Ch. Eigler <fche@redhat.com>
71 * testsuite/libmudflap.c/pass36-frag.c: Add missing free() call.
72 * testsuite/libmudflap.c/pass46-frag.c: New test for -fmudflapir.
73 * testsuite/libmudflap.cth/cthfrags.exp: Add -DSTATIC to compiler
74 flags for static linking permutation.
75 * testsuite/libmudflap.cth/pass40-frag.c: When -DSTATIC, avoid
76 some pthreads code that croaks on linux glibc tls.
78 2004-01-27 Frank Ch. Eigler <fche@redhat.com>
80 * testsuite/libmudflap.c/fail31-frag.c, pass45-frag.c: New tests.
82 2004-01-15 Frank Ch. Eigler <fche@redhat.com>
84 * testsuite/libmudflap.c/pass44-frag.c: New test.
86 2004-01-12 Frank Ch. Eigler <fche@redhat.com>
88 * testsuite/libmudflap.c/fail{28,29,30}-frag.c: New tests.
90 2004-01-08 Frank Ch. Eigler <fche@redhat.com>
92 * testsuite/libmudflap.c/pass43-frag.c: Added missing program rc.
94 2003-12-11 Frank Ch. Eigler <fche@redhat.com>
96 * testsuite/libmudflap.c/pass42-frag.c, pass43-frag.c: New tests.
98 2003-12-08 Andrew Pinski <pinskia@physics.uc.edu>
101 * configure.in: Add check for see if
102 socklen_t typedef is in sys/socket.h.
103 * mf-hooks1.c: Add define if socklen_t
105 * mf-hooks2.c: Likewise.
106 * mf-hooks3.c: Likewise.
107 * config.h.in: Regen.
110 2003-12-08 Frank Ch. Eigler <fche@redhat.com>
112 * mf-runtime.c (__mf_watch_or_not): Tweak tracing message.
113 * testsuite/libmudflap.c/fail21-frag.c: Defeat aliasing
115 * testsuite/libmudflap.c/pass25-frag.c: Ditto.
116 * testsuite/libmudflap.c/pass26-frag.c: Tolerate non-overlapping
117 (unoptimized) allocation of stack space.
119 2003-12-07 Richard Henderson <rth@redhat.com>
121 * testsuite/libmudflap.c/fail23-frag.c (main): Adjust addend to 11.
122 * testsuite/libmudflap.c/fail27-frag.c (foo): Mark noinline.
124 2003-12-06 Andrew Pinski <apinski@apple.com>
126 partial PR libmudflap/12670
127 * mf-hooks1.c: Respect Darwin checks. Conditionalize POSIX_SOURCE.
128 * mf-hooks2.c: Likewise.
129 * mf-hooks3.c: Likewise.
131 2003-11-19 Frank Ch. Eigler <fche@redhat.com>
134 * mf-runtime.h.in: Switch to #pragma redefine_extname for
135 symbols interposed at compile time.
136 * testsuite/libmudflap.c++/pass41-frag.cxx: New test.
139 * mf-hooks2.c (semctl): Tolerate FreeBSD.
141 * configure.in: Reorganize check for <pthread.h>.
142 * configure: Regenerated.
144 2003-11-04 David Edelsohn <edelsohn@gnu.org>
146 * mf-runtime.c (_ALL_SOURCE): Define for AIX.
147 (_LARGE_FILE_API): Define for AIX.
148 * mf-hooks[123]: Same.
149 (_XOPEN_SOURCE_EXTENDED): Define to 1 for AIX.
151 2003-10-21 David Edelsohn <edelsohn@gnu.org>
153 * mf-runtime.c (_XOPEN_SOURCE_EXTENDED): Define to 1 for AIX.
155 2003-07-29 Frank Ch. Eigler <fche@redhat.com>
157 2003-07-29 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
159 * configure.in: Update check for union semun.
161 2003-07-29 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
164 * mf-hooks2.c [WRAP_semctl]: Fix check for HAVE_UNION_SEMUN.
166 2003-07-29 Frank Ch. Eigler <fche@redhat.com>
169 * configure.in: Add checks for 64-bit LFS functions, struct semun
170 definition, for BSD compatibility.
171 * mf-hooks1.c: Respect BSD checks. Conditionalize POSIX_SOURCE.
172 * mf-hooks2.c: Ditto. Include <strings.h> for bcmp* decls.
173 * mf-hooks3.c: Ditto.
174 (pthread_create): Try MAP_ANON on platforms without the MAP_ANONYMOUS
176 * configure, config.h.in: Regenerated.
178 2003-07-23 Frank Ch. Eigler <fche@redhat.com>
180 Multithreading fixes:
181 * mf-runtime.c (__mf_object): Store allocating/deallocating
183 (options): Support new "-thread-stack" option.
184 Rename "-heur-argv-environ" option to "-heur-stdlib".
185 Disable "-lc-mask" and "-lc-shift" options.
186 (__mf_dynamic): Add function pointers for pthread_join/_exit.
187 (__assert_fail): New self-contained function for glibc.
188 * mf-hooks3.c: Essentially rewritten, particularly related to
189 use of __mf_pthread_info array.
190 (pthread_join, _exit): New hook functions.
191 * mf-impl.h (BEGIN_PROTECT): Handle starting_p case.
192 * testsuite/libmudflap.cth/pass40-frag.c: New test.
195 * mf-heuristics.c: Add type casts for tracing, sub calls.
196 * mf-impl.h (BEGIN_PROTECT): Redefine to omit result type.
197 Update all callers to declare explicit result holder.
198 (END_PROTECT): Removed.
199 * testsuite/*/*frags.exp: Clean up default MUDFLAP_OPTIONS.
201 2003-07-15 Diego Novillo <dnovillo@redhat.com>
203 * testsuite/libmudflap.c/fail21-frag.c: Add volatile modifiers.
204 * testsuite/libmudflap.c/fail15-frag.c: Likewise.
205 * testsuite/libmudflap.c/fail13-frag.c: Likewise.
207 2003-07-04 Frank Ch. Eigler <fche@redhat.com>
209 * mf-hooks1.c, 2.c, 3.c: New file, splits up content from old ...
211 * mf-impl.h (MF_VALIDATE_EXTENT, BEGIN_PROTECT, END_PROTECT):
212 Move these macros from old mf-hooks.c here.
213 * Makefile.am: Adapt to split-up hook sources for faster builds.
214 * Makefile.in: Regenerated.
216 * mf-heuristics.c: Remove #if-0 block.
218 * mf-impl.h (__mf_state): Reorganize declaration and implementation.
219 (__mf_starting_p): New state only for use while dlsym bootstrapping.
220 (CALL_REAL, __mf_init): Corresponding changes.
221 (TRACE, VERBOSE_TRACE): Include thread id and "mf:" prefix. Update
222 all callers to remove redundant "mf:" prefix.
223 * mf-runtime.h.in: #define a few reentrancy macros for libmudflapth.
224 * mf-hooks3.c: Rewrite chunks to support per-thread __mf_state value.
225 (__mf_pthread_info): Become a hash table.
227 * testsuite/lib/mfdg.exp: Support new "dg-timeout" and
228 "dg-repetitions" directives to control test case execution.
229 * testsuite/libmudflap.cth/pass37-frag.c: Add timeout and repeat
231 * testsuite/libmudflap.cth/pass39-frag.c: Ditto for this new test.
233 2003-06-25 Frank Ch. Eigler <fche@redhat.com>
235 * mf-hooks.c (alloca): Separate into stub.
236 (__mf_wrap_alloca_indirect): New function. Use CALL_REAL
237 malloc/free for alloca blocks.
238 (pthread_create): Tolerate failing pthread_attr_get* calls.
239 * mf-runtime.c (__mf_fini): Call __mf_wrap_alloca_indirect.
240 * mf-impl.h (CALL_WRAP): Remove macro.
241 * testsuite/libmudflap.c/pass21-frag.c: Include <alloca.h>.
242 * testsuite/libmudflap.c/pass23-frag.c: Include more struct
243 padding for ia64 BIT_FIELD_REF constructs.
245 2003-06-19 Frank Ch. Eigler <fche@redhat.com>
247 * mf-hooks.c (struct pthread_info): Add "thread_errno" field.
248 (__mf_pthread_spawner, __mf_pthread_cleanup): Use it with GUESS
249 libmudflap object type.
250 * mf-runtime.c (__mfu_unregister): Correct cemetary logic to avoid
251 crashes on unregistering STATIC objects.
253 2003-06-17 Frank Ch. Eigler <fche@redhat.com>
255 Based on patch from Eyal Lebedinsky <eyal@eyal.emu.id.au>:
256 * mf-hooks.c (__mf_pthread_spawner): Register thread errno.
257 (time, strerror, fopen, fopen64, fclose, fread): New hooks.
258 (fwrite, fgetc, fgets, getc, gets, ungetc, fputc): New hooks.
259 (fputs, putc, puts, clearerr, feof, ferror, fileno): New hooks.
260 (printf, fprintf, sprintf, snprintf, vprintf, vfprintf): New hooks.
261 (vsprintf, vsnprintf, access, remove, fflush, fseek): New hooks.
262 (fseeko64, ftell, ftello64, rewind, fgetpos, fsetpos): New hooks.
263 (stat, stat64, fstat, lstat, mkfifo, setvbuf, setbuf): New hooks.
264 (setvbuf, opendir, closedir, readdir, recv, recvfrom): New hooks.
265 (recvmsg, send, sendto, sendmsg, setsockopt, getsockopt): New hooks.
266 (accept, bind, connect, gethostname, sethostname): New hooks.
267 (gethostbyname, wait, waitpid, popen, pclose, execve): New hooks.
268 (execv, execvp, system, dlopen, dlclose, dlerror, dlsym): New hooks.
269 (semop, semctl, shmctl, shmat, shmdt): New hooks.
270 * mf-runtime.h.in: Corresponding changes.
271 * mf-runtime.c (__mf_ini): Register stdio objects. Use STATIC type.
272 (opts) Rename heur_argv_environ to heur_std_data.
273 (__mf_wrap_main): Use STATIC type for argv/environ strings.
274 * Makefile.am: Corresponding changes.
275 * Makefile.in: Regenerated.
277 2003-06-11 Frank Ch. Eigler <fche@redhat.com>
279 * mf-heuristics.c (__mf_heuristic_check): Disable stack_bounds
280 heuristic for threaded case, and for non-x86-linux targets.
281 * mf-hooks.c (__mf_0fn_calloc): Provide a working dummy implementation
282 for use during pre-main() program startup.
283 (__mf_0fn_*): Make these functions non-static.
284 * mf-impl.h (DECLARE, CALL_REAL): Support calls to 0fn backup hook
286 * mf-runtime.c (__mf_state): Set initial state to "starting".
287 (__mf_resolve_single_dynamic): Tolerate repeated calls for same symbol.
288 (__wrap_main): New function to register argv[] and environ[] strings.
290 (*): In all trace functions, use "%p" as formatter for uintptr_t.
292 * testsuite/libmudflap.c/pass38-frag.c: New test case.
293 * testsuite/libmudflap.cth/pass37-frag.c: Improved test.
295 * acinclude.m4: Add comments with aoliva's concerns about x86_64
297 * aclocal.m4, configure: Regenerated.
299 2003-06-04 Frank Ch. Eigler <fche@redhat.com>
301 * acinclude.m4: Correct typo in AC_MSG_CHECKING.
302 * aclocal.m4, configure: Regenerated.
304 2003-06-03 Frank Ch. Eigler <fche@redhat.com>
306 * acinclude.m4: Force "pass_all" deplibs_check_method for libtool
307 for x86_64 target. Disable caching for this value.
308 * aclocal.m4, configure: Regenerated.
310 2003-06-02 Frank Ch. Eigler <fche@redhat.com>
312 * testsuite/libmudflap.c/pass38-frag.c: Deleted. -fwritable-strings
313 is about to become deprecated, and its present handling bugs are
316 2003-05-30 Frank Ch. Eigler <fche@redhat.com>
318 * testsuite/libmudflap.c/pass38-frag.c: New test for
321 2003-05-23 Frank Ch. Eigler <fche@redhat.com>
323 * mf-runtime.c (__mf_sigusr1_handle): Call unlocked variant of
324 __mf_report, asserting reentrant calling context.
326 2003-05-23 Frank Ch. Eigler <fche@redhat.com>
328 * mf-hooks.c (realloc): Correct reentrancy logic.
329 * testsuite/libmudflap.c/hook-allocstuff.c: New test case.
331 2003-05-20 Frank Ch. Eigler <fche@redhat.com>
333 * mf-hooks.c (LIBMUDFLAPTH_THREADS_MAX): New macro, replaces
334 PTHREAD_THREADS_MAX. Update users.
335 * mf-runtime.c (__mf_usage): Print [active] instead of [default]
337 * testsuite/Makefile.am (all-local): Prime dejagnu site.exp file
338 with libmudflapth presence indicator.
339 * testsuite/Makefile.in: Regenerated.
341 2003-05-16 Frank Ch. Eigler <fche@redhat.com>
343 * Makefile.am (AM_CFLAGS): Remove "-ansi".
344 * configure.in: Remove silly no-pthreads => no-shared logic.
345 * Makefile.in, configure: Regenerated.
346 * mf-heuristics.c (__mf_heuristic_check): Remove reentrancy hacks.
347 * mf-hooks.c (BEGIN_PROTECT, END_PROTECT): Reorganize reentrancy
348 code. Count reentrancy events.
349 (all hook functions): Don't directly manipulate __mf_state variable.
350 Add TRACE calls to hook functions without them.
351 * mf-impl.h (LOCKTH): Try to count lock contention events.
352 (VERBOSE_TRACE, TRACE): Remove reentrancy hacks.
353 * mf-runtime.c (BEGIN_RECURSION_PROTECT, END_RECURSION_PROTECT):
354 Reorganize reentrancy code.
355 (external __mf_ entry points): Use RECURSION_PROTECT mechanism to
356 identify reentrancy with mutex holding times.
357 (internal __mfu_ entry points): Remove internal reentrancy code.
358 (__mf_init): Use ordinary locked calls.
359 (__mfu_report): Print the two new counts.
360 * testsuite/lib/libmudflap.exp: Filter out junk ld/pthreads messages.
361 * testsuite/libmudfap.cth/cthfrags.exp: New test driver.
362 * testsuite/libmudflap.cth/pass37-frag.c: New pthreads test.
363 * testsuite/libmudfap.cth/cfrags.exp: Adapt to new libmudflap
366 2003-05-09 Frank Ch. Eigler <fche@redhat.com>
368 * configure.in: Add pthread support, plus glibc and porting hacks.
369 * Makefile.am (LIBMUDFLAPTH): New conditional, to build -lmudflapth
370 from objects built into ./pth/.
371 * mf-runtime.c (__mfu_watch,register,...): Fork new unlocked
372 functions for internal entry points. Update callers to pick
373 locked vs. unlocked variants.
374 (__mf_resolve_single_dynamic): Extend to support symbol versioning
375 info coming in from a static data structure.
376 (*): Reorder miscellaneous declarations to group data vs functions.
377 (__mf_set_default_options): Simplify.
378 (__mf_usage): Mention threading status of host executable.
379 * mf-impl.h: Move max/min decls here. Reorganize __mf_dynamic
380 decls to match above.
381 (LOCKTH, UNLOCKTH): New macros for Big Libmudflap Lock management.
382 * mf-heuristics.c: Choose between locked/unlocked calls. Add
383 some lock/unlock markers. Remove some unused code.
385 (pthread_create): New hook function.
386 (__mf_pthread_cleanup, _spawner): New helper functions.
387 * configure. aclocal.m4, config.h.in, Makefile.in: Regenerated.
389 2003-05-02 Frank Ch. Eigler <fche@redhat.com>
391 * testsuite/libmudflap.c/fail27-frag.c: Add more volatile flags.
393 2002-04-28 Frank Ch. Eigler <fche@redhat.com>
395 * Makefile.am (HOOKOBJS): Add *time related hooks.
396 * configure.in: Look for pthreads.h header.
397 * mf-hooks.c (asctime, ctime, gmtime, localtime): New wrappers.
398 * mf-runtime.c: Begin sketching some pthreads support.
399 (__mf_usage): Check for -lpthread presence.
400 (__mf_unregister): Confirm matching unregistration base.
401 (__mf_find_objects_rec): Reduce unnecessary recursion.
402 * mf-runtime.h.in: Add "nothrow" attribute to functions. Add
403 #defines for new hook functions.
404 * mf-impl.h: Corresponding changes.
405 * config.h.in, configure, Makefile.in: Regenerated.
407 2002-04-27 Diego Novillo <dnovillo@redhat.com>
409 * testsuite/libmudflap.c/fail1-frag.c: Add volatile
410 modifiers to prevent being optimized away.
411 * testsuite/libmudflap.c/fail10-frag.c: Likewise.
412 * testsuite/libmudflap.c/fail13-frag.c: Likewise.
413 * testsuite/libmudflap.c/fail14-frag.c: Likewise.
414 * testsuite/libmudflap.c/fail15-frag.c: Likewise.
415 * testsuite/libmudflap.c/fail2-frag.c: Likewise.
416 * testsuite/libmudflap.c/fail20-frag.c: Likewise.
417 * testsuite/libmudflap.c/fail3-frag.c: Likewise.
419 2003-04-15 Frank Ch. Eigler <fche@redhat.com>
421 * Makefile.am (libmudflap_la_LIBADD): Remove -ldl.
422 * configure.in: Look for uintptr_t and -ldl on target.
423 * mf-runtime.h.in: Adjust uintptr_t declaration logic.
424 * Makefile.in, aclocal.m4, configure, config.h.in: Regenerated.
425 * testsuite/Makefile.in: Regenerated.
426 * mf-runtime.c (__mf_sigusr1_respond): Tweak declaration and calls
427 for better C compliance.
429 2003-04-15 Frank Ch. Eigler <fche@redhat.com>
431 * mf-hooks.c (MF_VALIDATE_EXTENT): Remove unnecessary reentrancy
433 * mf-runtime.c (__mf_set_default_options): Turn off
434 check-initialization.
435 (__mf_describe_object): Shorten description.
436 * testsuite/libmudflap.c/fail25-frag.c: Turn on check-initialization.
438 2003-04-07 Frank Ch. Eigler <fche@redhat.com>
440 * mf-hooks.c (__mf_0fn_mmap): Correct return value, as per <rth>.
442 2003-04-02 Frank Ch. Eigler <fche@redhat.com>
444 * mf-hooks.c (BEGIN_PROTECT): Handle startup-time reentrant
446 (__mf_0fn_malloc ... _munmap): New dummy backup calls.
447 * mf-impl.h (CALL_BACKUP): New macros.
448 * mf-runtime.c (__mf_init): Tweak __mf_state during startup.
450 2003-03-31 Frank Ch. Eigler <fche@redhat.com>
452 * Makefile.am (AM_CFLAGS): Remove optimization flags.
453 (HOOKOBJS): Remove dlopen hook.
454 (libmudflap_la_LIBADD): Add -ldl.
455 * mf-hooks.c (dlopen): Remove hook.
456 * mf-impl.h (__mf_dynamic): Ditto.
457 * mf-runtime.c (__mf_resolve_dynamics): Ditto.
458 * Makefile.in: Regenerated.
460 2003-03-28 Frank Ch. Eigler <fche@redhat.com>
462 * configure.in: Check for target gettimeofday, signal, some headers.
463 * mf-impl.h (__mf_opts): Add new "sigusr1_report" field. Comment
464 out inop multi_threaded field.
465 * mf-runtime.c (options): Handle new "-sigusr1-report" option.
466 (__mf_set_options): Correct handling of "-help".
467 (__mf_sigusr1_respond): New function to manage SIGUSR1 response.
468 (__mf_check, __mf_register, __mf_unregister): Call it.
469 (__mf_insert_new_object, __mf_unregister): Respect HAVE_GETTIMEOFDAY.
470 (__mf_report_leaks): Make callable
471 (__mf_tree_analyze): Traverse in-order. Accumulate address bit
472 distribution statistics.
473 (__mf_adapt_cache): Rewrite shift guessing logic based on address
475 * config.h.in, configure: Regenerated.
476 * testsuite/libmudflap.c/fail27-frag.c: New test.
477 * testsuite/libmudflap.c/pass36-frag.c: New test.
479 2003-03-11 Frank Ch. Eigler <fche@redhat.com>
481 * mf-runtime.h.in: Tweak.
482 * Makefile.am, configure.in: Tweak mf-runtime.h generation some more.
483 Don't use intermediate files nor AC_OUTPUT-time postprocessing.
484 * Makefile.in, testsuite/Makefile.in, configure: Regenerated.
486 2003-03-10 Frank Ch. Eigler <fche@redhat.com>
488 * configure.in: Tweak generation of mf-runtime.h some more. It
489 needs to work from both config.status and configure.
490 * configure: Regenerated.
492 2003-03-10 Frank Ch. Eigler <fche@redhat.com>
494 * Makefile.am: Reorganize hook file building. Add auto dependencies.
495 * configure.in: Tweak generation of mf-runtime.h.
496 * mf-runtime.h.in: Add new __MF_TYPE_HEAP_I.
497 * mf-hooks.c (*): Adapt to initialized-heap object type.
498 * mf-impl.h: Tweak cemetary boundaries.
499 * mf-runtime.c (__mf_check): Adapt to new initialized-heap object
501 (__mf_insert_new_object, __mf_register, __mf_unregister): Ditto.
502 (__mf_describe_object, __mf_report_leaks, __mf_violation): Ditto.
503 * testsuite/lib/libmudflap.exp (includes): Include build tree.
504 * testsuite/libmudflap.c/pass{26,5}: Further adapt to initialization
506 * testsuite/.../fail{25,26}-frag.c: New tests.
507 * testsuite/.../pass{32,33,34,35}-frag.c: New tests.
508 * Makefile.in, configure: Regenerated.
510 2003-03-05 Frank Ch. Eigler <fche@redhat.com>
512 * mf-runtime.c (__mf_set_default_options): Turn on initialization
514 (__mf_insert_new_object): As a temporary hack, assume that new
515 objects registered on the stack start out initialized.
516 * testsuite/libmudflap.c/fail9,pass23,pass[6789]-*: Initialize
517 heap objects by hand.
519 2003-03-05 Frank Ch. Eigler <fche@redhat.com>
521 Switch to macro-style hooks for str*/mem*/b* functions.
522 * mf-runtime.h.in (__MF_TYPE_*): Moved some internal values out.
523 (mem*, str*, b*): Added macro-style hooks for _MUDFLAP case.
524 * mf-runtime.c: #include config.h to enable glibc backtraces again.
525 (__mf_set_default_options): Turn off heur_proc_map.
526 (*): Adapt to to macro-style hook functions.
527 (__mf_object_dead_head, __mf_object_cemetary): Correct bounds.
528 (__mf_check, __mf_register, __mf_unregister): Tweak tracing message.
529 (__mf_violation): Handle __MF_VIOL_WATCH.
530 * mf-impl.h (__MF_TYPE_*): Moved these internal values here.
531 (__mf_dynamic): Removed mem*/str*/b* functions.
532 (TRACE, VERBOSE_TRACE): Add reentrancy locking.
533 (WRAPPER2): New macro for macro-style hooks.
534 * mf-hooks.c: Convert mem*/str*/b* functions to simpler
536 (BEGIN_PROTECT): Tweak tracing vs reentrancy-lock ordering.
537 * mf-heuristics.c: Adapt to macro-style hook functions.
538 Correct some comments.
539 * testsuite/lib/mfdg.exp (dg-test): Simplify result string for
540 output pattern tests.
541 * testsuite/libmudflap.c/fail[89]-frag.c: Elaborate output test.
542 * testsuite/libmudflap.c++/c++frags.exp: Enable non-static tests.
544 2003-02-28 Frank Ch. Eigler <fche@redhat.com>
546 * testsuite/libmudflap.c/fail23-frag.c, pass30-frag.c: New tests
547 for global array registration.
548 * testsuite/libmudflap.c++/fail24-frag.cxx, pass31-frag.cxx: Ditto.
549 * testsuite/libmudflap.c++/c++frags.exp: Tweak -static multilib hack.
551 2003-02-27 Frank Ch. Eigler <fche@redhat.com>
553 * Makefile.am: Add gross make bug workarounds. Tweaked
554 SUBDIRS and AM_CFLAGS.
555 * Makefile.in: Regenerated.
557 2003-02-26 Frank Ch. Eigler <fche@redhat.com>
560 * configure.in (AC_PROG_CXX): Don't look for C++ any more.
561 * Makefile.am (TESTS): Remove simple automake testing.
562 * configure, Makefile.in: Regenerated.
563 (SUBDIRS): Include new testsuite/ directory.
564 * tests/*: Removed all files; moved bulk under:
565 * testsuite/*: New subdirectory tree.
566 * testsuite/libmudflap.c/cfrags.exp: New file, C test driver.
567 * testsuite/libmudflap.c++/c++frags.exp: New file, C++ test driver.
568 * testsuite/lib/libmudflap.exp: New file, derived from libstdc++.
569 * testsuite/lib/mfdg.exp: New file, derived from dejagnu.
570 * testsuite/config/default.exp: New file.
571 * testsuite/Makefile.am, Makefile.in: New files.
573 2003-01-29 Frank Ch. Eigler <fche@redhat.com>
575 * Makefile.am (TESTS_ENVIRONMENT): Remove redundant "-mode-check".
576 (TESTS): Add fail22 and pass29 tests.
577 * mf-runtime.h.in: Change API to take void*/size_t region parameters.
578 Add new access-type parameter for __mf_check. Move __MF_VIOL* out.
579 * mf-impl.h: Corresponding changes. Update CLAMP* macros for void*
580 values. Move __MF_VIOL* here.
581 * mf-runtime.c (*): Adapt to void*/size_t API in mf-runtime.h.
582 (check_initialization): New field in __mf_opts. Default off.
583 (read_count,write_count): New fields in __mf_object.
584 (__mf_check): Implement basic initialization checking.
585 (__mf_insert_new_object): Assume STATIC|GUESS regions are initialized.
586 (__mf_describe_object): Print new fields.
587 (__mf_violation): Identify check/read vs. check/write in messages.
588 * test/pass29-frag.c, test/fail22-frag.c: Basic tests for new
589 "-check-initialized" mudflap option.
590 * test/pass25-frag.c, test/fail21-frag.c: Adapt to API changes.
591 * mf-hooks.c (MF_VALIDATE_EXTENT): Add new access-type parameter.
592 Drop __FILE__/__LINE__ hack. Update callers.
593 (*): Adapt to new mf-runtime.h API.
594 * Makefile.in: regenerated.
596 2003-01-24 Frank Ch. Eigler <fche@redhat.com>
598 * configure.in: Build mf-runtime.h a more proper way.
599 * mf-hooks.c (strdup, strndup): Correct reentrancy logic.
600 * mf-runtime.c (verbose_violations): Turn on by default.
601 * mf-runtime.h.in: Remove some miscellaneous stuff ...
602 * mf-impl.h: ... and move it here.
603 * configure: Regenerated.
605 2003-01-22 Frank Ch. Eigler <fche@redhat.com>
607 * configure.in: Look for C++ compiler.
608 * test/*-frag.c, mf-driver.c: Reformatted with GNU indent and
609 fixed type warnings when built with C++.
610 * test/pass27-frag.cxx, pass28-frag.cxx: New C++ tests.
611 * Makefile.am (TESTS): Run them.
612 (*) Add new rules for building and running C++ tests.
613 (TESTFLAGS): Set new default to avoid libstdc++-v3 shlib issues.
614 * mf-runtime.h.in: Protect with extern "C".
615 * Makefile, configure: Regenerated.
617 2003-01-06 Frank Ch. Eigler <fche@redhat.com>
619 Portability improvements.
620 * configure.in: Look for glibc backtrace headers/functions.
621 * mf-hooks.c: Don't include <execinfo.h> any more.
622 * mf-runtime.c (__mf_set_options): Call more stdlib functions
624 (__mf_backtrace): Provide alternate baby implementation in
626 * test/mf-driver.c: Portability tweaks.
627 * acinclude.m4: New file, containing top level libtool.m4.
628 * aclocal.m4, configure, Makefile.in, config.h.in: Regenerated.
630 2002-12-19 Frank Ch. Eigler <fche@redhat.com>
632 * mf-runtime.h.in (HAVE_UINTPTR_T): Define unconditionally.
634 2002-11-08 Frank Ch. Eigler <fche@redhat.com>
636 * mf-runtime.c (options): Add new "wipe-heap", "wipe-stack"
638 (__mf_unregister): Implement stack/heap object wiping.
639 (__mf_set_options): Renamed from __mf_process_opts.
640 (__mf_uncache_object): Change arg type, correct callers.
641 * mf-impl.h: Corresponding changes.
642 * mf-hooks.c (realloc): Save/restore heap-wiping flag.
643 * mf-runtime.h.in (__mf_set_options): Extend public API.
644 * test/pass26-frag.c: New test for stack wiping.
645 * Makefile.am (TESTS): Run it.
646 * Makefile.in: Regenerated.
648 2002-11-07 Frank Ch. Eigler <fche@redhat.com>
650 * mf-runtime.h.in (__mf_watch, __mf_unwatch): Extend public API.
651 * mf-runtime.c (__mf_object_t): Add watching_p field.
652 (__mf_watch_or_not): New function to implement
653 object watch flagging.
654 (__mf_watch, __mf_unwatch): New wrappers for above.
655 (__mf_check, __mf_describe_object): Handle objects with watching_p.
656 (__mf_count_violation): Enlarge array.
657 (__mf_uncache_object): Renamed from __mf_remove_old_object. Don't
658 unlink object. Clear cache properly.
659 (__mf_unregister): Unlink object explicitly before uncaching.
660 * test/fail21-frag.c, pass25-frag.c: New tests.
661 * Makefile.in, aclocal.m4: Regenerated.
663 2002-11-05 Frank Ch. Eigler <fche@redhat.com>
665 * test/fail20-frag.c: New test for NULL pointer dereferencing.
666 * Makefile.am (TESTS): Add it.
667 * test/pass-stratcliff.c: Add decls of stpcpy.
668 * configure.in: Test for <stdint.h>. Generate mf-runtime.h in
669 build tree from config.h and new file mf-runtime.h.in.
670 * mf-runtime.h.in: Renamed from mf-runtime.h. Tweak uintptr_t decl.
671 * Makefile.in, configure, config.h.in: Regenerated.
672 * mf-hooks.c: Add #undef for wrapped glibc str*/mem* macros.
673 * mf-runtime.c (options, __mf_set_default_options): Support new
674 default "abbreviate" option.
675 (__mf_object.description_epoch): New field.
676 (__mf_describe_object): Conditionally abbreviate objects already
677 displayed in current epoch. Accept NULL input to increment epoch.
678 (__mf_fini, __mf_ini): Reset description epoch.
679 (__mf_register, __mf_unregister, __mf_adapt_cache, __mf_init): Ensure
680 that NULL pointer slot in lookup cache is invalidated. Register a
681 NOACCESS region around NULL.
682 * mf-impl.h: Corresponding changes.
684 2002-10-16 Frank Ch. Eigler <fche@redhat.com>
686 * test/fail19-frag.c, pass24-frag.c, pass-stratcliff.c: New tests.
687 * Makefile.am: Run them. Install mf-runtime.h.
688 * Makefile.in: Regenerated.
689 * mf-hooks.c: Add some markers for more missing functions.
690 * mf-runtime.c (__mf_adapt_cache): Experiment with a utilization-based
691 statistic to tune tune cache size (mask).
693 2002-10-01 Frank Ch. Eigler <fche@redhat.com>
695 * test/pass23-frag.c: New test for bit_field_ref expressions.
696 * Makefile.am, Makefile.in: Add new test.
697 * mf-hooks.c (mmap, munmap): Rewrite to track individual pages.
698 (MF_VALIDATE_EXTENT): Accept zero-size mem/str operations.
699 * mf-runtime.c (__mf_init): Register errno global.
700 (__mf_find_object): Removed function.
701 (__mf_check): Rewrite logic to support accesses across some
702 contiguous but distinctly registered objects.
703 (__mf_remove_old_object): Tolerate cache entries that span
706 2002-09-30 Frank Ch. Eigler <fche@redhat.com>
708 * test/pass21-frag.c, pass22-frag.c: New tests: alloca, bitfields.
709 * Makefile.am, Makefile.in: Run new tests.
710 * mf-hooks.c (alloca): Correct stack direction logic.
712 2002-09-26 Frank Ch. Eigler <fche@redhat.com>
714 * mf-impl.h (adapt_cache): New option.
715 * mf-runtime.c (__mf_set_default_options): Set its default value.
716 Tweak the tree_aging parameter down.
717 (__mf_check): Maintain separate counter for cache-adaptation.
718 (__mf_tree_analyze): New function to collect object tree stats.
719 (__mf_adapt_cache): New function to automate cache parameters.
721 2002-09-24 Frank Ch. Eigler <fche@redhat.com>
723 * mf-heuristics.c (__init_misc, __mf_heuristic_check): Add
724 hypothetical #if-0'd argv/envp region registration.
725 * mf-runtime.c (__mf_init): Add kludged form of above.
726 (*) Add "heur_argv_environ" flag, default on, to govern this.
727 * mf-impl.h: Corresponding changes.
729 2002-09-20 Frank Ch. Eigler <fche@redhat.com>
731 * test/fail18-frag.c: New test file for NOACCESS regions.
732 * Makefile.am (TESTS): Add new test.
733 * Makefile.in: Regenerated.
735 * mf-heuristics.c (__mf_heuristics_check): Correct deja_vu logic.
736 * mf-impl.h (tree_aging): Add new mudflap_option, default 1000000.
737 (optimize_object_tree): Remove unused mudflap_option.
738 * mf-runtime.h (__MF_TYPE_NOACCESS): New region type. Add printing
739 support throughout. Use .._MAX_CEM for cemetary upper bound.
740 * mf-runtime.c (__mf_init): Register __mf_* globals as NOACCESS
742 (__mf_object): Add new liveness field for use by tree aging.
743 (__mf_check): Trigger tree aging when needed.
744 (__mf_age_tree): New function to decay liveness field.
745 (__mf_find_objects_rec): Use liveness field to rotate tree.
746 (__mf_insert_new_object): Only provide backtrace for HEAP objects.
747 (__mf_unregister): Ditto.
748 (__mf_register): Tweak duplicate-static message.
749 (__mf_violation: Tweak nearby-object counter printing.
751 2002-09-16 Frank Ch. Eigler <fche@redhat.com>
753 * test/pass20-frag.c: New test file.
754 * Makefile.am (TESTS): Reorganize. Add pass20 test.
755 * Makefile.in: Regenerated.
757 * mf-impl.h (TRACE_IN, TRACE_OUT): Remove macros. Update callers.
758 * mf-hooks.c (BEGIN_PROTECT): Add hook tracing here.
759 * mf-heuristic.c (__mf_heuristic_check): Track seen /proc/self/map
760 entries to avoid repeat registration.
761 * mf-runtime.c (__mf_object_cemetary): Don't bother bury GUESS regions.
762 (__mf_register, __mf_unregister): Rewrite GUESS handling logic.
764 2002-09-09 Frank Ch. Eigler <fche@redhat.com>
766 * Makefile.am: Create test sources with #include, not cat>>.
767 * Makefile.in: Regenerated.
768 * test/buildtest.sh: Removed.
769 * test/driver.c (abort_handler, main): Be quiet.
771 2002-09-06 Frank Ch. Eigler <fche@redhat.com>
773 * test/pass18-frag.c, pass19-frag.c: New tests.
774 * Makefile.am (check): Run them. Rebuild test programs each time.
775 * Makefile.in: Regenerated.
777 2002-09-06 Frank Ch. Eigler <fche@redhat.com>
779 * mf-runtime.c (__mf_register): Correct SEGV-inducing error in
780 overlapping object search.
781 (__mf_violation): Likewise for nearby objects.
782 Improve nearby-object listing.
785 * mf-runtime.c, mf-hooks.c: Remove "{{{"/"}}}" folding marks.
786 * mf-heuristics.c (__mf_heuristic_check): Tweak message.
788 2002-09-03 Frank Ch. Eigler <fche@redhat.com>
791 * Makefile.am (AM_CFLAGS): New definition of needed settings.
792 (HOOKOBJS): Add alloca-hook.o.
793 * mf-hooks.c (alloca): New function to implement alloca in libiberty
795 * mf-runtime.c (__mf_report): Call alloca(0) to flush remaining blocks.
796 (__mf_backtrace): Reimplement without using alloca.
797 * Makefile.in: Regenerated.
800 * mf-hooks.c: Use VERBOSE_TRACE throughout instead of fprintf(stderr).
801 Correct signedness bugs in length-tracking variables.
802 * mf-impl.h: Make options unsigned.
803 (CALL_WRAP): New macro to parallel CALL_REAL().
804 (DECLARE): Remove erroneous ";" at end.
805 * mf-runtime.c, mf-hooks.c, mf-heuristics.c: Replace remaining %p
806 formatting specs with %08lx. Correct several compiler warnings.
808 2002-08-28 Frank Ch. Eigler <fche@redhat.com>
810 * mf-runtime.c (__mf_violation): Try harder to locate nearby objects.
812 2002-08-27 Frank Ch. Eigler <fche@redhat.com>
814 libmudflap hook breakup:
815 * Makefile.am (TESTS_ENVIRONMENT): Add ../../gcc to LD_LIBRARY_PATH
817 (TESTS): Make dependent on libmudflap.
818 (HOOKOBJS): Break up mf-hooks.o into many little hook objects,
819 compiled from segments of mf-hooks.c.
820 * mf-hooks.c: Corresponding changes: wrap each function in
822 * Makefile.in: Regenerated.
824 Heuristics reorganization:
825 * mf-heuristics.c (__mf_register_ro_sections, __mf_init_heuristics):
826 Remove these functions. Update callers.
827 (__mf_heuristic_check): Incorporate all the various heuristics.
828 Encode cacheability/retry judgement into trinary return value.
829 Separate start-end logic into a separate fallback heuristic. Only
830 register relevant /proc/self/map segments.
831 * mf-impl.h: Corresponding changes.
832 * mf-runtime.c (__mf_check): Reorganize heuristics fallback logic.
833 (__mf_init): Don't call __mf_init_heuristics.
836 * mf-heuristics.c, mf-runtime.c: Use new MUDFLAP_OPTION
837 "-verbose-trace" to emit all tracing messages other than those of
838 basic public api. Eliminate some duplicate/excessive messages.
839 * mf-runtime.h: Corresponding changes.
841 2002-08-27 Graydon Hoare <graydon@redhat.com>
843 * mf-impl.h (WRAPPER): Change to create linker aliases for __wrap
844 and __real when compiled with -DPIC.
845 * mf-hooks.c (WRAPPER): Change all uses of WRAPPER macro slightly.
846 * Makefile.am (AUTOMAKE_OPTIONS): Fix LD_LIBRARY_PATH for tests.
847 * Makefile.in: Regenerate.
849 2002-08-26 Graydon Hoare <graydon@redhat.com>
851 * mf-impl.h: New file, private implementation header.
852 * mf-runtime.h: Reorganize a bit.
853 (CLAMPSZ): Fix arithmetic.
854 (__MF_CACHE_MISS_P): Fix arithmetic.
855 * mf-runtime.c: Reorganize a bit.
856 (__mf_dynamic): New structure.
857 (resolve_single_dynamic): New function.
858 (__mf_resolve_dynamics): New function.
859 (__mf_init): Initialize dynamic wrappers.
860 * mf-hooks.c: Macro-ize __real calls.
861 Clamp various bits of arithmetic.
862 Add explicit __mf_check call contexts.
863 * Makefile.am: Add dependencies on mf-impl.h
864 * Makefile.in: Regenerate.
865 * configure.in: Comment out shared override.
866 * configure: Regenerate.
868 2002-08-22 Graydon Hoare <graydon@redhat.com>
870 * mf-runtime.c (__mf_process_opts): Sanity-check free_queue_length.
871 (__mf_check): Re-inialize and check heuristics before violation.
872 (__mf_register): Permit updating pure-guess regions.
873 * mf-hooks.c (__wrap_free): Correct some free queue logic.
874 (__wrap_dlopen): New wrapper function.
875 (__wrap_mmap): New wrapper function.
876 (__wrap_munmap): New wrapper function.
877 * mf-heuristics.c (__mf_register_ro_sections): Register *all* regions
878 which are not stack addresses.
879 (is_stack_address): New function.
880 (__mf_init_heuristics): Save and restore state, always initialize with
883 2002-08-21 Frank Ch. Eigler <fche@redhat.com>
885 * mf-hooks.c (MF_VALIDATE_EXTENT): Rewrite to correct off-by-one
886 error. Pass location string.
887 (wrap_strcpy, wrap_strncpy): Remove extra %s in trace strings.
888 * mf-runtime.c (options): Add lc-mask, lc-shift options.
889 (__mf_process_opts): Apply some sanity checking for lc-mask.
890 (__mf_check, __mf_violation): Take new location-string argument.
891 Update callers to pass NULL if necessary.
892 (__mf_backtrace): New smart backtracer function. Calls replace
893 several ad-hoc blocks elsewhere.
894 (__mf_describe_object): Remove bad reentrancy test. Improve
896 * mf-runtime.h: Corresponding changes. Public/private markup.
897 (__MF_CACHE_MISS_P): New macro.
899 2002-08-20 Graydon Hoare <graydon@redhat.com>
901 * mf-runtime.h: New option: stack_bound (heuristic).
902 Move some macros out of implementation files.
903 * mf-runtime.c: New option string: -stack-bound.
904 Unify recursion protection with hooks.
906 (__mf_check): Call __mf_heuristic_check.
907 (__mf_process_opts): Fix "no-" processing.
908 * mf-heuristics.c (__mf_heuristic_check): New function.
909 * mf-hooks.c: Much off-by-one fixing, recursion protection.
911 2002-08-20 Frank Ch. Eigler <fche@redhat.com>
913 Option parsing improvements, region splitting bug fixes:
914 * mf-heuristics.c (__mf_register_ro_sections): Add warned casts.
915 * mf-runtime.h (heur_proc_map): New libmudflap option.
916 * mf-runtime.c (__mf_set_default_options): Set it.
917 (__mf_usage): Print default values/status.
918 (__mf_process_opts): Support general "no-" option string prefix.
919 (__mf_init): Print __mf_usage on unknown-option error.
920 (__mf_register): Print trace message up front.
921 Correct region splitting logic for case where a subregion disappears.
923 (__mf_violation): Make even basic message conditional on option.
926 * Makefile.am (TESTS_ENVIRONMENT): Add -no-heur-proc-map.
927 (clean-local): New target.
928 (test/*x rules): Add -g CFLAGS.
929 (CFLAGS): Add -freorder-blocks.
930 (MFCONFIG_CFLAGS, INCLUDE): Remove unneeded settings.
931 * Makefile.in: Regenerated.
932 * Makefile, mf-config.h: Removed files.
934 2002-08-16 Graydon Hoare <graydon@redhat.com>
936 * mf-runtime.c (__mf_insert_new_object): Factor out of
938 (__mf_remove_old_object): Factor out of __mf_unregister.
939 (__mf_register): Handle guessed regions, splitting
940 guesses when new registrations arrive.
941 (__mf_unregister): Do not unregister guesses.
942 * mf-runtime.h: Move convenience macros around,
943 declare new option fields. Add __MF_TYPE_GUESS.
944 * mf-hooks.c (__wrap_*alloc): Use crumple zones.
945 (__wrap_free): Call __real_free for deferred frees.
946 * Makefile.am: Add more tests, fix dependency.
947 * Makefile.in: Regenerate.
948 * test/pass[13..17]-frag.c: New testcases.
949 * test/fail[13..17]-frag.c: New testcases.
951 2002-08-15 Graydon Hoare <graydon@redhat.com>
953 * mf-heuristics.c: New file.
954 * mf-runtime.c (options): Add -trace-calls option.
955 (__mf_init): Call __mf_init_heuristics.
957 2002-08-14 Graydon Hoare <graydon@redhat.com>
959 * Makefile.am (TESTS): Add testsuite support.
960 * Makefile.in: Regenerate.
961 * test/mf-driver.c: New file.
962 * test/buildtest.sh: New file.
963 * test/passNN-frag.c: New testcases.
964 * test/failNN-frag.c: New testcases.
966 2002-08-14 Graydon Hoare <graydon@redhat.com>
968 * mf-hooks.c: Change __real_strlen() to __real_strlen()+1 when
969 verifying non-size-limited string extents.
971 2002-08-14 Frank Ch. Eigler <fche@redhat.com>
973 * mf-hooks.c: Make __wrap string* functions use __real_str[n]len
974 instead of plain str[n]len for internal checks.
975 * mf-runtime.c (__mf_violation): Print optional stack traceback.
977 2002-08-14 Frank Ch. Eigler <fche@redhat.com>
979 * mf-hooks.c: Remove #if-0 around hooks that are now ld-wrapped.
981 2002-08-13 Graydon Hoare <graydon@redhat.com>
983 * mf-runtime.c: Rework configuration to operate on
984 environment variable options rather than #defines
985 (__mf_violation): Add simple fork-a-gdb violaiton mode.
986 (__mf_init): Set static __mf_active_p flag on startup,
987 to inhibit mudflap wrap-based checking during crt0.s.
988 * mf-runtime.h: Declare options structure.
989 * mf-hooks.c: New wrappings for mem*, b*, str*
990 libc functions (temporarily #if 0-ed out).
992 2002-08-12 Frank Ch. Eigler <fche@redhat.com>
994 * Makefile.am, configure.in: New files.
995 * Makefile.in, Makefile, configure, config.h.in: New generated files.
996 * stamp-h.in, aclocal.m4: Ditto.
998 2002-08-08 Frank Ch. Eigler <fche@redhat.com>
1000 * Makefile: New file.
1001 * mf-config.h: New file: runtime configuration.
1002 * mf-hooks.c: New file: interposed libc functions.
1003 * mf-runtime.c: New file: bulk of runtime.
1004 * mf-runtime.h: New file: public functions.