NetBSD-Bugs archive

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

bin/58630: dtrace is "hit or miss", but mostly "miss"



>Number:         58630
>Category:       bin
>Synopsis:       dtrace is "hit or miss", but mostly "miss"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 23 17:25:01 +0000 2024
>Originator:     Havard Eidnes
>Release:        NetBSD 10.0
>Organization:
I try...
>Environment:
System: NetBSD xxxxxx.uninett.no 10.0 NetBSD 10.0 (GENERIC) #0: Thu Mar 28 08:33:33 UTC 2024  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
	While trying to build BIND 9.20.0, I stumble across this
	problem.  Trying to process

--- probes.d
/*
 * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
 *
 * SPDX-License-Identifier: MPL-2.0
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, you can obtain one at https://mozilla.org/MPL/2.0/.
 *
 * See the COPYRIGHT file distributed with this work for additional
 * information regarding copyright ownership.
 */

provider libisc {
        probe job_cb_after(void *, void *, void *);
        probe job_cb_before(void *, void *, void *);

        probe rwlock_destroy(void *);
        probe rwlock_downgrade(void *);
        probe rwlock_init(void *);
        probe rwlock_rdlock_acq(void *);
        probe rwlock_rdlock_req(void *);
        probe rwlock_rdunlock(void *);
        probe rwlock_tryrdlock(void *, int);
        probe rwlock_tryupgrade(void *, int);
        probe rwlock_trywrlock(void *, int);
        probe rwlock_wrlock_acq(void *);
        probe rwlock_wrlock_req(void *);
        probe rwlock_wrunlock(void *);
};
---

	with

	/usr/sbin/dtrace -s ./probes.d -h -o probes.h

	may on some systems result in

	dtrace: failed to compile script ./probes.d: "/usr/lib/dtrace/psinfo.d", line 46: syntax error near "u_int"

	Looking at /usr/lib/dtrace/psinfo.d near that line does
	not reveal anything disturbing to the untrained eye:

$ cat -n /usr/lib/dtrace/psinfo.d 
...
    33  typedef struct psinfo {
    34          int     pr_nlwp;        /* number of threads */
    35          pid_t   pr_pid;         /* unique process id */
    36          pid_t   pr_ppid;        /* process id of parent */
    37          pid_t   pr_pgid;        /* pid of process group leader */
    38          pid_t   pr_sid;         /* session id */
    39          uid_t   pr_uid;         /* real user id */
    40          uid_t   pr_euid;        /* effective user id */
    41          gid_t   pr_gid;         /* real group id */
    42          gid_t   pr_egid;        /* effective group id */
    43          uintptr_t
    44                  pr_addr;        /* address of process */
    45          string  pr_psargs;      /* process arguments */
    46          u_int   pr_arglen;      /* process argument length */
    47  } psinfo_t;
    48  
...

	What's even more strange is that this error is not
	consistently observed among my different systems:

System #1, where this is *not* observed:

$ egrep 'DISTRIBVER|Build ID' /etc/release
            Build ID   202407270640Z
          DISTRIBVER = '10.0_STABLE'
$ uname -a
NetBSD bxxx-rxx.uninett.no 10.0 NetBSD 10.0 (GENERIC) #0: Thu Mar 28 08:33:33 UTC 2024  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64
$
$ openssl dgst -sha1 /usr/sbin/dtrace
SHA1(/usr/sbin/dtrace)= ae65af77aff5ebc80d9db2712852b1b6d5a77131
$
$ openssl dgst -sha1 /netbsd
SHA1(/netbsd)= 7808ca002079afe78961b1da49ff5d48bda71fc0
$

System #2, where this problem *is* observed:

$ egrep 'DISTRIBVER|Build ID' /etc/release
            Build ID   202407270640Z
          DISTRIBVER = '10.0_STABLE'
$ uname -a
NetBSD oxxxxx.uninett.no 10.0 NetBSD 10.0 (GENERIC) #0: Thu Mar 28 08:33:33 UTC 2024  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64
$ 
$ openssl dgst -sha1 /usr/sbin/dtrace
SHA1(/usr/sbin/dtrace)= ae65af77aff5ebc80d9db2712852b1b6d5a77131
$ 
$ openssl dgst -sha1 /netbsd
SHA1(/netbsd)= 7808ca002079afe78961b1da49ff5d48bda71fc0
$ 

System #3, where this problem *is* also observed:

$ egrep 'DISTRIBVER|Build ID' /etc/release
          DISTRIBVER = '10.0'
$ uname -a
NetBSD sxxxxx.xxx.uninett.no 10.99.11 NetBSD 10.99.11 (GENERIC) #6: Tue Aug 20 18:30:39 UTC 2024  he%stest.urc.uninett.no@localhost:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
$ 

This system has a locally built -current kernel, and is still
running 10.0 user-land, but I suspect also that is locally
built, so /usr/sbin/dtrace isn't the same as above.

Privately, Taylor asked for output from "ctfdump -S /netbsd" on
each system, in particular "number of types", and they are:

#1:
  total number of types               = 29896

#2:
  total number of types               = 29896

#3:
  total number of types               = 30208

I do however see that each of them has more than 32k functions,
for what it's worth:

#1:
  total number of functions           = 36294

#2:
  total number of functions           = 36294

#3:
  total number of functions           = 36927

Not sure about whether that makes any difference, though.

Full output from "ctfdump -S /netbsd" can be appended later,
if need be.

I also dumped the types with "ctfdump -t /netbsd" on each of
them, and the thing related to u_int is:

#1:
  <4> INTEGER unsigned int encoding=0x0 offset=0 bits=32
...
  <271> TYPEDEF u_int refers to 4

#2:
  <4> INTEGER unsigned int encoding=0x0 offset=0 bits=32
...
  <271> TYPEDEF u_int refers to 4

#3:
  <19> INTEGER unsigned int encoding=0x0 offset=0 bits=32
  <20> TYPEDEF u_int refers to 19

"What gives?"


>How-To-Repeat:
	Try to build BIND 9.20.0, watch the build on some systems
	bomb out with

Making all in isc
  DTRACE   probes.h
dtrace: failed to compile script ./probes.d: "/usr/lib/dtrace/psinfo.d", line 46: syntax error near "u_int"
*** Error code 1

>Fix:
	Yes, please.



Home | Main Index | Thread Index | Old Index