https://bugs.kde.org/show_bug.cgi?id=381815

--- Comment #4 from Kirill A. Korinsky <kir...@korins.ky> ---
Hey,

I can't trace valgrind because it calls fcntl over this code:
https://gist.github.com/catap/a20b8b1f46b0ba79b9f7297e73df0563

But I can run it in lldb ant provide some output to you.

With ulimit -n 1024:

➜  bin ulimit -n 1024
➜  bin env RETRACE_CONFIG=./retrace.conf.rnp
VALGRIND_LAUNCHER=/Users/catap/Documents/Riboseinc/valgrind/bin/executable_path=./valgrind
lldb -- ../lib/valgrind/memcheck-amd64-darwin /tmp/a.out
(lldb) target create "../lib/valgrind/memcheck-amd64-darwin"
Current executable set to '../lib/valgrind/memcheck-amd64-darwin' (x86_64).
(lldb) settings set -- target.run-args  "/tmp/a.out"
(lldb) b vgPlain_safe_fd
Breakpoint 1: where = memcheck-amd64-darwin`vgPlain_safe_fd + 18 at
m_libcfile.c:59, address = 0x0000000258081452
(lldb) r
Process 14822 launched: '../lib/valgrind/memcheck-amd64-darwin' (x86_64)
Process 14822 stopped
* thread #1, stop reason = breakpoint 1.1
    frame #0: 0x0000000258081452 memcheck-amd64-darwin`vgPlain_safe_fd(oldfd=3)
at m_libcfile.c:59
   56   {
   57      Int newfd;
   58   
-> 59      vg_assert(VG_(fd_hard_limit) != -1);
   60   
   61      newfd = VG_(fcntl)(oldfd, VKI_F_DUPFD, VG_(fd_hard_limit));
   62      if (newfd != -1)
(lldb) n
Process 14822 stopped
* thread #1, stop reason = step over
    frame #0: 0x00000002580814ac memcheck-amd64-darwin`vgPlain_safe_fd(oldfd=3)
at m_libcfile.c:61
   58   
   59      vg_assert(VG_(fd_hard_limit) != -1);
   60   
-> 61      newfd = VG_(fcntl)(oldfd, VKI_F_DUPFD, VG_(fd_hard_limit));
   62      if (newfd != -1)
   63         VG_(close)(oldfd);
   64   
(lldb) n
Process 14822 stopped
* thread #1, stop reason = step over
    frame #0: 0x00000002580814ba memcheck-amd64-darwin`vgPlain_safe_fd(oldfd=3)
at m_libcfile.c:62
   59      vg_assert(VG_(fd_hard_limit) != -1);
   60   
   61      newfd = VG_(fcntl)(oldfd, VKI_F_DUPFD, VG_(fd_hard_limit));
-> 62      if (newfd != -1)
   63         VG_(close)(oldfd);
   64   
   65      /* Set the close-on-exec flag for this fd. */
(lldb) p newfd
(Int) $0 = 1024
(lldb) ^D


With ulimit 262144:

➜  bin env RETRACE_CONFIG=./retrace.conf.rnp
VALGRIND_LAUNCHER=/Users/catap/Documents/Riboseinc/valgrind/bin/executable_path=./valgrind
lldb -- ../lib/valgrind/memcheck-amd64-darwin /tmp/a.out
(lldb) target create "../lib/valgrind/memcheck-amd64-darwin"
Current executable set to '../lib/valgrind/memcheck-amd64-darwin' (x86_64).
(lldb) settings set -- target.run-args  "/tmp/a.out"
(lldb) b vgPlain_safe_fd
Breakpoint 1: where = memcheck-amd64-darwin`vgPlain_safe_fd + 18 at
m_libcfile.c:59, address = 0x0000000258081452
(lldb) r
Process 14653 launched: '../lib/valgrind/memcheck-amd64-darwin' (x86_64)
Process 14653 stopped
* thread #1, stop reason = breakpoint 1.1
    frame #0: 0x0000000258081452 memcheck-amd64-darwin`vgPlain_safe_fd(oldfd=3)
at m_libcfile.c:59
   56   {
   57      Int newfd;
   58   
-> 59      vg_assert(VG_(fd_hard_limit) != -1);
   60   
   61      newfd = VG_(fcntl)(oldfd, VKI_F_DUPFD, VG_(fd_hard_limit));
   62      if (newfd != -1)
(lldb) n
Process 14653 stopped
* thread #1, stop reason = step over
    frame #0: 0x00000002580814ac memcheck-amd64-darwin`vgPlain_safe_fd(oldfd=3)
at m_libcfile.c:61
   58   
   59      vg_assert(VG_(fd_hard_limit) != -1);
   60   
-> 61      newfd = VG_(fcntl)(oldfd, VKI_F_DUPFD, VG_(fd_hard_limit));
   62      if (newfd != -1)
   63         VG_(close)(oldfd);
   64   
(lldb) n
Process 14653 stopped
* thread #1, stop reason = step over
    frame #0: 0x00000002580814ba memcheck-amd64-darwin`vgPlain_safe_fd(oldfd=3)
at m_libcfile.c:62
   59      vg_assert(VG_(fd_hard_limit) != -1);
   60   
   61      newfd = VG_(fcntl)(oldfd, VKI_F_DUPFD, VG_(fd_hard_limit));
-> 62      if (newfd != -1)
   63         VG_(close)(oldfd);
   64   
   65      /* Set the close-on-exec flag for this fd. */
(lldb) p newfd
(Int) $0 = -1
(lldb)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to