Commit Graph

617 Commits

Author SHA1 Message Date
Julian Seward
93de9055b6 Add a new client request, VG_USERREQ__LOGMESSAGE, and use this to route
all commentary from our libpthread.so through to the valgrind core and
hence to the selected logging sink.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1274
2002-11-03 13:41:41 +00:00
Julian Seward
72edb7fc20 Robustification of logging to a socket. If the listener process dies
or for whatever reason hangs up the connection, don't let valgrind
get SIGPIPE; instead just switch back to spewing messages on stderr.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1273
2002-11-03 11:44:36 +00:00
Julian Seward
41b8324983 Implement logging to a network socket. So it's now possible to do
valgrind ... --logsocket=192.168.0.1:1500 or whatever, to send all
output to that address/port combination.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1272
2002-11-03 03:20:15 +00:00
Nicholas Nethercote
fc717e001c Fixed minor problem in regtest script.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1271
2002-10-30 15:23:05 +00:00
Nicholas Nethercote
2acffee45a Fixed minor problem in regtest script.
Added missing filter for none/tests.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1270
2002-10-30 15:22:03 +00:00
Julian Seward
d9b5337f4b Implement --logfile=<file>, which causes all the log output to be
written to "<file>.pid<pid>".  Useful for tracing trees of processes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1269
2002-10-27 20:28:29 +00:00
Julian Seward
a2b7a4f408 Increase M_LOCKSET_TABLE to 5000, for Mozilla.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1268
2002-10-23 22:45:08 +00:00
Julian Seward
c12c27f3ed Merge patch from Jeremy Fitzhardinge:
19-hg-lockgraph
  HELGRIND: large patch which does a big bugfix and adds some new
  instrumentation:

  1. The bugfix is BIG. Previously the code which maintained the
  thread's current lockset would often (maybe always) fail to add new
  locks to the set, so it always looked like threads were holding one
  lock. The problem was in weird_LockSet_equals(); I rewrote it in a way
  which should be obviously correct. Fixing this exposed a bug in
  removing locks from a thread's lockset, which was also caused by
  another bug in weird_LockSet_equals(). This fix makes many spurious
  data race warnings go away (notably, stdio becomes silent).

  2. The new feature is tracking of the order of lock usage. If
  threads are taking locks in an inconsistent order, that's a symptom of
  possible deadlock. Helgrind will now warn when it sees this happening
  (though the warnings themselves need to be improved).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1267
2002-10-23 21:58:55 +00:00
Julian Seward
6452d39430 Merge patch from Jeremy Fitzhardinge:
18-recv-nonblock
  Make recv() nonblocking.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1266
2002-10-23 21:55:01 +00:00
Julian Seward
af9e404d3e Merge patch from Jeremy Fitzhardinge:
16-function-intercept
  Implement a more reliable for vg_libpthread to intercept libc
  calls. Since the only reliable way of making sure that our code
  defines the symbol is by making sure that valgrind.so itself does it,
  this patch adds a new file, vg_intercept.so, which defines those
  symbols. They are then passed off to a weak local function if
  libpthread isn't present, or to the libpthread version if it is.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1265
2002-10-23 21:53:49 +00:00
Julian Seward
7845210b4f Merge patch from Jeremy Fitzhardinge:
02-sysv-msg
  Support for threaded programs using msgsnd/msgrcv.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1264
2002-10-23 21:49:33 +00:00
Julian Seward
7240057bc8 Merge patch from Jeremy Fitzhardinge:
14-hg-mmap-magic-virgin
  This does two things:

  1. change the signatures of the new_mem_mmap and change_mem_mprotect
  functions to remove the pointless 'nn' argument. This makes them match
  the signature of new_mem_startup...

  2. change helgrind to mark memory created by mmap as if it were the
  same as other magically pre-inited memory. Implement this by pointing
  helgrind's new_mem_mmap function at new_mem_startup.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1263
2002-10-23 21:46:13 +00:00
Julian Seward
61ff08d6e5 Merge patch from Jeremy Fitzhardinge:
13-kill-1ifroot
  Kill VG_(get_current_tid_1_if_root)() and replace it with the slightly
  more appetising (though still hackish)
  VG_(get_current_or_recent_tid)(). This is intended for use when
  there's no thread actually loaded into the baseblock, but we're doing
  work on behalf of the the thread that was last running (such as during
  a syscall).

  This probably fixes a bug with helgrind misattributing memory created
  with mmap to thread 1 rather than the thread which called mmap (though
  the behaviour is still probably wrong: mmapped memory should be
  magically_inited).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1262
2002-10-23 21:38:22 +00:00
Julian Seward
c02cf1e3ea Merge patch from Jeremy Fitzhardinge:
13-fix-printf
  Fix stupid bug I introduced into printf with 14-sprintf.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1261
2002-10-23 21:35:00 +00:00
Nicholas Nethercote
d8b0b7962d Fixed some argument type wibbles, pointed out by Arnaud Desitter.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1260
2002-10-23 12:54:11 +00:00
Julian Seward
6ad01829d9 (Josef Weidendorfer):
Workaround bad DWARF2 line info generated by the Intel Fortran compiler.

There is a big comment in the sources explaining more.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1259
2002-10-22 05:41:14 +00:00
Julian Seward
dde0ce76e6 Merge patch from Jeremy Fitzhardinge:
21-hg-dupwrite
  HELGRIND: quite often memory is written with a value which is already
  there, which would not cause a race (I think; there are certainly
  valid idioms which rely on this behaviour). Anyway, suppressing checks
  for such overwrites cuts down the number of apparently spurious
  errors. Also fixes the bug in which FP loads were considered to be
  stores.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1258
2002-10-22 05:09:36 +00:00
Julian Seward
277bf259c6 Merge patch from Jeremy Fitzhardinge:
20-hg-secmap
  HELGRIND: fix bugs causing a torrent of "access to distingished map"
  messages. There were two: one is some absurdly broken rounding/padding
  code in set_address_range_state() (how did anything work!?). The other
  was some odd looking code in the tracking of attaching shared memory
  segments. Since they're semantically very similar to mmap, track them
  as such.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1257
2002-10-22 05:05:49 +00:00
Julian Seward
7425158706 Merge patch from Jeremy Fitzhardinge:
19-hg-context
  HELGRIND: Yet more work on making sure the right context is used when
  reporting errors. The previous code used the snapshot of the thread
  context in the VG_(threads) array rather than the current machine
  state in the baseBlock. This patch makes sure that errors arising from
  program reads and writes are reported properly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1256
2002-10-22 04:59:26 +00:00
Julian Seward
eecdf42502 Merge patch from Jeremy Fitzhardinge:
18-hg-err-reporting
  HELGRIND: show more information about the address we're reporting a
  possible data race for; in particular, try to describe where the
  address came from (static variable, or heap allocated and if so
  where?) (Mostly stolen from memcheck). Also puts memory locations
  involved with an error into an error state, so that duplicate errors
  are suppressed. Also displays the last good set of locks for a memory
  location.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1255
2002-10-22 04:55:54 +00:00
Julian Seward
c723598f6a Merge patch from Jeremy Fitzhardinge:
17-hg-generic-mutex
  HELGRIND: remove references to pthread_mutex_t and replace it with a
  more generic notion of a mutex. Adds a persistent store of per-mutex
  information. Not presently useful, but will be.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1254
2002-10-22 04:54:55 +00:00
Julian Seward
c6797e9615 Merge patch from Jeremy Fitzhardinge:
14-sprintf
  Update to core VG_(printf)/sprintf/vprintf. They've been modified to
  return the number of characters they generated (either printed, put
  into the buffer, or sent). Also adds a new %y format, which takes an
  Addr argument and looks up a symbol. It takes a '(' flag (ie: "%(y")
  which surrounds the symbol in parens if it could be found.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1253
2002-10-22 04:45:48 +00:00
Julian Seward
e87a6ce4ce Partially merge patch from Jeremy Fitzhardinge:
13-track-condvar-mutex
  This fixes mutex lock/unlock tracking. In particular, it gets
  tracking of mutex ownership over condition variables correct.

I didn't take the bits to do with vg_tid_currently_in_baseBlock's value
when baseBlock is empty.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1252
2002-10-22 04:30:35 +00:00
Julian Seward
9332fb832a Merge patch from Jeremy Fitzhardinge:
08-skin-clientreq
  Introduce a systematic way for skins to distinguish each other's
  client requests. Uses the de-facto standard two-letter identifiers in
  the top two bytes of the client request code. Also changes the
  interface to SK_(handle_client_request) so that a skin can say whether
  or not it handled the request, which allows correct setting of the
  default return value if the request was not handled.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1251
2002-10-22 04:14:35 +00:00
Julian Seward
976b63337a Common up leak detection stuff which was previously duplicated in Memcheck
and Addrcheck.  In coregrind/vg_memory.c, create

   void VG_(generic_detect_memory_leaks

and remove several hundred lines of code from both ac_main.c and mc_main.c.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1250
2002-10-21 07:29:59 +00:00
Julian Seward
1069339a64 merge patch from Jeremy Fitzhardinge:
16-ld-nodelete
  Add -Wl,-z,nodelete,-z,initfirst to link line for libpthread.so,
  because HJ [Lu] says so. Also add soname.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1249
2002-10-20 19:50:07 +00:00
Julian Seward
e3fbbadd13 merge patch from Jeremy Fitzhardinge:
15-hg-datasym
  HELGRIND: In conjunction with patch 13-data-syms, print symbolic
  information for addresses in error messages (if possible).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1248
2002-10-20 19:43:47 +00:00
Julian Seward
eba1b443e5 merge patches from Jeremy Fitzhardinge:
14-hg-tid
  HELGRIND: This fixes a bug in Helgrind in which all memory access by
  syscalls was being treated as if it were happening in thread 1. This
  is because the eraser_mem_read/write functions were using
  get_current_tid_1_if_root() to get the current tid. Unfortunately,
  during syscalls there is no current thread, so it was getting
  1_if_root. This patch fixes this by using what thread ID information
  we're given, and only using get_current_tid() if we're recording a
  memory access performed by code (rather than by a syscall).

... which relies on ...

06-memops
  Implement VG_(memcpy/memset).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1247
2002-10-20 19:40:32 +00:00
Julian Seward
1778e7985a Merge 13-data-syms from Jeremy Fitzhardinge:
Fix to the ELF file reader to make sure that each SegInfo includes not
only the text mapped from an ELF file, but also the data and bss. This
allows the data symbols to be extracted. Also adds a new needs boolean
to allow a skin to specify if it needs data symbols. As a nice
side-effect, it removes the "offset" hack: the offset is the mapped
address in the ELF Phdr: it is (mapped_address - phdr_vaddr).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1246
2002-10-20 19:29:21 +00:00
Julian Seward
dfa3421369 Merge 07-seginfo from Jeremy Fitzhardinge:
API for skins to extract information about mapped segments.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1245
2002-10-20 18:35:48 +00:00
Julian Seward
a2174b135a merge (in effect, and without docs) revs:
valgrind.in       1.17.2.3
   vg_syscall_mem.c 1.58.2.12

Add Jeremy Fitzhardinge's --weird-hacks=lax-ioctls patch, and add some docs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1244
2002-10-20 18:11:49 +00:00
Julian Seward
e6e71496fa merge rev 1.8.2.2:
Add a suppression for R H 7.3 on i686.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1243
2002-10-20 16:27:43 +00:00
Julian Seward
8f7a43395a merge rev 1.90.2.12:
Put __pthread_getspecific_addr inside ifdefs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1242
2002-10-20 16:25:55 +00:00
Julian Seward
488524613b merge rev 1.90.2.11:
Create __ versions of the select and poll symbols, so that all
references are caught (Jeremy Fitzhardinge)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1241
2002-10-20 16:24:04 +00:00
Julian Seward
4a133a6408 merge revs
vg_libpthread.c       1.90.2.10
   vg_libpthread_unimp.c 1.30.2.5

Implement (sort-of) pthread_attr_{set,get}guardsize.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1240
2002-10-20 16:22:57 +00:00
Julian Seward
3a80785b70 merge rev 1.68.2.11:
Add ever more new ioctls and syscalls.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1239
2002-10-16 23:13:00 +00:00
Julian Seward
695aaac7c1 merge revs
vg_libpthread.c 1.90.2.9
   vg_libpthread_unimp.c 1.30.2.4

Add sem_timedwait().  From Scott Smith <sls@cs.unt.edu>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1238
2002-10-16 19:45:06 +00:00
Julian Seward
e6f9adbd38 merge rev 1.35.2.6:
Change the capitalisation of Reuben's Mite.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1237
2002-10-16 19:41:41 +00:00
Julian Seward
0ae79cc37d merge rev 1.29.2.8:
Implement primary opcode 0x1A (SBB Eb,Gb).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1236
2002-10-16 19:40:04 +00:00
Dirk Mueller
87e7036870 make it work with newer autoconf
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1235
2002-10-16 13:09:26 +00:00
Nicholas Nethercote
8a33a377c3 Minor update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1233
2002-10-16 08:38:58 +00:00
Nicholas Nethercote
72908a31a6 Wibbles, thanks to Arnaud Desitter.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1232
2002-10-15 08:48:08 +00:00
Nicholas Nethercote
20f83c6132 Added VG_(rename) (untested), and made VG_(bbs_done) visible to skins, both at
the request of Josef Weidendorfer for his KCachegrind stuff.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1231
2002-10-14 09:25:37 +00:00
Nicholas Nethercote
a1b7d4baa8 Moved baseBlock initialisation to after command-line processing, for skins that
don't register helpers until command-line options are seen.  As requested by
Jeremy Fitzhardinge.  Also neatened the code up marginally.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1230
2002-10-14 09:25:19 +00:00
Julian Seward
9ea62d1526 Incorporate horrible hack to workaround problem of emitting bogus
uninit-value errors on code with inlined strlen() et al from gcc-3.1
and above.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1213
2002-10-13 00:57:26 +00:00
Julian Seward
e5494a7f05 Fixes for the DWARF2 reader, from Josef Weidendorfer:
Attached patch is for the Dwarf2 source line info reader;
For reading, a state machine is used reconstructing source line
info while running and reading (see DWARF2 specification, ch. 6.2).
The state machine was correct, but the calls to addLineInfo()
were wrong: It reported most of the times too small ranges
for source code statements, because it used only the diff of the last
state machine command instead of the diff to the last statement
boundary. Effect: Around 1/3 of all addresses with source line info got
unknown location.
The patch adds a "last_address" to the state machine to remember the last
statement boundary. On reset, it#s initialised to the "invalid" address 0. I
hope this is OK (or should we use "(Addr)-1" instead?).
The patch now uses the "is_stmt" boolean correctly to only call addLineInfo()
if there's a statement boundary (on x86, is_stmt most probably is
always true...).

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1209
2002-10-12 17:27:16 +00:00
Julian Seward
99c3bf9dbb Finish off support for Red Hat 8 thread-specific-data. Unfortunately
the appearance of libc_internal_tsd_address requires a redesign, since
the existing scheme doesn't make it sensible to take the address of a
specific-data value.

New scheme is that the ThreadState structure carries not the table of
specifics, but merely a pointer to such.  This is allocated from the
client-side library, thus residing in client-visible memory and so
addresses can validlyh be taken.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1208
2002-10-12 16:42:35 +00:00
Julian Seward
a3d1803851 Initial stuff to make it work on Red Hat 8:
- autoconf stuff for detecting glibc-2.3

- vg_libpthread_unimp.c: hack for __pthread_clock_[gs]ettime

- vg_libpthread.c: initialise thread's default locale by calling
  __uselocale(LC_GLOBAL_LOCALE) at the right time.  Gruesome.
  Also need to do this for new other threads - not yet done.

- cleanups -- don't use write() to write messages when bombing out,
  instead go direct to the syscalls.  Avoids nasty circularities
  with glibc initialisations.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1207
2002-10-07 23:56:55 +00:00
Nicholas Nethercote
1bca542dbb whoops
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1206
2002-10-07 14:46:07 +00:00
Nicholas Nethercote
28823c33b3 Added support for multi-skin suppressions, of the form:
skin_name1,skin_name2:supp_name

No spaces are allowed on either side of the comma.

This is useful for sharing suppressions between Addrcheck and Memcheck.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1205
2002-10-07 14:42:59 +00:00