NetBSD-Bugs archive

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

Re: kern/57564 gdb netbsd.gdb and vfs_cache.o file



Hello Taylor, thanks for help. Please see below:

El 9/8/23 a las 9:21, Taylor R Campbell escribió:
This is very weird...  The relevant code is this:

#define	COUNT(f) do { \
	lwp_t *l = curlwp; \
	KPREEMPT_DISABLE(l); \
	struct nchcpu *nchcpu = curcpu()->ci_data.cpu_nch; \
	nchcpu->cur.f++; \
	KPREEMPT_ENABLE(l); \
} while (/* CONSTCOND */ 0);

Somewhere, between

	lwp_t *l = curlwp;

and

	KPREEMPT_DISABLE(l);

l has become null.  My first guess would be that the exception vector
failed to restore all the registers or something.  But every time it's
tripped exactly the same assertion, with the same stack trace in
cache_lookup, right?  If the exception vector were broken, I would
expect to see other random things failing or panicking.

Can you send me the vfs_cache.o file from your kernel build, and/or
share the output of `list *(cache_lookup+0x7c0)' in `gdb netbsd.gdb'?
Maybe the compiler has done something screwy here on armv6.

ramiro@debian-nuc8i7:~/cvs/src/sys/arch/evbarm/compile/MYKERNEL$ gdb netbsd.gdb
GNU gdb (Debian 13.1-3) 13.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...

warning: A handler for the OS ABI "NetBSD" is not built into this configuration
of GDB.  Attempting to continue with the default i386 settings.

Reading symbols from netbsd.gdb...
warning: File "/home/ramiro/cvs/src/sys/arch/evbarm/compile/MYKERNEL/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
add-auto-load-safe-path /home/ramiro/cvs/src/sys/arch/evbarm/compile/MYKERNEL/.gdbinit
line to your configuration file "/home/ramiro/.config/gdb/gdbinit".
To completely disable this security protection add
	set auto-load safe-path /
line to your configuration file "/home/ramiro/.config/gdb/gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
	info "(gdb)Auto-loading safe path"
(gdb) list *(cache_lookup+0x7c0)
0x80437ebc is in cache_lookup (../../../../sys/lwp.h:544).
539	static __inline void
540	KPREEMPT_DISABLE(lwp_t *l)
541	{
542		struct lwp *l1 __diagused;
543	
544		KASSERTMSG(l == (l1 = curlwp), "l=%p curlwp=%p", l, l1);
545		l->l_nopreempt++;
546		__insn_barrier();
547	}
548	
(gdb)


I attach vfs_cache.o file

Thanks

Attachment: vfs_cache.o
Description: application/object



Home | Main Index | Thread Index | Old Index