NetBSD Problem Report #52169

From www@NetBSD.org  Sun Apr 16 13:00:18 2017
Return-Path: <www@NetBSD.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 "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 093837A16F
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 16 Apr 2017 13:00:18 +0000 (UTC)
Message-Id: <20170416130017.2970B7A2B4@mollari.NetBSD.org>
Date: Sun, 16 Apr 2017 13:00:17 +0000 (UTC)
From: venture37@geeklan.co.uk
Reply-To: venture37@geeklan.co.uk
To: gnats-bugs@NetBSD.org
Subject: setting dtrace module to load cause Pi to hang on boot
X-Send-Pr-Version: www-1.0

>Number:         52169
>Category:       port-evbarm
>Synopsis:       setting dtrace module to load cause Pi to hang on boot
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    port-evbarm-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 16 13:05:00 +0000 2017
>Closed-Date:    Fri Nov 03 15:58:39 +0000 2017
>Last-Modified:  Fri Nov 03 15:58:39 +0000 2017
>Originator:     Sevan Janiyan
>Release:        NetBSD-HEAD 201704160200Z
>Organization:
>Environment:
>Description:
On a Pi (1st generation, 2nd revision) model B, attempting to enable to dtrace module causes the system to hang during the module loading stage during boot.
>How-To-Repeat:
Fetch HEAD/201704160200Z/evbarm-earmv6hf rpi.img.gz  image
add solaris & dtrace to /etc/modules.conf
boot
>Fix:

>Release-Note:

>Audit-Trail:
From: Sevan Janiyan <venture37@geeklan.co.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-evbarm/52169: setting dtrace module to load cause Pi to hang
 on boot
Date: Sun, 16 Apr 2017 15:50:23 +0100

 System left long enough will eventually report
 vcmbox0: workqueue busy: updates stopped

 While the boot process has stopped. the system is still responsive to
 siginfo via ^T. It is stuck on modload.

From: Paul Goyette <paul@whooppee.com>
To: gnats-bugs@NetBSD.org
Cc: port-evbarm-maintainer@netbsd.org
Subject: Re: port-evbarm/52169: setting dtrace module to load cause Pi to
 hang on boot
Date: Mon, 17 Apr 2017 06:04:55 +0800 (+08)

 >> Description:
 > On a Pi (1st generation, 2nd revision) model B, attempting to enable 
 > to dtrace module causes the system to hang during the module loading 
 > stage during boot.

 If you boot normally (without dtrace), can you subsequently use 
 modload(8) to load the dtrace stuff?


From: Sevan Janiyan <venture37@geeklan.co.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-evbarm/52169: setting dtrace module to load cause Pi to hang
 on boot
Date: Sun, 16 Apr 2017 23:17:46 +0100

 On 16/04/2017 23:05, Paul Goyette wrote:
 >  If you boot normally (without dtrace), can you subsequently use 
 >  modload(8) to load the dtrace stuff?

 By default, no. This is because recently we removed the insecure option
 from various kernel config files which prevents you from loading
 modules, once the system has gone multi user.
 Today however, I discovered that this change broke access to GPIO, so I
 ended up compiling a kernel with the insecure option. Will test and
 report back.


 Sevan

From: Sevan Janiyan <venture37@geeklan.co.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-evbarm/52169: setting dtrace module to load cause Pi to hang
 on boot
Date: Sun, 16 Apr 2017 23:27:51 +0100

 On 16/04/2017 23:05, Paul Goyette wrote:
 > If you boot normally (without dtrace), can you subsequently use 
 > modload(8) to load the dtrace stuff?
 Some result. System gets stuck on modload. Still responds to SIGINFO.



 Sevan

From: Paul Goyette <paul@whooppee.com>
To: gnats-bugs@NetBSD.org
Cc: port-evbarm-maintainer@netbsd.org, venture37@geeklan.co.uk
Subject: Re: port-evbarm/52169: setting dtrace module to load cause Pi to
 hang on boot
Date: Mon, 17 Apr 2017 07:26:29 +0800 (+08)

 On Sun, 16 Apr 2017, Sevan Janiyan wrote:

 > > If you boot normally (without dtrace), can you subsequently use
 > > modload(8) to load the dtrace stuff?
 >
 > Some result. System gets stuck on modload. Still responds to SIGINFO.

 Any chance of using ddb(4) to get a backtrace of the stuck lwp?

From: Sevan Janiyan <venture37@geeklan.co.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-evbarm/52169: setting dtrace module to load cause Pi to hang
 on boot
Date: Mon, 17 Apr 2017 00:34:24 +0100

 On 17/04/2017 00:30, Paul Goyette wrote:
 > Any chance of using ddb(4) to get a backtrace of the stuck lwp?

 Yep

 trace: pid 38 lid 1 at 0x8b59dd54
 0x8b59dd54: netbsd:pic_do_pending_ints+0xc
 0x8b59ddbc: netbsd:irq_entry+0x60
 0x8b59dde4: netbsd:kobj_affix+0x144
 0x8b59de6c: netbsd:module_do_load+0x4e0
 0x8b59dea4: netbsd:module_load+0x98
 0x8b59ded4: netbsd:handle_modctl_load.part.0+0x100
 0x8b59df34: netbsd:sys_modctl+0x270
 0x8b59dfac: netbsd:syscall+0x10c

From: Paul Goyette <paul@whooppee.com>
To: gnats-bugs@NetBSD.org
Cc: port-evbarm-maintainer@netbsd.org, venture37@geeklan.co.uk
Subject: Re: port-evbarm/52169: setting dtrace module to load cause Pi to
 hang on boot
Date: Mon, 17 Apr 2017 07:57:19 +0800 (+08)

 > > Any chance of using ddb(4) to get a backtrace of the stuck lwp?
 >
 > Yep
 >
 > trace: pid 38 lid 1 at 0x8b59dd54
 > 0x8b59dd54: netbsd:pic_do_pending_ints+0xc
 > 0x8b59ddbc: netbsd:irq_entry+0x60
 > 0x8b59dde4: netbsd:kobj_affix+0x144
 > 0x8b59de6c: netbsd:module_do_load+0x4e0
 > 0x8b59dea4: netbsd:module_load+0x98
 > 0x8b59ded4: netbsd:handle_modctl_load.part.0+0x100
 > 0x8b59df34: netbsd:sys_modctl+0x270
 > 0x8b59dfac: netbsd:syscall+0x10c

 And can you identify the source code line number (within source file
 sys/kern/subr_kobj.c) for kobj_affix+0x144?

From: Nick Hudson <nick.hudson@gmx.co.uk>
To: gnats-bugs@NetBSD.org, port-evbarm-maintainer@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, venture37@geeklan.co.uk
Cc: 
Subject: Re: port-evbarm/52169: setting dtrace module to load cause Pi to hang
 on boot
Date: Mon, 17 Apr 2017 09:31:53 +0100

 Something is going wrong in fstrans*

 db{0}> ps/l
 PID    LID S CPU     FLAGS       STRUCT LWP *               NAME WAIT
 52       1 3   2         0           ba738300          mount_ffs psrlz
 53       1 3   2        80           ba739a00              mount wait
 51       1 3   1        80           baade2e0                 sh wait
 16       1 3   1         0           baade000                 sh tstile
 14       1 3   0        80           baade5c0                 sh wait
 9        1 3   0        80           baadeb80                 sh wait
 8        1 3   3        80           bac945c0                 sh pipe_rd
 7        1 3   3        80           baadee60                 sh wait
 6        1 3   0        80           baadf140                 sh wait
 2        1 3   0        80           bac94e60                 sh wait
 1        1 3   1        80           babfba20               init wait
 0       83 3   3       200           ba738e80                zfs zfscv
 0       82 3   3       200           ba739160                zfs zfscv
 0       81 3   3       200           ba739440                zfs zfscv
 0       80 3   3       200           ba739720                zfs zfscv
 0       79 3   2       200           babfb460            physiod physiod
 0       78 3   1       200           baadf420           aiodoned aiodoned
 0       77 3   1       200           baadf700            ioflush syncer
 0       76 3   1       200           baadf9e0           pgdaemon pgdaemon
 0       75 3   1       280           baadfcc0              spkr0 bellcv
 0       74 3   1       280           babfa040           audiomix play
 0       73 3   1       280           babfa320           audiorec record
 0       72 3   3       280           babfa600          VCHIQka-0 lnxcmplt
 0       71 3   1       280           babfa8e0            vcaudio data
 0       70 3   1       280           babfabc0           VCHIQs-0 semacv
 0       69 3   1       280           babfaea0           VCHIQr-0 semacv
 0       68 3   0       280           babfb180            VCHIQ-0 semacv
 0       65 3   0       200           bac588c0               usb0 usbevt
 0       64 3   0       200           babfb740            npfgc-0 npfgccv
 0       63 3   1       200           babfbd00            rt_free rt_free
 0       62 3   1       200           bac58020              unpgc unpgc
 0       61 3   3       200           bac58300    icmp6_wqinput/3 
 icmp6_wqinput
 0       60 3   2       200           bac585e0    icmp6_wqinput/2 
 icmp6_wqinput
 0       59 3   1       200           bac94b80    icmp6_wqinput/1 
 icmp6_wqinput
 0       58 3   0       200           bac942e0    icmp6_wqinput/0 
 icmp6_wqinput
 0       57 3   0       200           bac59a00          nd6_timer nd6_timer
 0       55 3   3       200           bac58ba0     icmp_wqinput/3 
 icmp_wqinput
 0       54 3   2       200           bac58e80     icmp_wqinput/2 
 icmp_wqinput
 0       53 3   1       200           bac59160     icmp_wqinput/1 
 icmp_wqinput
 0       52 3   0       200           bac948a0     icmp_wqinput/0 
 icmp_wqinput
 0       51 3   2       200           bac59ce0           rt_timer rt_timer
 0       50 3   2       200           bac59440            vcmbox0 vcmbox0
 0       49 3   2       200           bac94000        vmem_rehash vmem_rehash
 0       48 3   2       200           bac59720             sdmmc0 mmctaskq
 0       39 3   0       200           bac95140         usbtask-dr usbtsk
 0       38 3   0       200           bac95420         usbtask-hc usbtsk
 0       37 3   1       200           bac95700               dwc2 dwc2
 0       36 3   3       200           bac959e0               iic1 iicintr
 0       35 3   0       200           bac95cc0               iic0 iicintr
 0       34 3   3       200           bad4c040            xcall/3 xcall
 0       33 1   3       200           bad4c320          softser/3
 0       32 1   3       200           bad4c600          softclk/3
 0       31 1   3       200           bad4c8e0          softbio/3
 0       30 1   3       200           bad4cbc0          softnet/3
 0    >  29 7   3       201           bad4cea0             idle/3
 0       28 3   2       200           bad4d180            xcall/2 xcall
 0       27 1   2       200           bad4d460          softser/2
 0       26 1   2       200           bad4d740          softclk/2
 0       25 1   2       200           bad4da20          softbio/2
 0       24 1   2       200           bad4dd00          softnet/2
 0    >  23 7   2       201           bad84020             idle/2
 0       22 3   1       200           bad84300            xcall/1 xcall
 0       21 1   1       200           bad845e0          softser/1
 0       20 1   1       200           bad848c0          softclk/1
 0       19 1   1       200           bad84ba0          softbio/1
 0       18 1   1       200           bad84e80          softnet/1
 0    >  17 7   1       201           bad85160             idle/1
 0       16 3   0       200           bad85440             sysmon smtaskq
 0       15 3   0       200           bad85720          cryptoret crypto_w
 0       14 3   1       200           bad85a00         pmfsuspend pmfsuspend
 0       13 3   2       200           bad85ce0           pmfevent pmfevent
 0       12 3   0       200           baef4000         sopendfree sopendfr
 0       11 3   1       200           baef42e0           nfssilly nfssilly
 0       10 3   0       200           baef45c0            cachegc cachegc
 0        9 3   0       200           baef48a0             vdrain tstile
 0        8 3   0       200           baef4b80          modunload mod_unld
 0        7 3   0       200           baef4e60            xcall/0 xcall
 0        6 1   0       200           baef5140          softser/0
 0        5 1   0       200           baef5420          softclk/0
 0        4 1   0       200           baef5700          softbio/0
 0        3 1   0       200           baef59e0          softnet/0
 0    >   2 7   0       201           baef5cc0             idle/0
 0        1 3   3       200           805afd40            swapper uvm
 db{0}>
 db{0}>  bt/a  ba738300
 trace: pid 52 lid 1 at 0xba183d94
 0xba183d94: netbsd:mi_switch+0x10
 0xba183dc4: netbsd:sleepq_block+0x16c
 0xba183e04: netbsd:kpause+0xfc
 0xba183e24: netbsd:pserialize_perform+0xfc
 0xba183e5c: netbsd:fstrans_setstate+0x44
 0xba183e7c: netbsd:VFS_SUSPENDCTL+0x30
 0xba183e94: netbsd:vfs_suspend+0x64
 0xba183f04: netbsd:do_sys_mount+0x470
 0xba183f34: netbsd:sys___mount50+0x48
 0xba183fac: netbsd:syscall+0x108
 db{0}> bt/a baef48a0
 trace: pid 0 lid 9 at 0xbae95e14
 0xbae95e14: netbsd:mi_switch+0x10
 0xbae95e44: netbsd:sleepq_block+0xb4
 0xbae95e84: netbsd:turnstile_block+0x33c
 0xbae95edc: netbsd:mutex_enter+0x2ac
 0xbae95f14: netbsd:fstrans_get_lwp_info+0x174
 0xbae95f44: netbsd:_fstrans_start+0xbc
 0xbae95fac: netbsd:vdrain_thread+0x270
 db{0}>


From: Sevan Janiyan <venture37@geeklan.co.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-evbarm/52169: setting dtrace module to load cause Pi to hang
 on boot
Date: Mon, 17 Apr 2017 15:20:59 +0100

 On 16/04/2017 23:27, Sevan Janiyan wrote:
 > Some result. System gets stuck on modload. Still responds to SIGINFO.

 Just to clarify, I'm using the Pi headless via a USB to TTL adapter.


 Sevan

From: Nick Hudson <skrll@netbsd.org>
To: gnats-bugs@NetBSD.org, port-evbarm-maintainer@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, venture37@geeklan.co.uk
Cc: 
Subject: Re: port-evbarm/52169: setting dtrace module to load cause Pi to hang
 on boot
Date: Tue, 18 Apr 2017 11:33:27 +0100

 This is a multi-part message in MIME format.
 --------------030801040504010005080302
 Content-Type: text/plain; charset=windows-1252; format=flowed
 Content-Transfer-Encoding: 7bit

 This seems to fix it for me - I'm not entirely sure why though

 Nick

 --------------030801040504010005080302
 Content-Type: text/x-patch;
  name="pr52169.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="pr52169.diff"

 Index: sys/arch/arm/arm/cpufunc.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/arm/arm/cpufunc.c,v
 retrieving revision 1.163
 diff -u -p -r1.163 cpufunc.c
 --- sys/arch/arm/arm/cpufunc.c	28 Jan 2017 13:21:11 -0000	1.163
 +++ sys/arch/arm/arm/cpufunc.c	18 Apr 2017 10:32:25 -0000
 @@ -892,7 +892,7 @@ struct cpu_functions arm1176_cpufuncs = 
  	.cf_sdcache_wb_range	= (void *)cpufunc_nullop,

  	.cf_idcache_wbinv_all	= arm11x6_idcache_wbinv_all,	/* 415045 */
 -	.cf_idcache_wbinv_range = arm11x6_idcache_wbinv_range,	/* 371367 */
 +	.cf_idcache_wbinv_range = (void *)arm11x6_idcache_wbinv_all,

  	/* Other functions */


 --------------030801040504010005080302--

From: Sevan Janiyan <venture37@geeklan.co.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-evbarm/52169: setting dtrace module to load cause Pi to hang
 on boot
Date: Mon, 24 Apr 2017 20:42:17 +0100

 On 18/04/2017 11:35, Nick Hudson wrote:
 >  This seems to fix it for me - I'm not entirely sure why though

 Confirmed, works for me too.
 Shall I commit?


 Sevan

State-Changed-From-To: open->feedback
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Wed, 12 Jul 2017 07:45:06 +0000
State-Changed-Why:
I committed something that fixes it for me - does it now work for you?
[pullup-8 #122]
[pullup-7 #1452]


From: Sevan Janiyan <venture37@geeklan.co.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-evbarm/52169 (setting dtrace module to load cause Pi to hang
 on boot)
Date: Thu, 13 Jul 2017 18:51:26 +0100

 On 07/12/17 08:45, skrll@NetBSD.org wrote:
 > Synopsis: setting dtrace module to load cause Pi to hang on boot
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: skrll@NetBSD.org
 > State-Changed-When: Wed, 12 Jul 2017 07:45:06 +0000
 > State-Changed-Why:
 > I committed something that fixes it for me - does it now work for you?
 > [pullup-8 #122]
 > [pullup-7 #1452]
 > 
 > 
 > 

 I tested HEAD/201707130130Z/evbarm-earmv6hf/binary/gzimg/rpi.img.gz and
 system booted fine with the solaris & dtrace modules loaded via
 /etc/modules.conf.

 rpi# dtrace -l|wc -l
        4

 It seems the issue is now fixed.

 Thanks, Nick! :)


 Sevan

State-Changed-From-To: feedback->closed
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Fri, 03 Nov 2017 15:58:39 +0000
State-Changed-Why:
Problem resolved.


>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.