Hide Forgot
Description of problem: I'm trying to track down a memory leak in XEmacs. I ran it under valgrind, and got this (with --trace-syscalls=yes): SYSCALL[14973,1]( 72) sys_fcntl[UNKNOWN] ( 6, 16, 34342956080 ) valgrind: m_syswrap/syswrap-linux.c:3660 (vgSysWrap_linux_sys_fcntl_before): Assertion 'Unimplemented functionality' failed. valgrind: valgrind ==14973== at 0x3804ACB6: report_and_quit (m_libcassert.c:209) ==14973== by 0x3804AE5C: vgPlain_assert_fail (m_libcassert.c:283) ==14973== by 0x380A67DA: vgSysWrap_linux_sys_fcntl_before (syswrap-linux.c:3660) ==14973== by 0x38085BD7: vgPlain_client_syscall (syswrap-main.c:1491) ==14973== by 0x38082A8C: handle_syscall (scheduler.c:899) ==14973== by 0x38083C39: vgPlain_scheduler (scheduler.c:1095) ==14973== by 0x38093684: run_a_thread_NORETURN (syswrap-linux.c:94) followed by valgrind quitting. Number 16 is F_GETOWN_EX. Version-Release number of selected component (if applicable): valgrind-3.6.1-6.fc16.x86_64 How reproducible: Always Steps to Reproduce: 1. Run XEmacs under valgrind 2. 3. Actual results: Valgrind reports an unimplemented fcntl and quits. Expected results: Valgrind keeps going so I can find the leak. Additional info: The source line of code in XEmacs does this: "fcntl (filedesc, F_GETOWN, 0);". It looks like glibc transforms that into a F_GETOWN_EX call; see do_fcntl() in sysdeps/unix/sysv/linux/fcntl.c.
Created attachment 549867 [details] Patch to add support for F_SETOWN_EX and F_GETOWN_EX I'm attaching the patch that I think is needed to fix this. However, attempting to build valgrind to try this patch failed in the configure step: checking for a supported OS... ok (linux-gnu) checking for the kernel version... unsupported (3.1.6-1.fc16.x86_64) configure: error: Valgrind works on kernels 2.4, 2.6 error: Bad exit status from /var/tmp/rpm-tmp.PACcHW (%build) How is valgrind supposed to be built on Fedora 16?
I added this to the end of %prep: sed -i "s/2\.6\.\*)/2.6.*|3.*)/" configure and the package built successfully. The patch from comment 1 does, in fact, fix the problem.
Should be fixed in valgrind-3.7.0-1.fc17.