Port-sparc64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Tracing NetBSD sun4v issues



On Sat, 10 Oct 2026 18:24:50 +0000 (UTC)
Palle Lyckegaard <palle%netbsd.org@localhost> wrote:

> No just the the test program should be enough.
> 
Attached. You need to build it with -O0 to stop compiler from
optimising away some code. Depending on how much stack space is used by
the variables in main() I get sigsegv or sigbus.

> Ok - have you tried with NetBSD-current as baseline? I think NetBSD 11 was 
> branched off the main development branch long time ago, so things *may* 
> have improved.
> 
Not yet, I assume the same problem exists in both, unless someone fixed
it and forget to tell everyone else.
/*
 * MACHINE=sparc64
 * MACHINE_ARCH=sparc64
 * BUILD_BASE=/home/user/netbsd
 * TOOLS_PREFIX=sparc64--netbsd
 *
 * ${BUILD_BASE:?}/tools.${MACHINE_ARCH:?}/bin/${TOOLS_PREFIX:?}-gcc -O0 -g -pedantic -Wall \
 * --sysroot=${BUILD_BASE:?}/obj.${MACHINE_ARCH:?}/destdir.${MACHINE:?} \
 * -Wl,-rpath-link,${BUILD_BASE:?}/obj.${MACHINE_ARCH:?}/destdir.${MACHINE:?}/lib \
 * -Wl,-rpath-link,${BUILD_BASE:?}/obj.${MACHINE_ARCH:?}/destdir.${MACHINE:?}/usr/lib \
 * test.c -o test
*/
#include <assert.h>
#include <fcntl.h>
#include <pwd.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <inttypes.h>
#include <stdio.h>
#include <unistd.h>

int fn(const char *name, uid_t *uid)
{
	void    *vptr;

	*uid = 0;
	/*vptr = calloc(317, 8);*/
	(void)setpassent(1);

	return 0;
}

int main(void)
{
	uid_t   uid;

	uint8_t u8[2000]; /* sigsegv */

	#if 0
	uint8_t u8[3000]; /* sigbus */
	#endif

	(void)fn("root", &uid);

	return 0;
}


Home | Main Index | Thread Index | Old Index