|
From: Christian B. <bor...@de...> - 2011-06-11 09:07:45
|
Philippe, can you look into this? when running a current valgrind on its own configure script I get errors like: ./vg-in-place --trace-children=yes --tool=none ./configure [...] valgrind: m_libcfile.c:73 (vgPlain_safe_fd): Assertion 'newfd >= VG_(fd_hard_limit)' failed. ==20033== at 0x3807F5DD: report_and_quit (m_libcassert.c:210) ==20033== by 0x3807F7A7: vgPlain_assert_fail (m_libcassert.c:284) ==20033== by 0x380807E8: vgPlain_safe_fd (m_libcfile.c:73) ==20033== by 0x3803A27A: open_fifo (remote-utils.c:75) ==20033== by 0x3803B504: remote_open (remote-utils.c:306) ==20033== by 0x38038844: call_gdbserver (m_gdbserver.c:614) ==20033== by 0x38039138: vgPlain_gdbserver_activity (m_gdbserver.c:826) ==20033== by 0x380394EA: vgPlain_gdbserver_prerun_action (m_gdbserver.c:529) ==20033== by 0x38039648: gdbserver_cleanup_in_child_after_fork (m_gdbserver.c:564) ==20033== by 0x38081FEA: vgPlain_do_atfork_child (m_libcproc.c:749) ==20033== by 0x3807068A: vgModuleLocal_do_fork_clone (syswrap-linux.c:369) ==20033== by 0x380776D9: vgSysWrap_x86_linux_sys_clone_before (syswrap-x86-linux.c:945) ==20033== by 0x38045143: vgPlain_client_syscall (syswrap-main.c:1498) ==20033== by 0x38041452: handle_syscall (scheduler.c:952) ==20033== by 0x38042616: vgPlain_scheduler (scheduler.c:1196) ==20033== by 0x38070794: run_a_thread_NORETURN (syswrap-linux.c:95) sched status: running_tid=1 Thread 1: status = VgTs_Runnable ==20033== at 0x4109DD7: fork (fork.c:130) ==20033== by 0x8087A61: make_child (in /bin/bash) ==20033== by 0x807AB69: ??? (in /bin/bash) ==20033== by 0x8077927: execute_command_internal (in /bin/bash) ==20033== by 0x8078742: execute_command (in /bin/bash) ==20033== by 0x8077FD7: execute_command_internal (in /bin/bash) ==20033== by 0x807B531: ??? (in /bin/bash) ==20033== by 0x80785F7: execute_command_internal (in /bin/bash) ==20033== by 0x8076DA6: ??? (in /bin/bash) ==20033== by 0x80783F1: execute_command_internal (in /bin/bash) ==20033== by 0x80B822D: parse_and_execute (in /bin/bash) ==20033== by 0x808E0FC: command_substitute (in /bin/bash) ==20033== by 0x8092633: ??? (in /bin/bash) ==20033== by 0x80940BD: ??? (in /bin/bash) ==20033== by 0x809437C: ??? (in /bin/bash) ==20033== by 0x80943D9: expand_string (in /bin/bash) ==20033== by 0x80AEB2B: ??? (in /bin/bash) ==20033== by 0x80AF786: do_redirections (in /bin/bash) ==20033== by 0x807AA51: ??? (in /bin/bash) ==20033== by 0x8077927: execute_command_internal (in /bin/bash) ==20033== by 0x8078742: execute_command (in /bin/bash) ==20033== by 0x8078278: execute_command_internal (in /bin/bash) ==20033== by 0x8078742: execute_command (in /bin/bash) ==20033== by 0x8078278: execute_command_internal (in /bin/bash) ==20033== by 0x8078742: execute_command (in /bin/bash) ==20033== by 0x8078278: execute_command_internal (in /bin/bash) ==20033== by 0x8078742: execute_command (in /bin/bash) ==20033== by 0x8078278: execute_command_internal (in /bin/bash) ==20033== by 0x80777C8: execute_command_internal (in /bin/bash) ==20033== by 0x8078742: execute_command (in /bin/bash) ==20033== by 0x8064C7E: reader_loop (in /bin/bash) ==20033== by 0x80642F4: main (in /bin/bash) |
|
From: Philippe W. <phi...@sk...> - 2011-06-11 17:27:58
|
Hello Christian,
> valgrind: m_libcfile.c:73 (vgPlain_safe_fd): Assertion 'newfd >= VG_(fd_hard_limit)' failed.
I have added a patch with a fix and a test for the above problem
(cfr bug 214909 comment 103).
The patch has been tested on f12/x86 and debian5/amd64 + tested that
valgrind --tool=none --trace-children=yes ./configure
works.
Here is the description of the problem and fix:
fix safe_fd exhaustion in fork chain caused by non closing of shared_mem_fd
Patch that fixes the problem reported by Christian Borntraeger.
The problem was created by keeping the shared memory mapped file opened
without reason till the process does an exec.
In case of a chain of forked processes (without exec), the range of safe_fd
reserved for Valgrind own usage becomes exhausted.
* coregrind/m_gdbserver/remote-utils.c :
do not VG_(safe_fd) shared_mem_fd (as it is now closed directly)
close shared_mem_fd once file is mmap-ed and written.
* gdbserver_tests/nlfork_chain.stderr.exp,nlfork_chain.vgtest,
fork_chain.c,nlfork_chain.stdout.exp:
new files
* gdbserver_tests/Makefile.am:
modified for new nlfork_chain testPhilippe
|
|
From: Julian S. <js...@ac...> - 2011-06-15 21:42:13
|
On Saturday, June 11, 2011, Philippe Waroquiers wrote: > Hello Christian, > > > valgrind: m_libcfile.c:73 (vgPlain_safe_fd): Assertion 'newfd >= > > VG_(fd_hard_limit)' failed. > > I have added a patch with a fix and a test for the above problem > (cfr bug 214909 comment 103). > [...] Committed as r11818. Christian, the problem should be gone now. J |