NetBSD Problem Report #55202

From tsutsui@ceres.dti.ne.jp  Thu Apr 23 17:52:20 2020
Return-Path: <tsutsui@ceres.dti.ne.jp>
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 7670A1A9218
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 23 Apr 2020 17:52:20 +0000 (UTC)
Message-Id: <202004231752.03NHqBDQ024513@ceres.dti.ne.jp>
Date: Fri, 24 Apr 2020 02:52:11 +0900 (JST)
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: sysinst doesn't release temporary swap in some error cases?
X-Send-Pr-Version: 3.95

>Number:         55202
>Category:       install
>Synopsis:       sysinst doesn't release temporary swap in some error cases?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    martin
>State:          needs-pullups
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 23 17:55:00 +0000 2020
>Closed-Date:    
>Last-Modified:  Fri May 15 04:51:24 +0000 2020
>Originator:     Izumi Tsutsui
>Release:        NetBSD 9.0
>Organization:
>Environment:
System: NetBSD 9.0 (RAMDISK) #0: Fri Feb 14 00:06:28 UTC 2020  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/hp300/compile/RAMDISK
Architecture: m68k
Machine: hp300
>Description:
When checking PR install/55201 (9.0 hp300 sysinst cannot find root)
I noticed that sysinst add a swap using the target /dev/sd0b disk
but it was not released after error.
Then the second try of upgrade silently fails.


---
[same procedure of PR install/55201]

---                                                                                
 No root partition defined.  Cannot continue 









                           >Hit enter to continue 


---

 NetBSD/hp300 9.0

 This menu-driven tool is designed to help you install NetBSD to a hard disk,
 or upgrade an existing NetBSD system, with a minimum of work.
 In the following menus type the reference letter (a, b, c, ...) to select an
 item, or type CTRL+N/CTRL+P to select the next/previous item.
 The arrow keys and Page-up/Page-down may also work.
 Activate the current selection from the menu by typing the enter key.
 If your machine has 4MB or less, sysinst will not operate correctly.

 Thank you for using NetBSD!

                NetBSD-9.0 Install System                     

                a: Install NetBSD to hard disk                
               >b: Upgrade NetBSD on a hard disk                              
                c: Re-install sets or install additional sets                 
                d: Reboot the computer                                        
                e: Utility menu                                               
                f: Config menu                                                
                x: Exit Install System                                        


---

 Ok, let's upgrade NetBSD on your hard disk.  As always, this will change
 information on your hard disk.  You should have made a full backup before
 this procedure!  Do you really want to upgrade NetBSD?  (This is your last  
 warning before this procedure starts modifying your disks.)  






                                Yes or no?    

                                a: No         
                               >b: Yes        


---

 On which disk do you want to upgrade NetBSD?



                              Available disks                                 

                              a: current system                               
                             >b: sd0 (2.2G)                                   
                              x: Exit                                         


---

When I chose "b" on this "On which disk" prompt, sysinst silently got
the initial sysinst menu:
---

 NetBSD/hp300 9.0 

 This menu-driven tool is designed to help you install NetBSD to a hard disk,
 or upgrade an existing NetBSD system, with a minimum of work.

 :
---

When I select "a: Install NetBSD to hard disk" in the initial menu,
sysinst warns swap in the selected disk is in use:

---
[..]

 Thank you for using NetBSD!

                NetBSD-9.0 Install System                     

               >a: Install NetBSD to hard disk                
                b: Upgrade NetBSD on a hard disk              
                c: Re-install sets or install additional sets 
                d: Reboot the computer                        
                e: Utility menu                               
                f: Config menu                                
                x: Exit Install System                        


---

 You have chosen to install NetBSD on your hard disk.  This will change
 information on your hard disk.  You should have made a full backup before
 this procedure!  This procedure will do the following things:
                 a) Partition your disk
                 b) Create new BSD file systems
                 c) Load and install distribution sets
                 d) Some initial system configuration                           

 (After you enter the partition information but before your disk is changed,
 you will have the opportunity to quit this procedure.)

 Shall we continue?

                                Yes or no?    

                                a: No         
                               >b: Yes        


---

 On which disk do you want to install NetBSD?



                           Available disks          

                          >a: sd0 (2.2G)            
                           b: Extended partitioning                           
                           x: Exit                  


---

 The disk that you selected has a swap partition that may currently be in use
 if your system is low on memory.  Because you are going to repartition this
 disk, this swap partition will be disabled now.  Please beware that this
 might lead to out of swap errors.  Should you get such an error, please
 restart the system and try again.





                           >Hit enter to continue 


---

Actually /dev/sd0b is in swapctl:
---
[1] + Suspended               sysinst
# swapctl -l
Device      1K-blocks     Used    Avail Capacity  Priority
/dev/sd0b      131200        0   131200     0%    0
# 
---

Maybe that's the reason silent failure on the second try?

>How-To-Repeat:
See above.

>Fix:
Maybe it's better to call "swapctl -d" on any errors during installation?
(at least silent failure is a bad thing)

---
Izumi Tsutsui

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: install-manager->martin
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Thu, 23 Apr 2020 18:43:58 +0000
Responsible-Changed-Why:
take


State-Changed-From-To: open->feedback
State-Changed-By: martin@NetBSD.org
State-Changed-When: Tue, 12 May 2020 17:29:32 +0000
State-Changed-Why:
should be fixed, but might be hard to verify - feel free to just close
if you can't check it easily.


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55202 CVS commit: src/usr.sbin/sysinst
Date: Tue, 12 May 2020 17:26:43 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Tue May 12 17:26:43 UTC 2020

 Modified Files:
 	src/usr.sbin/sysinst: defs.h disks.c main.c

 Log Message:
 PR 55202: disable swapping if we started it due to low ram


 To generate a diff of this commit:
 cvs rdiff -u -r1.60 -r1.61 src/usr.sbin/sysinst/defs.h
 cvs rdiff -u -r1.66 -r1.67 src/usr.sbin/sysinst/disks.c
 cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/sysinst/main.c

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

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@netbsd.org
Cc: martin@NetBSD.org, tsutsui@ceres.dti.ne.jp
Subject: Re: install/55202 (sysinst doesn't release temporary swap in some error
	 cases?)
Date: Fri, 15 May 2020 03:34:40 +0900

 > should be fixed, but might be hard to verify - feel free to just close
 > if you can't check it easily.

 Fix confirmed:
 ---

  On which disk do you want to upgrade NetBSD?



                               Available disks                                 

                               a: current system                               
                              >b: sd0 (2.2G)                                   
                               x: Exit                                         



 ---

  No root partition defined.  Cannot continue 









                            >Hit enter to continue 












 [1] + Suspended               sysinst
 # 
 # swapctl -l
 Device      1K-blocks     Used    Avail Capacity  Priority
 /dev/sd0b      131200        0   131200     0%    0
 # fg

 ---

  NetBSD/hp300 9.0

  This menu-driven tool is designed to help you install NetBSD to a hard disk,
  or upgrade an existing NetBSD system, with a minimum of work.
  In the following menus type the reference letter (a, b, c, ...) to select an
  item, or type CTRL+N/CTRL+P to select the next/previous item.
  The arrow keys and Page-up/Page-down may also work.
  Activate the current selection from the menu by typing the enter key.
  If your machine has 4MB or less, sysinst will not operate correctly.

  Thank you for using NetBSD!

                 NetBSD-9.0 Install System                     

                 a: Install NetBSD to hard disk                
                >b: Upgrade NetBSD on a hard disk              
                 c: Re-install sets or install additional sets 
                 d: Reboot the computer                        
                 e: Utility menu                               
                 f: Config menu                                
                 x: Exit Install System                        

 [1] + Suspended               sysinst
 # swapctl -l
 no swap devices configured
 # 

 ---

 Thanks,

 ---
 Izumi Tsutsui

State-Changed-From-To: feedback->needs-pullups
State-Changed-By: martin@NetBSD.org
State-Changed-When: Fri, 15 May 2020 04:51:24 +0000
State-Changed-Why:
Fixed, will pullup to -9


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.