perl 5.10.1-12ubuntu2 segfaults

Bug #659115 reported by Paulo Matos on 2010-10-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glibc (Ubuntu)
Undecided
Unassigned
perl (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: perl

I don't know enough of perl to provide better diagnostics without some guidance but I used to run some personal scripts just fine which now segfault perl.

pmatos@pm18pc01:~/$ perl -d build.pl -build make -module kart

Loading DB routines from perl5db.pl version 1.32
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

Signal SEGV at /localhome/pmatos/build/main/make/build_config.pm line 172
        require build_config.pm called at build/main/make/build.pl line 199
        main::BEGIN() called at /localhome/pmatos/build/main/make/build_config.pm line 0
        eval {...} called at /localhome/pmatos/build/main/make/build_config.pm line 0
Aborted
pmatos@pm18pc01:~/$ perl build/main/make/build.pl -build make -module kart
Segmentation fault

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: perl 5.10.1-12ubuntu2
ProcVersionSignature: Ubuntu 2.6.35-22.34-generic 2.6.35.4
Uname: Linux 2.6.35-22-generic x86_64
Architecture: amd64
CheckboxSubmission: 4d784141110409aafdf5c588e7c56115
CheckboxSystem: 6ce041aeed0a2c17b3343b66d157175d
Date: Tue Oct 12 12:31:58 2010
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_GB.utf8
 SHELL=/bin/bash
SourcePackage: perl

Paulo Matos (pmatos) wrote :
Paulo Matos (pmatos) wrote :

strace

Paulo Matos (pmatos) wrote :

This is actually not a perl problem. There seems to be an underlying problem I was still not able to pinpoint.
When I start screen, it also segfaults. strace shows the problem also after opening /etc/passwd.
uname({sys="Linux", node="pm18pc01", ...}) = 0
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

This is straight after a Maverick upgrade. Anyone with tips on where I might look for the problem?

Paulo Matos (pmatos) wrote :

Since this is not about perl, how can I edit the title?

Paulo Matos (pmatos) wrote :

Managed to reproduce this by reducing screen.c from screen. Attached.

Check the interaction:
pmatos@pm18pc01:~/Temp/screen-4.0.3$ gcc -O0 -ggdb -o screen screen.i
screen.i: In function ‘main’:
screen.i:80: warning: assignment makes pointer from integer without a cast
screen.i:82: warning: assignment makes pointer from integer without a cast
pmatos@pm18pc01:~/Temp/screen-4.0.3$ ./screen
Segmentation fault
pmatos@pm18pc01:~/Temp/screen-4.0.3$ gdb screen
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /localhome/pmatos/Temp/screen-4.0.3/screen...done.
(gdb) break main
Breakpoint 1 at 0x40055f: file screen.i, line 80.
(gdb) run
Starting program: /localhome/pmatos/Temp/screen-4.0.3/screen

Breakpoint 1, main (ac=1, av=-7864) at screen.i:80
80 LoginName = getlogin ();
(gdb) n
82 if (LoginName[0] != '\0')
(gdb) p LoginName
$1 = 0xfffffffff7dd8ea0 <Address 0xfffffffff7dd8ea0 out of bounds>

This has got to be a but in getlogin, therefore, probably libc. getlogin either returns a valid char * pointer or NULL or failure but never address out of bounds. Dereferencing it causes the segfault.

It seems the bug is in libc or below it. I have 2.12.1-0ubuntu7.

Can anybody else reproduce this?

Paulo Matos (pmatos) on 2010-10-13
Changed in perl (Ubuntu):
status: New → Invalid
Paulo Matos (pmatos) on 2010-10-13
tags: added: getlogin glibc libc
Paulo Matos (pmatos) wrote :

This seems to have been already reported in the glibc mailing list but I can't find any other open bugs for this at the time.
http://www.cygwin.com/ml/libc-help/2010-08/msg00030.html

Paulo Matos (pmatos) wrote :

This was fixed in archlinux:
https://bugs.archlinux.org/task/20513

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers