Package: libc6
Version: 2.24-10
Severity: normal
Tags: patch

Hi,

there is a duplicate from mainstream bugzilla: 
https://sourceware.org/bugzilla/show_bug.cgi?id=21386
Pid caching is backported in Debian, but there is a small leftover.

The patch is available in mainstream git: 
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1d2bc2eae969543b89850e35e532f3144122d80a

Could you please to backport it in Debian?

** The problem description ***
Here is a small program which triggers an assertion in glibc.
$ cat test.c 
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/wait.h>
#include <sched.h>
#include <unistd.h>
#include <stdio.h>

int main()
{
        int i;
        for (i = 0; i < 2; i++) {
                pid_t pid;

                unshare(CLONE_NEWPID);
                pid = fork();
                printf("%d: %d\n", getpid(), pid);
        }
        while (wait(NULL) > 0);
        return 0;
}

$ gcc test.c -Wall -o t && ./t
25131: 25132
25131: 25133
2: 0
1: 0
1: 3
t: ../sysdeps/nptl/fork.c:156: __libc_fork: Assertion `THREAD_GETMEM (self, 
tid) != ppid' failed.

Thanks,
Kirill

--- System information. ---
Architecture: 
Kernel:       Linux 4.11.0+

Debian Release: 9.0
  500 unstable        ftp.ru.debian.org 
  500 testing         ftp.ru.debian.org 
  500 stable-updates  ftp.ru.debian.org 
  500 stable          security.debian.org 
  500 stable          repo.skype.com 
  500 stable          ftp.ru.debian.org 
    1 experimental    ftp.ru.debian.org 

--- Package information. ---
Package's Depends field is empty.

Package's Recommends field is empty.

Package's Suggests field is empty.

Reply via email to