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

Bug#380504: libc6: segfault in ctermid(NULL)



Hi!

On Sun, Jul 30, 2006 at 08:24:00PM +0400, Sheplyakov Alexei wrote:
> Package: libc6
> Version: 2.3.6-16
> Severity: normal
> 
> Hello!
> 
> This simple program:
> 
> $ cat ctermid_broken.c
> #include <stdio.h>
> 
> int main(int argc, char** argv)
> {
> 	char* s;
> 	s = ctermid(NULL);
> 	return 0;
> }
> 
> gets SIGSEGV:
> 
> $ gcc -O0 -g -o ctermid_broken ctermid_broken.c
> $ ./ctermid_broken 
> Segmentation fault (core dumped)
> 

I am only able to reproduce the bug with the linuxthreads version of the
libc, but not with the nptl version. That's mean you can workaround the
bug by using a 2.6 kernel instead. That's a bit strange because this
small example does not uses the threads nor is linked to libpthread...

I will try to find if the problem is architecture specific or not, that
may help to debug it. Note that the problem is not known upstream, and
that they probably won't fix it (problem specific to 2.3.6 and
linuxthreads).

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net



Reply to: