NetBSD Problem Report #56610

From manphiz@gmail.com  Sat Jan  8 16:01:17 2022
Return-Path: <manphiz@gmail.com>
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 928421A923A
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  8 Jan 2022 16:01:17 +0000 (UTC)
Message-Id: <CAFhLy_gZ4SwmiesBnLQgr0TRajaxFSavDeORuXMDQ4Z140JH3g@mail.gmail.com>
Date: Sat, 8 Jan 2022 08:00:00 -0800
From: manphiz <manphiz@gmail.com>
Reply-To:
To: gnats-bugs@netbsd.org
Subject: NetBSD 9+ potentially incompatible with Loongson 2F

>Number:         56610
>Category:       port-mips
>Synopsis:       NetBSD 9+ potentially incompatible with Loongson 2F
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-mips-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 08 16:05:00 +0000 2022
>Originator:     manphiz <manphiz@gmail.com>
>Release:        NetBSD 9.2_STABLE
>Organization:
>Environment:
        System: NetBSD yeeloong-netbsd 9.2_STABLE NetBSD 9.2_STABLE
(LOONGSON) #0: Fri Dec 24 13:05:22 UTC 2021
mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbmips/compile/LOONGSON
evbmips
        Architecture: mips64el
        Machine: evbmips
>Description:

        I have been experiencing programs randomly crash on NetBSD
        9.2_STABLE installed on Lemote Yeeloong using Loongson 2F CPU.
        The "file" program reports a generated core file type as
        normal as can be seen in the following command line outputs:

        ```
        yeeloong-netbsd# file chmod.core
        chmod.core: ELF 32-bit LSB core file, MIPS, N32 MIPS-III
version 1 (SYSV), NetBSD-style, from 'chmod', pid=2848, uid=0, gid=0,
nlwps=1, lwp=1 (signal 11/code 32767)
        ```

        In fact all normal executable gets similar report by file
        program.  However when inspecting the problematic programs in
        gdb, it claims that file format of "ld.elf_so" not recognized,
        and there is a warning regarding unknown library architecture:

        ```
        Reading symbols from chmod...
        (No debugging symbols found in chmod)
        "/usr/pkgsrc/pkgtools/mksandbox/chmod.core" is not a core
dump: file format not recognized
        (gdb) r
        Starting program: /bin/chmod
        warning: `/libexec/ld.elf_so': Shared library architecture
unknown is not compatible with target architecture mips:4000.
        warning: `/libexec/ld.elf_so': Shared library architecture
unknown is not compatible with target architecture mips:4000.
        Usage: chmod [-R [-H | -L | -P]] [-fh] mode file ...
               chmod [-R [-H | -L | -P]] [-fh] --reference=rfile file ...
        [Inferior 1 (process 29793) exited with code 01]
        ```

        As the warning message suggested, the binary seems to be
        compiled with mips:4000 instruction sets, which Loongson 2F
        doesn't seem to support.  As I'm not an expert in this area,
        I would wait until a MIPS porter to confirm this is the case.
        I'd be happy to provide more info if required.

>How-To-Repeat:
        Compile any package in pkgsrc and some programs (e.g. chmod,
        rm, install, etc.)
>Fix:
        Probably restrict the instruction set used for mips64el to
        MIPS-III N32 ELF 32-bit, but not very certain.

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.