NetBSD Problem Report #54438

From gson@gson.org  Mon Aug  5 15:01:10 2019
Return-Path: <gson@gson.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 4DC107A189
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  5 Aug 2019 15:01:10 +0000 (UTC)
Message-Id: <20190805150103.E42979896BC@guava.gson.org>
Date: Mon,  5 Aug 2019 18:01:03 +0300 (EEST)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: makeoptions DEBUG="-g" documentation looks wrong
X-Send-Pr-Version: 3.95

>Number:         54438
>Category:       kern
>Synopsis:       makeoptions DEBUG="-g" documentation looks wrong
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 05 15:05:00 +0000 2019
>Closed-Date:    Mon Sep 09 19:03:11 +0000 2019
>Last-Modified:  Mon Sep 09 19:03:11 +0000 2019
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current
>Organization:

>Environment:
System: NetBSD
Architecture: x86_64
Machine: amd64
>Description:

The options(4) man page says:

     makeoptions DEBUG="-g"
     The -g flag causes netbsd.gdb to be built in addition to netbsd.
     netbsd.gdb is useful for debugging kernel crash dumps with gdb.  See
     gdb(1) for details.  This also turns on options DEBUG (which see).

I don't think the statement "This also turns on options DEBUG" is
actually true.  For example, running "config -x" on a daily snapshot
from http://nycdn.netbsd.org/pub/NetBSD-daily/HEAD/latest/amd64/ shows
that it was built with makeoptions DEBUG="-g", but options DEBUG was
not turned on:

  #options        DEBUG           # expensive debugging checks/support
  makeoptions     DEBUG="-g"      # compile full symbol table for CTF

Also, running nm on /netbsd does not show functions that are
defined only within #ifdef DEBUG, such as uvm_pagezerocheck().

The text in case has been there since options.4 revision 1.1,
dated October 20, 1996.  Does anyone remember how and when it
stopped being true, if it was ever true?

Fixing this by making the code match the documentation would be bad,
because release kernels should have makeoptions DEBUG="-g" so that we
can generate CTF debug info for dtrace, but should not have options
DEBUG as that would make them "not suitable for regular use".
Therefore, I propose making the documentation match the code by
removing the text "This also turns on options DEBUG (which see)."
Any objections?

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
    netbsd-bugs@netbsd.org
Subject: re: kern/54438: makeoptions DEBUG="-g" documentation looks wrong
Date: Tue, 06 Aug 2019 11:03:26 +1000

 > The text in case has been there since options.4 revision 1.1,
 > dated October 20, 1996.  Does anyone remember how and when it
 > stopped being true, if it was ever true?

 i don't recall it being true, and a quick check for at
 least sparc port shows DEBUG=-g as a make option was
 the same semantic as it is today.


 .mrg.

From: "Andreas Gustafsson" <gson@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54438 CVS commit: src/share/man/man4
Date: Tue, 20 Aug 2019 14:03:56 +0000

 Module Name:	src
 Committed By:	gson
 Date:		Tue Aug 20 14:03:56 UTC 2019

 Modified Files:
 	src/share/man/man4: options.4

 Log Message:
 Don't say that makeoptions DEBUG="-g" also turns on options DEBUG,
 because it does not.  Fixes PR kern/54438.


 To generate a diff of this commit:
 cvs rdiff -u -r1.506 -r1.507 src/share/man/man4/options.4

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->needs-pullups
State-Changed-By: gson@NetBSD.org
State-Changed-When: Tue, 20 Aug 2019 14:09:36 +0000
State-Changed-Why:
Deleted the offending text.


State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: gson@NetBSD.org
State-Changed-When: Wed, 04 Sep 2019 18:35:01 +0000
State-Changed-Why:
Pullup requested.


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54438 CVS commit: [netbsd-9] src/share/man/man4
Date: Thu, 5 Sep 2019 09:00:22 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Thu Sep  5 09:00:22 UTC 2019

 Modified Files:
 	src/share/man/man4 [netbsd-9]: options.4

 Log Message:
 Pull up following revision(s) (requested by gson in ticket #178):

 	share/man/man4/options.4: revision 1.507

 Don't say that makeoptions DEBUG="-g" also turns on options DEBUG,
 because it does not.  Fixes PR kern/54438.


 To generate a diff of this commit:
 cvs rdiff -u -r1.506 -r1.506.2.1 src/share/man/man4/options.4

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: gson@NetBSD.org
State-Changed-When: Mon, 09 Sep 2019 19:03:11 +0000
State-Changed-Why:
Pulled up.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.