Commit Graph

783 Commits

Author SHA1 Message Date
Nicholas Nethercote
dc372ac1de Added a regression test that checks if command line arguments with spaces work.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1442
2003-02-24 22:05:38 +00:00
Julian Seward
6a1c953fe9 Undo rev 1.78, which I committed by accident. Duh.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1441
2003-02-24 21:59:31 +00:00
Julian Seward
575a8896ec o I fixed a small bug: the code in coregrind/vg_syscalls.c seems
to assume that all sockaddrs are non-NULL and non-zero in
     length.  This isn't always true, and when I ran a program that
     used a NULL sockaddr through Valgrind it segfaulted.  I believe
     that the change that I made fixes this bug in general, but I
     might be overlooking something.

From kclark@CetaceanNetworks.com (Kevin D. Clark)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1440
2003-02-24 21:55:34 +00:00
Nicholas Nethercote
a5c2a5d8f4 Change the recently added VG_(memcmp) to use UChars instead of Chars.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1439
2003-02-24 21:43:05 +00:00
Julian Seward
0c34d96930 Fixes handling of parameters with spaces in, and misc other
magic hacks from Nick.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1438
2003-02-24 21:42:53 +00:00
Julian Seward
725af35162 Support for glibc-2.3.X. (from Stephan Kulow)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1437
2003-02-24 21:24:41 +00:00
Nicholas Nethercote
b8faaa5488 [Julian, you might like to check these changes]
Fixed demangler bug -- it was relying on glibc for some functions.  This
triggered an incredibly obscure bug in my experimental skin -- memcpy() was
called within the demangler at (about?) the same time as the dynamic linker was
fiddling with the memcpy() entry, which caused one word of memory (probably
some counter in the dynamic linker) to be incremented, which my skin didn't
like.

So I removed all (AFAICT) of the demangler's dependencies on glibc.  This
required adding macros for memset, memcpy, strlen, strcmp..., to replace them
with their VG_(...) version.  The only #includes now are to .h files that are
part of Valgrind.

Also required #defining "size_t" as "Int".

Also required adding VG_(memcmp)() to vg_mylibc.c.

Also removed the "-1 == EOF" part of the compile-time test in safe-ctype.h
that checks the character set is ASCII.  This was to remove the dependency
on stdio.h.  Slightly dodgy, but should be ok I think/hope.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1436
2003-02-24 10:49:08 +00:00
Nicholas Nethercote
3d8b6976f0 Added two new events: pre_deliver_signal and post_deliver_signal.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1435
2003-02-24 10:42:47 +00:00
Nicholas Nethercote
08f8bf00c2 Added two new events: pre_deliver_signal and post_deliver_signal.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1434
2003-02-24 10:36:48 +00:00
Nicholas Nethercote
48b80f2249 Added a useful skin instrumentation function.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1433
2003-02-24 10:32:51 +00:00
Nicholas Nethercote
cf515e3eef Increased maximum number of non-compact helpers.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1432
2003-02-24 10:21:45 +00:00
Julian Seward
3276c2b5c7 Initial rough hack to spot the stack segment at startup by looking
for a rwx mapping which contains the startup %esp.

Might be better to look for just rw-.  Stack might not be executable
if there's a noexec patch, and x86-64 actually enforces the x bit
distinctly from r.

--> Look for just rw-.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1431
2003-02-23 03:54:59 +00:00
Julian Seward
096df69efa Fix comment bug.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1429
2003-02-23 03:40:03 +00:00
Julian Seward
4a70193610 Make poll() return (errno==EINTR) if the poll is interrupted by a signal.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1428
2003-02-23 03:37:58 +00:00
Julian Seward
9065d62ecc Hopefully deal with system 252 (__NR_exit_group) correctly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1427
2003-02-23 03:26:08 +00:00
Julian Seward
e9b2b11029 ---> 1.9.4
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1426
2003-02-23 03:25:36 +00:00
Julian Seward
243b69e9b7 Support kernels > 2.5.43 (David Kimdon <dwhedon@debian.org>)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1425
2003-02-23 03:09:33 +00:00
Julian Seward
1ae9a3b631 Apply the following:
The veneers for msgrcv in vg_intercept.c and vg_libpthread.c are not
returning the number of bytes read correctly - they always return zero
for any non-error case, which causes programs using msgrcv to behave
somewhat non-optimally when running under valgrind ;-)

Attached is a patch against 1.9.3 which fixes this.

Tom

--
Tom Hughes (thh@cyberscience.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1424
2003-02-23 03:00:29 +00:00
Julian Seward
2b039db360 Further cleanups re new method for finding the stack segment at
startup.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1423
2003-02-23 01:41:17 +00:00
Julian Seward
424913d48b Initial rough hack to spot the stack segment at startup by looking
for a rwx mapping which contains the startup %esp.  This should be
more robust than the previous mechanism, which checked a small number
of known places and gave up if none matched.  This change is motivated
by Gentoo Linux's high security mode, in which the stack location is
chosen randomly for each new process.

Thanks to Catherine Allen for helping out on this.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1422
2003-02-23 01:25:51 +00:00
Nicholas Nethercote
3e0ad40f18 Changed comments only: added a couple of missing syscall numbers.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1421
2003-02-19 11:39:02 +00:00
Nicholas Nethercote
8e61b9bc0d Committed Jeremy F's patch 86:
Fix a bug introduced in err_extra changes; not all errors have an 'extra'.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1420
2003-02-17 10:09:19 +00:00
Nicholas Nethercote
3d007bbf9a Fixed a minor bug -- the condition for determining whether
VG_(handle_esp_assignment)() was needed by a skin (and thus whether to register
it in the baseBlock) was different to that used when determining whether to
call it in code generation... so it could be (attempted to be) called having
not been registered.

Fixed this by consistifying the conditions, using a function
VG_(need_to_handle_esp_assignment)() that is used in both places.  The bug
hadn't been found previously because no existing skin exercised the mismatched
conditions in conflicting ways.

Also took VG_(track).post_mem_write out of consideration because it's no longer
important (due to a change in how stack switching is detected).

----
Improved the error message for when a helper can't be found in the baseBlock --
now looks up the debug info to tell you the name of the not-found function.

----
Increased the number of noncompact helpers allowed from 8 to 24

----
Removed a magic number that was hardcoded all over the place, introducing
VG_MAX_REGS_USED for the size of the arrays needed by VG_(get_reg_usage)()

----
Also added these functions

   VG_(get_archreg)()
   VG_(get_thread_archreg)()
   VG_(get_thread_shadow_archreg)()
   VG_(set_thread_shadow_archreg)()

which can be useful for skins.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1419
2003-02-10 10:17:26 +00:00
Nicholas Nethercote
6959fab730 Fix really stupid cut + paste error.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1418
2003-02-06 08:17:08 +00:00
Nicholas Nethercote
a3862bfb1b Ugh, fixed it properly this time.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1417
2003-02-05 22:08:58 +00:00
Nicholas Nethercote
6d6d33c360 Fixed comment typo.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1416
2003-02-05 22:06:48 +00:00
Nicholas Nethercote
e96c064080 Made VGOFF_(helper_idiv_64_32) and all the similar helper offsets visible to
skins, so they can determine which helper is being called for CALLM
instructions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1415
2003-02-03 12:33:31 +00:00
Nicholas Nethercote
c273195e12 Minor documentation update about 'details'.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1414
2003-02-03 12:21:53 +00:00
Nicholas Nethercote
94e46fbb49 Made the setting of VG_(details).avg_translation_sizeB optional, defaulting to
100 bytes (added VG_DEFAULT_TRANS_SIZEB).  Took the now-unnecessary settings
out of Nulgrind and CoreCheck.  Also made .avg_translation_sizeB a UInt (from
an Int), to avoid possibility of negatives.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1413
2003-02-03 12:20:07 +00:00
Nicholas Nethercote
124b819366 Added some functions for skins to access shadow registers:
VG_(get_shadow_archreg), VG_(set_shadow_archreg), VG_(shadow_archreg_address).
Curiously, the only way skins could previously access them was with
VG_(shadow_reg_offset), which wasn't very flexible.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1412
2003-02-03 12:03:22 +00:00
Nicholas Nethercote
2fd134d260 Added a comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1411
2003-02-03 11:25:34 +00:00
Nicholas Nethercote
c8a14631c3 Renamed VG_(nameCondcode)() as VG_(name_UCondcode)() to make it consistent
with similar functions, and made it visible to skins (useful).

Also bumped up the skin interface minor version number due to this change; this
bumping will cover any other binary-compatible changes between now and the next
release (after 1.9.3).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1410
2003-02-03 11:17:46 +00:00
Nicholas Nethercote
4483794906 Fixed minor error in --trace-codegen=1xxxx output that meant 'shrdl' was being
printed as 'shldl'.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1409
2003-02-03 11:08:52 +00:00
Nicholas Nethercote
bf92399c28 Made more informative the error message that is shown when liveness problems
occur... this is helpful when writing skins, because it's easy for problems
with SK_(instrument)() to screw it up.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1408
2003-02-03 11:07:03 +00:00
Nicholas Nethercote
b1bf3397b1 Added VG_(get_obj)().
Also added declaration for VG_(get_error_where)() to vg_skin.h (which should
have been included with the last commit).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1407
2003-01-28 20:40:57 +00:00
Nicholas Nethercote
57dbd484b8 Two minor changes:
- When recording errors, VG_(dup_extra_and_update)() previously was only
    called if the 'extra' field was non-NULL.  Now it's always called.
    This is for two reasons:

      a. The 'extra' field could be holding a non-pointer value that just
         happens to be 0
      b. The skin might want to update the error, even if it doesn't use
         the 'extra' field.

    A pretty minor change that shouldn't upset anybody.

  - Made the ExeContext 'where' field of an error visible to skins, by
    adding VG_(get_error_where)().  This can be useful, eg. for comparing
    errors for equality.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1406
2003-01-28 19:59:38 +00:00
Nicholas Nethercote
50cfcea122 Small changes to expected output, due to recent changes in leak-check
reporting.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1405
2003-01-28 19:53:09 +00:00
Julian Seward
88f01cdebf I forgot to get rid of these when deleting the client stack perms stuff.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1404
2003-01-05 13:11:55 +00:00
Julian Seward
1efa0352a6 Add syscall 185 (__NR_capset). From Gerald Carter <jerry@samba.org>.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1403
2003-01-05 12:35:19 +00:00
Julian Seward
3a71cb3483 Only complain three times about unhandled ioctls, then shut up. Stops
it complaining endlessly when running kscd.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1402
2003-01-05 12:19:35 +00:00
Julian Seward
b5bd8da58d Increase default bb limit from 1e+12 to 1e+15. The former limit could
easily be reached in ~12 hours flat out computation on a fast machine
with a simple skin.  It happened to me.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1401
2003-01-05 12:16:30 +00:00
Julian Seward
77a3132693 When ignoring memcheck-style client requests for block permissions
changes, print a message the first 3 times so the user at least knows
these requests are getting ignored.  If I was less lazy I would make
these requests -- at least those pertaining to memory addressibility
-- be done properly.  But I'm too lazy.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1400
2002-12-28 13:09:57 +00:00
Julian Seward
61ee476cc0 Remove the mechanism which allowed clients to set block permissions
on their stacks and have those blocks automatically cleared when the
stack retreats past them.  This never really worked, certainly didn't
work in a multithreaded setting, and slowed everything down due to
having to do even more stuff at %esp changes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1399
2002-12-28 12:55:48 +00:00
Julian Seward
cc862977b8 Recognise Leak suppressions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1398
2002-12-28 12:36:55 +00:00
Julian Seward
96b5ae06ff synth_jcond_lit: fix bug in the sequences generated for LE/NLE.
These assumed that ROR sets the P and Z flags and in fact it
sets neither.  Add an extra OR insn to really set those flags.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1397
2002-12-28 00:19:00 +00:00
Julian Seward
ad699fe61e Minor cleanup and verification of the lazy-eflag optimisation stuff.
As of now it is correct, following several hours study.

- Rename upd_cc parameters to simd_flags since that's what they
  really mean: does this insn interact at all with %EFLAGS
  (the simulated flags) ?

- Have a convention that calls to new_emit which specify
  FlagsEmpty for both the def and use sets should pass False
  as the simd_flags parameter; this seems more logical than
  saying True.  From partial evaluation of new_emit with
  these args one can see it does nothing under such circumstances,
  as one would hope.

- Add an alternative, unused implementation of new_emit in
  which the state space is explicitly enumerated.  Instructive.

--------------------------------------------------------------


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1396
2002-12-28 00:04:08 +00:00
Julian Seward
7a292adda5 Fix type errors in args to VG_(new_emit). No practical effect, since
(Int)False == (Int)FlagsEmpty, but still.

Whilst hunting (completely unsuccessfully) for some bug causing
MySQL to malfunction with some skins (memcheck), or with most
skins when --single-step=yes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1395
2002-12-26 17:10:12 +00:00
Julian Seward
18722f68c7 Implement pthread_getconcurrency, in the same way as LinuxThreads does it.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1393
2002-12-26 12:16:11 +00:00
Julian Seward
341ae8c0be Fix longstanding bug in make_thread_jump_to_cancelhdlr, which caused
pthread_join to a cancelled thread not return PTHREAD_CANCELED as it
should.  This was due to a mix up with stack offsets.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1392
2002-12-26 11:51:50 +00:00
Julian Seward
8da1474525 Don't panic on encountering a LeakSupp.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1391
2002-12-26 11:50:21 +00:00