NetBSD Problem Report #52940

From www@NetBSD.org  Mon Jan 22 20:38:16 2018
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 "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 219337A1D6
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 22 Jan 2018 20:38:16 +0000 (UTC)
Message-Id: <20180122203814.C0DDC7ABC5@mollari.NetBSD.org>
Date: Mon, 22 Jan 2018 20:38:14 +0000 (UTC)
From: coypu@sdf.org
Reply-To: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Subject: ERLITE multiprocessor hangs early
X-Send-Pr-Version: www-1.0

>Number:         52940
>Category:       port-mips
>Synopsis:       ERLITE multiprocessor hangs early
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-mips-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 22 20:40:00 +0000 2018
>Closed-Date:    Mon Jan 22 23:21:36 +0000 2018
>Last-Modified:  Mon Jan 22 23:25:00 +0000 2018
>Originator:     coypu
>Release:        NetBSD 8.99.12
>Organization:
>Environment:
ERLITE+MULTIPROCESSOR+LOCKDEBUG+DEBUG
Not reaching banner.
>Description:
ELF file is 64 bit
Allocating memory for ELF segment: addr: 0xffffffff80200000 (adjusted to: 0x200000), size 0x4b9420
Allocated memory for ELF segment: addr: 0xffffffff80200000, size 0x4b9420
Processing PHDR 1
  Loading 482010 bytes at ffffffff80200000
  Clearing 37410 bytes at ffffffff80682010
## Loading Linux kernel with entry point: 0xffffffff80200000 ...
Bootloader: Done loading app on coremask: 0x3
phys segment: 0x10000000 @ 0
adding 0x1fe000 @ 0x2000 to freelist 3
adding 0xf946000 @ 0x6ba000 to freelist 3
phys segment: 0x10000000 @ 0x410000000
adding 0x10000000 @ 0x410000000 to freelist 0
<hang>
>How-To-Repeat:

>Fix:
Debug printf is showing we have the following trace:
pmap_bootstrap
pmap_tlb_info_init
mutex_init
lockdebug_alloc
lockdebug_lock_cpus

  for (CPU_INFO_FOREACH(cii, ci))

This hangs because cpuid_infos is NULL early in the boot process.

Reorder boot process, or modify CPU_INFO_FOREACH so this is not a null dereference.

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Mon, 22 Jan 2018 23:21:36 +0000
State-Changed-Why:
fix'd


From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52940 CVS commit: src/sys/arch/mips/include
Date: Mon, 22 Jan 2018 23:20:26 +0000

 Module Name:	src
 Committed By:	maya
 Date:		Mon Jan 22 23:20:26 UTC 2018

 Modified Files:
 	src/sys/arch/mips/include: cpu.h

 Log Message:
 Don't attempt to dereference cpu_infos if ncpus == 0.
 Instead use the already initialized cpu_info_store.

 (Also, now we assume all ncpus have cpu_infos initialized. seems to work.)

 fixes PR port-mips/52940: ERLITE multiprocessor hangs early


 To generate a diff of this commit:
 cvs rdiff -u -r1.122 -r1.123 src/sys/arch/mips/include/cpu.h

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

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