Package: valgrind
Version: 1:3.5.0-2
Severity: normal

halo!

When trying to open too many threads in a process, pthread_create() normally
returns EAGAIN. When the process is run under valgrind, it returns EINVAL:

lemonl...@debian:~$ cat test2.c
#include <stdio.h>
#include <pthread.h>

#define NTHREADS 500

pthread_t threads [NTHREADS];

void *func (void *__unused)
{
        return NULL;
}

int main ()
{
        int i;

        for (i = 0; i < NTHREADS; i++) {
                int err = pthread_create (&threads [i], NULL, func, NULL);
                if (err) {
                        printf ("*** %d: %s\n", i, strerror (err));
                        break;
                }
        }

        for (i--; i >= 0; i--)
                pthread_join (threads [i], NULL);

        return 0;
}
lemonl...@debian:~$ gcc -o test2 test2.c -pthread
lemonl...@debian:~$ ./test2
*** 382: Resource temporarily unavailable
lemonl...@debian:~$ valgrind ./test2
==9896== Memcheck, a memory error detector
==9896== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==9896== Using Valgrind-3.5.0-Debian and LibVEX; rerun with -h for copyright 
info
==9896== Command: ./test2
==9896==
==9896== Conditional jump or move depends on uninitialised value(s)
==9896==    at 0x400BF88: ??? (in /lib/ld-2.10.1.so)
==9896==    by 0x40033F2: ??? (in /lib/ld-2.10.1.so)
==9896==    by 0x4014980: ??? (in /lib/ld-2.10.1.so)
==9896==    by 0x4000C7F: ??? (in /lib/ld-2.10.1.so)
==9896==    by 0x4000856: ??? (in /lib/ld-2.10.1.so)
==9896==

(...some more "conditional jump or move depends on uninitialised value(s)"...)

==9896==
==9896== Conditional jump or move depends on uninitialised value(s)
==9896==    at 0x400A99C: ??? (in /lib/ld-2.10.1.so)
==9896==    by 0x40032DC: ??? (in /lib/ld-2.10.1.so)
==9896==    by 0x4014980: ??? (in /lib/ld-2.10.1.so)
==9896==    by 0x4000C7F: ??? (in /lib/ld-2.10.1.so)
==9896==    by 0x4000856: ??? (in /lib/ld-2.10.1.so)
==9896==
*** 361: Invalid argument
==9896==
==9896== HEAP SUMMARY:
==9896==     in use at exit: 0 bytes in 0 blocks
==9896==   total heap usage: 361 allocs, 361 frees, 49,096 bytes allocated
==9896==
==9896== All heap blocks were freed -- no leaks are possible
==9896==
==9896== For counts of detected and suppressed errors, rerun with: -v
==9896== Use --track-origins=yes to see where uninitialised values come from
==9896== ERROR SUMMARY: 13 errors from 6 contexts (suppressed: 0 from 0)
lemonl...@debian:~$


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages valgrind depends on:
ii  libc6                         2.10.1-7   GNU C Library: Shared libraries

Versions of packages valgrind recommends:
ii  gdb                           7.0-1      The GNU Debugger

Versions of packages valgrind suggests:
pn  alleyoop                      <none>     (no description available)
pn  kcachegrind                   <none>     (no description available)
pn  libc6-dbg                     <none>     (no description available)

-- no debconf information



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to