|
From: Amadeus W. M. <ama...@ca...> - 2006-08-07 04:57:29
|
On Mon, 07 Aug 2006 05:41:04 +0200, Peter "Firefly" Lund wrote: > On Sun, 6 Aug 2006, Amadeus W. M. wrote: > >> [quoted text muted] > > Here's the background: > > http://lwn.net/Articles/172149/ > http://lwn.net/Articles/172134/ > > I think you misunderstand the situation: you are not waiting for the > kernel to catch up, you are waiting for valgrind to catch up. This is a > system call glibc issues even on kernels that don't support it because > that's easier than first checking whether it is actually supported. If it > isn't, it is quite harmless. glibc very often uses this technique (you > can see for yourself by stracing just about any program). In some cases > a new system call is tried first and if that fails, an older and less > capable system call is tried next. This is often faster and easier than > checking kernel version numbers. It also handles backported system call > implementations. > I don't know what I was thinking. As long as valgrind does not have a wrapper for that syscall, it would still issue that warning, even on a kernel that does have that system call. > The thing is, valgrind needs to understand what the program tries to tell > the kernel because, who knows, it could be important. > > You can probably either use an older glibc or if you are lucky tell it to > assume it has an older kernel from before this call was introduced (by > setting the ASSUME_KERNEL environment variable). Or you can write a very > simple syscall wrapper for valgrind that just returns -ENOSYS. There are > probably others of that kind already. > > Good luck :) > Like so, you mean? PRE(sys_set_robust_list) { PRINT("sys_set_robust_list ( %p, %d )", ARG1,ARG2); PRE_REG_READ2(long, "set_robust_list", struct vki_robust_list_head *, head, vki_size_t, len); /* Just check the robust_list_head structure is readable - don't try and chase the list as the kernel will only read it when the thread exits so the current contents is irrelevant. */ if (ARG1 != 0) PRE_MEM_READ("set_robust_list(head)", ARG1, ARG2); } He, he! It's already done in valgrind-3.2.0. Compiled and installed, and now I got rid of the warning. The bad news is I'm still getting the errors that I thought were being triggered by the missing wrapper. The most trivial program in gtkmm produces 2 errors: #include <gtkmm.h> // Compilation: // // g++ -g -Wall -o main `pkg-config gtkmm-2.4 --cflags --libs` main.C int main(int argc, char * argv[]) { Gtk::Main m(argc, argv); return 0; } If valgrind is correct, then the two errors reported must be in gtk/gtkmm or in the X server. |