From nobody Thu Feb 22 00:53:17 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TgFF23N1tz5Bjqg for ; Thu, 22 Feb 2024 01:00:38 +0000 (UTC) (envelope-from pmc@citylink.dinoex.sub.org) Received: from uucp.dinoex.org (uucp.dinoex.org [IPv6:2a0b:f840::12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "uucp.dinoex.sub.de", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TgFF10GwSz4d6T for ; Thu, 22 Feb 2024 01:00:36 +0000 (UTC) (envelope-from pmc@citylink.dinoex.sub.org) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of pmc@citylink.dinoex.sub.org designates 2a0b:f840::12 as permitted sender) smtp.mailfrom=pmc@citylink.dinoex.sub.org; dmarc=none; arc=pass ("uucp.dinoex.org:s=M20221114:i=1") Received: from uucp.dinoex.org (uucp.dinoex.org [IPv6:2a0b:f840:0:0:0:0:0:12]) by uucp.dinoex.org (8.18.1/8.18.1) with ESMTPS id 41M106OA022761 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Thu, 22 Feb 2024 02:00:06 +0100 (CET) (envelope-from pmc@citylink.dinoex.sub.org) ARC-Seal: i=1; a=rsa-sha256; d=uucp.dinoex.org; s=M20221114; t=1708563608; cv=none; b=G5b6AGkckpzVWRAi2Uh/SOFKUo88mzYZACrc36U8sFsJ+fydSMvOOoyF4vePbiGFriVLSpRy+aqgYOvC8cYWS/Tof5J2pzcnDd5JUUMKVHeNnW+Ngl8+6E4hQOmtoiCQJNqcQwgG2/3KpYfOrMN9YQ4H9FHZpChIgRQresQo+mQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=uucp.dinoex.org; s=M20221114; t=1708563608; c=relaxed/simple; bh=2BYoYojwcXfyubAPtAV137AdgPrZUaTu9+dATZug6PA=; h=Received:Received:Received:Received:X-Authentication-Warning:Date: From:To:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:X-Milter:X-Greylist; b=In0ZubEdtGfP9RPktpBmEN4L476nJB3CnK+hRmIrIMSDhOCB+GVREj+eOuIpxSz/ErwWX4o1wkUIhpcVSdtJEWj/8TIBb8XMV2G4tLN3z8CFallK02ITrs8wbeS7hG0A6OcAr5Qe10PcRbyr7QoDSkAPqDNdX584x6L7Ji9lw4s= ARC-Authentication-Results: i=1; uucp.dinoex.org X-MDaemon-Deliver-To: Received: (from uucp@localhost) by uucp.dinoex.org (8.18.1/8.18.1/Submit) with UUCP id 41M106Qp022759 for freebsd-hackers@freebsd.org; Thu, 22 Feb 2024 02:00:06 +0100 (CET) (envelope-from pmc@citylink.dinoex.sub.org) Received: from disp.intra.daemon.contact (disp-e.intra.daemon.contact [IPv6:fd00:0:0:0:0:0:0:112]) by admn.intra.daemon.contact (8.17.1/8.17.1) with ESMTPS id 41M0tJ33046339 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK) for ; Thu, 22 Feb 2024 01:55:20 +0100 (CET) (envelope-from pmc@citylink.dinoex.sub.org) Received: from disp.intra.daemon.contact (localhost [127.0.0.1]) by disp.intra.daemon.contact (8.17.1/8.17.1) with ESMTPS id 41M0rH7Z038344 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Thu, 22 Feb 2024 01:53:17 +0100 (CET) (envelope-from pmc@citylink.dinoex.sub.org) Received: (from pmc@localhost) by disp.intra.daemon.contact (8.17.1/8.17.1/Submit) id 41M0rHmw038343 for freebsd-hackers@freebsd.org; Thu, 22 Feb 2024 01:53:17 +0100 (CET) (envelope-from pmc@citylink.dinoex.sub.org) X-Authentication-Warning: disp.intra.daemon.contact: pmc set sender to pmc@citylink.dinoex.sub.org using -f Date: Thu, 22 Feb 2024 01:53:17 +0100 From: Peter To: freebsd-hackers@freebsd.org Subject: Problem with dtrace and function parameters Message-ID: List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Milter: Spamilter (Reciever: uucp.dinoex.org; Sender-ip: 0:0:2a0b:f840::; Sender-helo: uucp.dinoex.org;) X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (uucp.dinoex.org [IPv6:2a0b:f840:0:0:0:0:0:12]); Thu, 22 Feb 2024 02:00:08 +0100 (CET) X-Rspamd-Queue-Id: 4TgFF10GwSz4d6T X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.17 / 15.00]; ARC_ALLOW(-1.00)[uucp.dinoex.org:s=M20221114:i=1]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.87)[-0.873]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[sub.org]; RCPT_COUNT_ONE(0.00)[1]; MISSING_XM_UA(0.00)[]; ASN(0.00)[asn:205376, ipnet:2a0b:f840::/32, country:DE]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[] Concerning PR 269770, I am trying to watch what is going in and out of my libalias. So I am looking at this function in alias_db.c: > struct alias_link * > AddLink(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, > struct in_addr alias_addr, u_short src_port, u_short dst_port, > int alias_port_param, int link_type) > { I cannot read args[1], because when I'm doing > printf("%d", args[1].s_addr) that is understood, but then: > dtrace: error on enabled probe ID 1 (ID 49947: > fbt:kernel:AddLink:entry): invalid address (0x) > in action #4 at DIF offset 8 Actually my IP address is not invalid, but dtrace seems to have difficulties understanding the difference between an IP address and a memory address. ;) So I started to do it in the brute way (linefeeds inserted for readability): # dtrace -n 'AddLink:entry { printf("%s %d %d (src_port %d) (dst_port %d) (alias_p %d) (link_type %d) (src_addr %d.%d.%d.%d %d.%d.%d.%d) (dst_addr %d.%d.%d.%d %d.%d.%d.%d) (alias_addr %d.%d.%d.%d %d.%d.%d.%d) (src_port %d.%d.%d.%d %d.%d.%d.%d) (dst_port %d.%d.%d.%d %d.%d.%d.%d) (alias_port_param %d.%d.%d.%d %d.%d.%d.%d) (link_type %d.%d.%d.%d %d.%d.%d.%d) (unused %d.%d.%d.%d %d.%d.%d.%d) (unused %d.%d.%d.%d %d.%d.%d.%d)", execname, walltimestamp/1000000000, args[0]->udpLinkCount, args[4],args[5], args[6], args[7], arg1/4294967296%256, arg1/4294967296/256%256, arg1/4294967296/65536%256, arg1/4294967296/16777216, arg1%256, arg1/256%256, arg1/65536%256, arg1/16777216, arg2/4294967296%256, arg2/4294967296/256%256, arg2/4294967296/65536%256, arg2/4294967296/16777216, arg2%256, arg2/256%256, arg2/65536%256, arg2/16777216, arg3/4294967296%256, arg3/4294967296/256%256, arg3/4294967296/65536%256, arg3/4294967296/16777216, arg3%256, arg3/256%256, arg3/65536%256, arg3/16777216, arg4/4294967296%256, arg4/4294967296/256%256, arg4/4294967296/65536%256, arg4/4294967296/16777216, arg4%256, arg4/256%256, arg4/65536%256, arg4/16777216, arg5/4294967296%256, arg5/4294967296/256%256, arg5/4294967296/65536%256, arg5/4294967296/16777216, arg5%256, arg5/256%256, arg5/65536%256, arg5/16777216, arg6/4294967296%256, arg6/4294967296/256%256, arg6/4294967296/65536%256, arg6/4294967296/16777216, arg6%256, arg6/256%256, arg6/65536%256, arg6/16777216, arg7/4294967296%256, arg7/4294967296/256%256, arg7/4294967296/65536%256, arg7/4294967296/16777216, arg7%256, arg7/256%256, arg7/65536%256, arg7/16777216, arg8/4294967296%256, arg8/4294967296/256%256, arg8/4294967296/65536%256, arg8/4294967296/16777216, arg8%256, arg8/256%256, arg8/65536%256, arg8/16777216, arg9/4294967296%256, arg9/4294967296/256%256, arg9/4294967296/65536%256, arg9/4294967296/16777216, arg9%256, arg9/256%256, arg9/65536%256, arg9/16777216); } Now the output looks like this, and while the IP addresses are fine, the remainder is obviousely bogus, and seems neither to resolve via network byte order nor via 64-32 bit conversions to anything useful - and no, these numbers do not make more sense when casting all to unsigned, they only look better. AddLink:entry openvpn 1708539730 2 (src_port 20931) (dst_port 46672) (alias_p 70) (link_type -2045910784) (src_addr 0.0.0.0 ) (dst_addr 0.0.0.0 46.17.96.38) (alias_addr 0.0.0.0 ) (src_port 0.0.0.0 195.81.0.0) (dst_port -254.-1.0.0 -176.-73.-201.-130577) (alias_port_param 0.0.0.0 70.0.0.0) (link_type -253.-7.0.0 0.-31.-242.-523641) (unused 0.0.0.0 ) (unused 0.0.0.0 46.17.96.38) BTW, this is the packet concerned: ipfw-oper: 2422 Count TCP 46.17.96.38:55812 :50001 in via tun3 The last parameter that makes sense here is the src_port, apparently in network order. Everything afterwards seems to be just crap. Any ideas why, anybody?