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

            Bug ID: 381815
           Summary: Assertion 'newfd >= VG_(fd_hard_limit)' failed
           Product: valgrind
           Version: unspecified
          Platform: unspecified
                OS: OS X
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: jsew...@acm.org
          Reporter: kir...@korins.ky
  Target Milestone: ---

Good day!

I've tried to run valgrind (trunk, revision 16457) on macOS 10.12.5 and it
failed if I setup a huge number as file descriptors at ulimit.

For example:


➜  /tmp cat test.c      
int main() {
        return 0;
}
➜  /tmp clang test.c 
➜  /tmp ulimit -n 1024  
➜  /tmp valgrind ./a.out
==28447== Memcheck, a memory error detector
==28447== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==28447== Using Valgrind-3.14.0.SVN and LibVEX; rerun with -h for copyright
info
==28447== Command: ./a.out
==28447== 
==28447== Syscall param msg->desc.port.name points to uninitialised byte(s)
==28447==    at 0x1003A734A: mach_msg_trap (in
/usr/lib/system/libsystem_kernel.dylib)
==28447==    by 0x1003A6796: mach_msg (in
/usr/lib/system/libsystem_kernel.dylib)
==28447==    by 0x1003A0485: task_set_special_port (in
/usr/lib/system/libsystem_kernel.dylib)
==28447==    by 0x10053C10E: _os_trace_create_debug_control_port (in
/usr/lib/system/libsystem_trace.dylib)
==28447==    by 0x10053C458: _libtrace_init (in
/usr/lib/system/libsystem_trace.dylib)
==28447==    by 0x1000A59DF: libSystem_initializer (in
/usr/lib/libSystem.B.dylib)
==28447==    by 0x100017A1A:
ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in
/usr/lib/dyld)
==28447==    by 0x100017C1D:
ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in
/usr/lib/dyld)
==28447==    by 0x1000134A9:
ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned
int, char const*, ImageLoader::InitializerTimingList&,
ImageLoader::UninitedUpwards&) (in /usr/lib/dyld)
==28447==    by 0x100013440:
ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned
int, char const*, ImageLoader::InitializerTimingList&,
ImageLoader::UninitedUpwards&) (in /usr/lib/dyld)
==28447==    by 0x100012523:
ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int,
ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) (in
/usr/lib/dyld)
==28447==    by 0x1000125B8:
ImageLoader::runInitializers(ImageLoader::LinkContext const&,
ImageLoader::InitializerTimingList&) (in /usr/lib/dyld)
==28447==  Address 0x10488accc is on thread 1's stack
==28447==  in frame #2, created by task_set_special_port (???:)
==28447== 
==28447== 
==28447== HEAP SUMMARY:
==28447==     in use at exit: 18,307 bytes in 162 blocks
==28447==   total heap usage: 178 allocs, 16 frees, 24,451 bytes allocated
==28447== 
==28447== LEAK SUMMARY:
==28447==    definitely lost: 408 bytes in 8 blocks
==28447==    indirectly lost: 6,888 bytes in 8 blocks
==28447==      possibly lost: 72 bytes in 3 blocks
==28447==    still reachable: 32 bytes in 1 blocks
==28447==         suppressed: 10,907 bytes in 142 blocks
==28447== Rerun with --leak-check=full to see details of leaked memory
==28447== 
==28447== For counts of detected and suppressed errors, rerun with: -v
==28447== Use --track-origins=yes to see where uninitialised values come from
==28447== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 4 from 4)
➜  /tmp ulimit -n 262144
➜  /tmp valgrind ./a.out

valgrind: m_libcfile.c:68 (Int vgPlain_safe_fd(Int)): Assertion 'newfd >=
VG_(fd_hard_limit)' failed.
[1]    28477 segmentation fault  valgrind ./a.out
➜  /tmp

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

Reply via email to