Skip to content

Instantly share code, notes, and snippets.

Original file with CTF:

$ ls -l test.ctf
-rwxr-xr-x   1 root     root       13128 Oct  3 14:16 test.ctf
$ dtrace -lvn 'pid$target:a.out:foo:entry' -c ./test.ctf
diff --git a/tools/codemap.mjs b/tools/codemap.mjs
index 985e721c34..1e1d2c55f8 100644
--- a/tools/codemap.mjs
+++ b/tools/codemap.mjs
@@ -67,7 +67,8 @@ export class CodeMap {
constructor(useBigInt=false) {
this.useBigInt = useBigInt;
- this.kPageSize = useBigInt ? BigInt(kPageSize) : kPageSize;
+ this.parseAddr = useBigInt ? BigInt : parseInt;
@jperkin
jperkin / README.md
Created September 8, 2023 11:09
pkg_admin check fixes

The current implementation of pkg_admin check has a few issues:

  • It always exits 0 regardless of whether there were errors
  • Errors are printed to stdout
  • By default progress dots are printed, making the output rather unreadable.
  • Even in quiet mode (-q) it prints a summary at the end.

Example:

@jperkin
jperkin / find-first-matching.diff
Created August 7, 2023 07:27
Optimisation for "pkg_admin rebuild-tree"
Index: files/add/perform.c
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/files/add/perform.c,v
retrieving revision 1.121
diff -u -r1.121 perform.c
--- files/add/perform.c 21 Oct 2021 13:05:25 -0000 1.121
+++ files/add/perform.c 7 Aug 2023 07:25:57 -0000
@@ -451,7 +451,7 @@
return -1;
}
pkgsrc-nb0# pkgin -n install git-gitk
calculating dependencies...done.
10 packages to refresh:
git-base-2.40.1
perl-5.36.0
curl-8.0.1
nghttp2-1.52.0
p5-IO-Socket-SSL-2.074
p5-Mozilla-CA-20221114

All digest-* packages built with the same GPG key:

$ gpg --list-keys
pub   rsa4096 2022-06-30 [SC]
      A5EA7083CF9513E99A476505B081E2685FE35E6E
uid           [ultimate] MNX Cloud Package Signing (Linux) <pkgsrc+linux@smartos.org>
sub   rsa4096 2022-06-30 [E]
[ 42267.275179] panic: kernel diagnostic assertion "pmap_pdirpa(oldpmap, 0) == pmap_pte2pa(rcr3())" failed: file "/usr/src/sys/arch/x86/x86/pmap.c", l
ine 3641
[ 42267.285184] cpu15: Begin traceback...
[ 42267.285184] vpanic() at netbsd:vpanic+0x183
[ 42267.285184] kern_assert() at netbsd:kern_assert+0x4b
[ 42267.285184] pmap_load1() at netbsd:pmap_load1+0x169
[ 42267.295192] pmap_load() at netbsd:pmap_load+0x7a
[ 42267.295192] do_pmap_load() at netbsd:do_pmap_load+0x1d
[ 42267.295192] copyout() at netbsd:copyout+0x48
[ 42267.305192] ubc_uiomove() at netbsd:ubc_uiomove+0x165
db{0}> bt
breakpoint() at netbsd:breakpoint+0x5
comintr() at netbsd:comintr+0x7e0
intr_kdtrace_wrapper() at netbsd:intr_kdtrace_wrapper+0x26
Xhandle_ioapic_edge1() at netbsd:Xhandle_ioapic_edge1+0x75
--- interrupt ---
x86_stihlt() at netbsd:x86_stihlt+0x6
idle_loop() at netbsd:idle_loop+0x14c
db{0}> ps
PID LID S CPU FLAGS STRUCT LWP * NAME WAIT
pbulk-resolve: Best matching R-cellranger-1.1.0 differs from location textproc/R-cellranger for dependency R-cellranger>=1.1.0 of package R-googlesheets4-1.1.1
pbulk-resolve: Best matching R-cellranger-1.1.0 differs from location textproc/R-cellranger for dependency R-cellranger>=1.1.0 of package R-readxl-1.3.1
pbulk-resolve: Best matching R-cli-3.6.1 differs from location math/R-dplyr for dependency R-cli>=3.4.1 of package R-tidyr-1.3.0
pbulk-resolve: Best matching SOPE-5.5.0nb3 differs from location devel/SOPE for dependency SOPE>=2.3.0 of package SOGo-2.3.23nb27
pbulk-resolve: Best matching SOPE-5.5.0nb3 differs from location devel/SOPE for dependency SOPE>=2.3.2 of package SOGo-2.3.23nb27
pbulk-resolve: Best matching a2ps-4.15.5 differs from location print/mpage for dependency {a2ps,enscript,mpage}-[0-9]* of package foomatic-filters-3.0.2nb20
pbulk-resolve: Best matching a2ps-4.15.5 differs from location print/mpage for dependency {a2ps,enscript,mpage}-[0-9]* of package foomatic-filters-4.0.17nb16
pbulk-r
Index: mk/platform/Darwin.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/platform/Darwin.mk,v
retrieving revision 1.125
diff -u -r1.125 Darwin.mk
--- mk/platform/Darwin.mk 10 May 2023 09:23:54 -0000 1.125
+++ mk/platform/Darwin.mk 24 May 2023 16:22:27 -0000
@@ -39,7 +39,8 @@
CPP= ${CC} -E ${CPP_PRECOMP_FLAGS}
.endif