NetBSD Problem Report #48497

From wiz@yt.nih.at  Sat Jan  4 12:58:33 2014
Return-Path: <wiz@yt.nih.at>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 25731A6469
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  4 Jan 2014 12:58:33 +0000 (UTC)
Message-Id: <20140104125825.C4FB32AC0D8@yt.nih.at>
Date: Sat,  4 Jan 2014 13:58:25 +0100 (CET)
From: Thomas Klausner <wiz@NetBSD.org>
Reply-To: Thomas Klausner <wiz@NetBSD.org>
To: gnats-bugs@NetBSD.org
Subject: realpath() does not conform to POSIX 2008
X-Send-Pr-Version: 3.95

>Number:         48497
>Category:       lib
>Synopsis:       realpath() does not conform to POSIX 2008
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 04 13:00:00 +0000 2014
>Closed-Date:    Tue Nov 03 22:38:58 +0000 2015
>Last-Modified:  Tue Nov 03 22:38:58 +0000 2015
>Originator:     Thomas Klausner
>Release:        NetBSD 6.99.28
>Organization:
Curiosity is the very basis of education and if you tell me that 
curiosity killed the cat, I say only that the cat died nobly.
- Arnold Edinborough
>Environment:


System: NetBSD yt.nih.at 6.99.28 NetBSD 6.99.28 (KVOTHE) #23: Fri Dec 27 21:42:38 CET 2013 wiz@yt.nih.at:/archive/foreign/src/sys/arch/amd64/compile/obj/KVOTHE amd64
Architecture: x86_64
Machine: amd64
>Description:
In the 2008 edition, realpath() was extended to allow NULL as second argument.
The description is:

"If resolved_name is a null pointer, the generated pathname shall
be stored as a null-terminated string in a buffer allocated as if
by a call to malloc()."

For details, see
http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html

The problem is that NetBSD currently just causes core dumps when
programs expect that behaviour to be supported.
>How-To-Repeat:
Compile code that passes NULL as second argument (like wip/notmuch
if compiled without one of the patches in that package) and see a
core dump.
>Fix:
Implement support, please. Or at least catch NULL and return EINVAL
or similar.

>Release-Note:

>Audit-Trail:
From: Mateusz Kocielski <shm@digitalsun.pl>
To: gnats-bugs@NetBSD.org
Cc: wiz@NetBSD.org
Subject: Re: lib/48497
Date: Tue, 3 Nov 2015 13:59:12 +0000

 Hi there,

  it seems that it was already fixed by christos@

  http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/gen/getcwd.c.diff?r1=1.51&r2=1.52&only_with_tag=MAIN

  but this change is not pulled-up. Close it or request for pull-up?

  Best Regards,
  Mateusz Kocielski

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, lib-bug-people@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, 
	Thomas Klausner <wiz@NetBSD.org>
Cc: 
Subject: Re: lib/48497
Date: Tue, 3 Nov 2015 09:05:31 -0500

 On Nov 3,  2:00pm, shm@digitalsun.pl (Mateusz Kocielski) wrote:
 -- Subject: Re: lib/48497


 Looks like it is pulled-up to -7.

 christos

State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Tue, 03 Nov 2015 22:38:58 +0000
State-Changed-Why:
Fixed by christos, thanks!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.