Debian Bug report logs - #20426
realpath(3) can't deal with circular symlinks

Package: libc6; Maintainer for libc6 is GNU Libc Maintainers <debian-glibc@lists.debian.org>; Source for libc6 is src:glibc (PTS, buildd, popcon).

Reported by: Peter Tobias <tobias@et-inf.fho-emden.de>

Date: Mon, 30 Mar 1998 14:48:01 UTC

Severity: normal

Done: unknown

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Fabrizio Polacco <fpolacco@debian.org>:
Bug#20426; Package man-db. (full text, mbox, link).


Acknowledgement sent to Peter Tobias <tobias@et-inf.fho-emden.de>:
New bug report received and forwarded. Copy sent to Fabrizio Polacco <fpolacco@debian.org>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Peter Tobias <tobias@et-inf.fho-emden.de>
To: submit@bugs.debian.org
Subject: man-db: mandb can't deal with circular symlinks
Date: Mon, 30 Mar 1998 03:43:30 +0200
Package: man-db
Version: 2.3.10-64

mandb --create dies with a segmentation fault when it tries to follow
a cirular symbolic link.

# ls -l /usr/man/man1/uudecode.1.gz /etc/alternatives/uudecode.1.gz
lrwxrwxrwx   1 root     root           27 Mar  2 11:44 /etc/alternatives/uudecode.1.gz -> /usr/man/man1/uudecode.1.gz
lrwxrwxrwx   1 root     root           31 Nov 24 05:26 /usr/man/man1/uudecode.1.gz -> /etc/alternatives/uudecode.1.gz


Thanks,

Peter

-- 
Peter Tobias <tobias@et-inf.fho-emden.de> <tobias@debian.org> <tobias@linux.de>
PGP ID EFAA400D, fingerprint = 06 89 EB 2E 01 7C B4 02  04 62 89 6C 2F DD F1 3C 


Information forwarded to debian-bugs-dist@lists.debian.org, Fabrizio Polacco <fpolacco@debian.org>:
Bug#20426; Package man-db. (full text, mbox, link).


Acknowledgement sent to fpolacco@icenet.fi:
Extra info received and forwarded to list. Copy sent to Fabrizio Polacco <fpolacco@debian.org>. (full text, mbox, link).


Message #10 received at 20426@bugs.debian.org (full text, mbox, reply):

From: fpolacco@icenet.fi
To: Peter Tobias <tobias@et-inf.fho-emden.de>, 20426@bugs.debian.org, control@bugs.debian.org
Subject: Re: Bug#20426: man-db: mandb can't deal with circular symlinks
Date: Thu, 2 Apr 1998 17:28:13 +0300
reassign 20426 libc6
retitle 20426 realpath(3) can't deal with circular symlinks
stop

On Mon, Mar 30, 1998 at 03:43:30AM +0200, Peter Tobias wrote:
> Package: man-db
> Version: 2.3.10-64
> 
> mandb --create dies with a segmentation fault when it tries to follow
> a cirular symbolic link.
> 

You're right, thank you for the report.
I've spent some hours debugging the "thing" on my slow 486, and I found ...
that I can do nothing.
The program calls realpath(3) which never returns, entering a loop which calls
canonicalize tons of times, allocating memory at line 124
              char *buf = __alloca (path_max);

ending in a segfault at line 132
(gdb) p buf
$3 = 0xbf7ffedc <Address 0xbf7ffedc out of bounds>


I have to reassign this bug to libc6 (sorry Dale); in fact, you get the same
segfault issuing the command  realpath(1) (in dwww, by LarsW.) with the
circular symlink as argument.

$ ls -la /etc/alternatives/uurecode.1.gz /usr/man/man1/uurecode.1.gz 
lrwxrwxrwx  27 Apr  2 10:19 /etc/alternatives/uurecode.1.gz -> /usr/man/man1/uurecode.1.gz
lrwxrwxrwx  31 Apr  2 10:19 /usr/man/man1/uurecode.1.gz -> /etc/alternatives/uurecode.1.gz

$ realpath /usr/man/man1/uurecode.1.gz 
Segmentation fault (core dumped)

$ ls -la core
-rw-------   1 fab      fab       8482816 Apr  2 17:21 core


Sorry for having to leave a segfault unsolved, but I don't know how to modify
glibc to make it avoid the loop in case of circular symlinks.

fab
-- 
| fpolacco@icenet.fi    fpolacco@debian.org    fpolacco@pluto.linux.it
| Líder Minimo del Pluto    -     Debian Developer & Happy Debian User
| 6F7267F5 fingerprint 57 16 C4 ED C9 86 40 7B 1A 69 A1 66 EC FB D2 5E


Bug reassigned from package `man-db' to `libc6'. Request was from fpolacco@icenet.fi to control@bugs.debian.org. (full text, mbox, link).


Changed bug title. Request was from fpolacco@icenet.fi to control@bugs.debian.org. (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon May 13 19:08:52 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.