[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#492596: pthread_create memory leak



Package: libc6
Version: 2.3.6.ds1-13etch5
Severity: serious

This simple program generates a memory leak of 114 (valgrind tells me 
so), this does not happen on other distro as ubuntu.

////////////////////////////////////
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
 int i;
void* log_thread(void*n){
  while (i){
    #ifdef __WIN32__
    Sleep(*(1000)/1000);
    #else
    usleep(10000);
    #endif
  }
  return NULL;
}

int main(int argc, char *argv[])
{
  i = 1;
  pthread_t pt;
  pthread_create(&(pt), NULL, log_thread, NULL);
  usleep(100000);
  i = 0;
  pthread_join(pt, NULL);
  return 0;
}
///////////////////////////////////////////////////////////////
-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.23.1
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages libc6 depends on:
ii  tzdata                      2007j-1etch1 Time Zone and Daylight Saving Time

libc6 recommends no packages.

-- no debconf information



Reply to: