Summary: | valgrind's libpthread.so: UNIMPLEMENTED FUNCTION: pthread_mutex_timedlock | ||
---|---|---|---|
Product: | [Developer tools] valgrind | Reporter: | Glenn Maynard <g_kde> |
Component: | general | Assignee: | Julian Seward <jseward> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jwillemsen, oiabm6211, seiderer123 |
Priority: | NOR | ||
Version: | 2.1.1 | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
Patch to implement pthread_mutex_timedlock
Testprogramm for incorrect timing. Improved patch to implement pthread_mutex_timedlock |
Description
Glenn Maynard
2004-03-25 04:19:49 UTC
*** Bug 89592 has been marked as a duplicate of this bug. *** Created attachment 7678 [details]
Patch to implement pthread_mutex_timedlock
This patch implemented pthread_mutex_timedlock in valgrind's pthreads library.
I tried the patch against CVS HEAD, and it looks like I'm getting a timeout on every call to pthread_mutex_timedlock() when in fact the lock should succeed without delay. It seems to work fine for me - can you construct a simple test case? or post the output of valgrind when run with --trace-pthread=all --trace-sched=yes? Created attachment 7698 [details] Testprogramm for incorrect timing. The calculation of ms_end is incorrect (for huge timeouts there is a overflow). The same as in bug 76845 (http://bugs.kde.org/show_bug.cgi?id=76845) with pthread_cond_timedwait(). Or use the attached testprogramm with the following commandline (should give a timeout of 4294968 seconds): time valgrind --tool=none ./a.out 4294968 100 ==7193== Nulgrind, a binary JIT-compiler for x86-linux. ==7193== Copyright (C) 2002-2004, and GNU GPL'd, by Nicholas Nethercote. ==7193== Using valgrind-2.3.0.CVS, a program supervision framework for x86-linux. ==7193== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al. ==7193== For more details, rerun with: -v ==7193== ==7193== real 0m0.904s user 0m0.160s sys 0m0.000s Created attachment 7700 [details] Improved patch to implement pthread_mutex_timedlock Improved Tom Hughes previous patch: - fix timeout calculation (according to patch for bug 76845) - fix delta calculation in vg_scheduler.c (according to patch for bug 76845) Thanks, but I'd rather not confuse this bug by bringing the issue of long timeouts into it - that is still pending further review by Jeremy if I'm reading the other bug correctly. There has been no more feedback regarding this patch and it seems to work for me so I have committed my original patch. If anybody does find a problem with it timing out when it shouldn't then please open a new bug. As far as the long timeout issue goes I'm going to go and have a look at that bug now and see what I can do about commiting a fix for both condition variables and mutexes. |