NetBSD Problem Report #57173

From www@netbsd.org  Sat Jan  7 15:56:38 2023
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_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 ED0021A923A
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  7 Jan 2023 15:56:37 +0000 (UTC)
Message-Id: <20230107155636.867D41A923C@mollari.NetBSD.org>
Date: Sat,  7 Jan 2023 15:56:36 +0000 (UTC)
From: 734wuop2@anonaddy.me
Reply-To: 734wuop2@anonaddy.me
To: gnats-bugs@NetBSD.org
Subject: yash: Cannot allocate memory
X-Send-Pr-Version: www-1.0

>Number:         57173
>Category:       pkg
>Synopsis:       yash: Cannot allocate memory
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 07 16:00:00 +0000 2023
>Closed-Date:    Wed Jul 10 20:00:18 +0000 2024
>Last-Modified:  Wed Jul 10 20:00:18 +0000 2024
>Originator:     Ryan Dom
>Release:        2022Q4
>Organization:
>Environment:
NetBSD rpi 10.0_BETA NetBSD 10.0_BETA (RPI2) #0: Sat Dec 24 09:27:51 UTC 2022  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbarm/compile/RPI2 evbarm

armv6be (big-endian)

>Description:
When I start yash, there is this error message, but the yash shell does start anyway:

  rpi$ yash
  yash: Cannot allocate memory
  The process was killed by SIGABRT: Abort trap 
  pi@rpi ~ $

If I press TAB, yash exits and writes a core dump:

  pi@rpi ~ $ yash: Cannot allocate memory
  [1]   Abort trap (core dumped) yash
  rpi$

If I don't press TAB the shell seems to work fine.

the first error happens only when there is no .yashrc file.

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: RVP <rvp@SDF.ORG>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/57173: yash: Cannot allocate memory
Date: Fri, 13 Jan 2023 23:36:44 +0000 (UTC)

 Can you try the patch below?

 Thanks,
 -RVP

 ---START---
 diff -urN yash-2.53.orig/configure yash-2.53/configure
 --- yash-2.53.orig/configure	2022-08-23 14:03:37.000000000 +0000
 +++ yash-2.53/configure	2023-01-13 23:31:35.507532000 +0000
 @@ -726,7 +726,6 @@
   #include <ncursesw/ncurses.h>
   #endif
   #include <${i%:*}>
 -int putchar(int);

   int main(void) {
   /* Undeclared identifiers are a syntax error in C99, but many compilers assume
 @@ -859,7 +858,14 @@
   checked
   if [ x"${checkresult}" = x"yes" ]
   then
 -    defconfigh "HAVE_STRNLEN"
 +    # NetBSD/ARM strnlen() is buggy when `maxlen' is very large, causing
 +    # an address wraparoound.  See:
 +    # https://mail-index.NetBSD.org/netbsd-users/2022/11/14/msg029205.html
 +    #
 +    case "$(uname -s):$(uname -m)" in
 +    NetBSD:*arm*|NetBSD:aarch64)   ;;
 +    *) defconfigh "HAVE_STRNLEN"   ;;
 +    esac
   fi

   # check for strdup
 ---END---

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	734wuop2@anonaddy.me
Subject: Re: pkg/57173: yash: Cannot allocate memory
Date: Sat, 14 Jan 2023 04:03:32 +0100

 Am Fri, Jan 13, 2023 at 11:40:01PM +0000 schrieb RVP:
 > The following reply was made to PR pkg/57173; it has been noted by GNATS.
 > 
 > From: RVP <rvp@SDF.ORG>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: pkg/57173: yash: Cannot allocate memory
 > Date: Fri, 13 Jan 2023 23:36:44 +0000 (UTC)
 > 
 >  Can you try the patch below?

 Given that just updating is fixing things, I'd prefer that a lot. This
 will be hit in various places.

 Joerg

State-Changed-From-To: open->closed
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Wed, 10 Jul 2024 20:00:18 +0000
State-Changed-Why:
yash has been updated twice in the meantime.
Given that joerg@ said on the bug that an update
would fix this, I assume it is fixed.

Please speak up if it is not.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.