NetBSD Problem Report #57859

From www@netbsd.org  Sun Jan 14 22:18:24 2024
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 336DC1A9238
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 14 Jan 2024 22:18:24 +0000 (UTC)
Message-Id: <20240114221822.67BBB1A9239@mollari.NetBSD.org>
Date: Sun, 14 Jan 2024 22:18:22 +0000 (UTC)
From: pr@netbsd.dberg.net
Reply-To: pr@netbsd.dberg.net
To: gnats-bugs@NetBSD.org
Subject: kernel build errors - w/ options SPLASHSCREEN
X-Send-Pr-Version: www-1.0

>Number:         57859
>Category:       kern
>Synopsis:       kernel build errors - w/ options SPLASHSCREEN
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 14 22:20:02 +0000 2024
>Last-Modified:  Sun Jan 21 08:05:01 +0000 2024
>Originator:     Dave B
>Release:        10.0_RC2 [cvs update -r netbsd-10; # 2024-Jan-10th-ish]
>Organization:
>Environment:
[build environment]:
9.3_STABLE (YAMAHA) #2: Wed Apr  5 08:40:18 EDT 2023  netbsd@yamaha:/f/nb/9.x/obj.amd64/f/nb/9.x/src/sys/arch/amd64/compile/YAMAHA amd64
>Description:
Kernel build errors

...
    compile  GENERIC_T/stb_image.o
...
/f/nb/10.x/src/sys/dev/stbi/stb_image.c: In function 'stbi_gif_info_raw':
/f/nb/10.x/src/sys/dev/stbi/stb_image.c:4362:12: error: stack usage is 18560 bytes [-Werror=stack-usage=]
 4362 | static int stbi_gif_info_raw(stbi *s, int *x, int *y, int *comp)
      |            ^~~~~~~~~~~~~~~~~
/f/nb/10.x/src/sys/dev/stbi/stb_image.c: In function 'stbi_jpeg_info_from_memory':
/f/nb/10.x/src/sys/dev/stbi/stb_image.c:2152:5: error: stack usage is 14144 bytes [-Werror=stack-usage=]
 2152 | int stbi_jpeg_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
/f/nb/10.x/src/sys/dev/stbi/stb_image.c: In function 'stbi_zlib_decode_malloc_guesssize':
/f/nb/10.x/src/sys/dev/stbi/stb_image.c:2524:7: error: stack usage is 4160 bytes [-Werror=stack-usage=]
 2524 | char *stbi_zlib_decode_malloc_guesssize(const char * buffer, int len, int initial_size, int *outlen)
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/f/nb/10.x/src/sys/dev/stbi/stb_image.c: In function 'stbi_zlib_decode_malloc_guesssize_headerflag':
/f/nb/10.x/src/sys/dev/stbi/stb_image.c:2545:7: error: stack usage is 4176 bytes [-Werror=stack-usage=]
 2545 | char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header)
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...

(and so on).
>How-To-Repeat:
Add

    options        SPLASHSCREEN

to GENERIC kernel config, save as GENERIC_T, and issue a "build.sh kernel=GENERIC_T ..." cmd.

Best, -D

>Fix:
Unknown; however, workaround of re-commenting out SPLASHSCREEN is effective at avoiding the error.

>Audit-Trail:
From: "Michael van Elst" <mlelstv@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57859 CVS commit: src/sys/dev/stbi
Date: Sat, 20 Jan 2024 13:33:03 +0000

 Module Name:	src
 Committed By:	mlelstv
 Date:		Sat Jan 20 13:33:03 UTC 2024

 Modified Files:
 	src/sys/dev/stbi: stb_image.c

 Log Message:
 Don't put big structures on stack.
 Should fix PR 57859.


 To generate a diff of this commit:
 cvs rdiff -u -r1.11 -r1.12 src/sys/dev/stbi/stb_image.c

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

From: Dave B <pr@netbsd.dberg.net>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org, pr@netbsd.dberg.net
Subject: Re: PR/57859 CVS commit: src/sys/dev/stbi
Date: Sat, 20 Jan 2024 19:09:08 -0500

 Confirmed.

 With the patched stb_image.c, an amd64 10.0_RC2 GENERIC kernel now
 compiles successfully when options SPLASHSCREEN is uncommented.

 Best, -D

From: mlelstv@serpens.de (Michael van Elst)
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: PR/57859 CVS commit: src/sys/dev/stbi
Date: Sun, 21 Jan 2024 08:03:08 -0000 (UTC)

 pr@netbsd.dberg.net (Dave B) writes:

 >With the patched stb_image.c, an amd64 10.0_RC2 GENERIC kernel now
 >compiles successfully when options SPLASHSCREEN is uncommented.

 It also loads and displays PNG, JPEG and GIF images.

 But it also crashed the kernel for a GIF picture that apparently was
 too large. Not sure where exactly the limits are.

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.