Stuart Henderson <[email protected]> wrote:
> On 2018/09/26 20:15, Stuart Henderson wrote:
> > On 2018/09/26 19:16, Stuart Henderson wrote:
> > > N.B. "Ports using KERN_CPTIME2 will need to be updated."
> > >
> > > This is likely to cause a bunch of breakage in things reporting CPU stats
> > > and time is very short to fix them before release.
> > >
> > > If you look after ports that do this, get onto a kernel with this change
> > > (very new commit so it probably won't be in snaps quite just yet) and
> > > test ASAP.
> >
> > Some starting points for investigation,
> >
> > assorted mozillas
> > collectd
> > conky
> > go
> > htop
> > libgtop2
> > net-snmp
> > node
> > pgtop
> > py-psutil
> > libuv (+ embedded copies, at least in cmake, maybe more)
> > zabbix
>
> From a search over extracted ports source and cleaned up (ignoring ifdefs
> etc):
>
> libgtop2-2.38.0 sysdeps/openbsd/cpu.c:static int mib_cptime_s
> [] = { CTL_KERN, KERN_CPTIME2, 0 };
> conky-1.9.0 src/openbsd.c: int cp_time_mib[]
> = { CTL_KERN, KERN_CPTIME2, i };
> symon-2.88 platform/OpenBSD/sm_cpu.c: st->parg.cp.mib[1] =
> KERN_CPTIME2;
> xstatbar-0.5 stats.c: mib_cpus[1] = KERN_CPTIME2;
> xfce4-cpugraph-1.0.5 panel-plugin/os.c: gint mib[] = {CTL_KERN,
> KERN_CPTIME2, i - 1};
> net-snmp-5.8 agent/mibgroup/hardware/cpu/cpu_sysctl.c: int
> mcpu_mib[] = { CTL_KERN, KERN_CPTIME2, 0 };
> zabbix-3.4.11 src/zabbix_agent/cpustat.c: mib[1]
> = KERN_CPTIME2;
> filebeat-6.2.4
> vendor/github.com/elastic/gosigar/sigar_openbsd.go: mib =
> []int32{C.CTL_KERN, C.KERN_CPTIME2, int32(curcpu)}
> heartbeat-6.2.4
> vendor/github.com/elastic/gosigar/sigar_openbsd.go: mib =
> []int32{C.CTL_KERN, C.KERN_CPTIME2, int32(curcpu)}
> metricbeat-6.2.4 vendor/github.com/elastic/gosigar/sigar_openbsd.go:
> mib = []int32{C.CTL_KERN, C.KERN_CPTIME2, int32(curcpu)}
> packetbeat-6.2.4 vendor/github.com/elastic/gosigar/sigar_openbsd.go:
> mib = []int32{C.CTL_KERN, C.KERN_CPTIME2, int32(curcpu)}
> collectd-5.8.0 src/cpu.c: int mib[] = {CTL_KERN,
> KERN_CPTIME2, i};
> consul-1.2.3 vendor/github.com/shirou/gopsutil/cpu/cpu_openbsd.go:
> KernCptime2 = 71 // KERN_CPTIME2
> htop-2.2.0 openbsd/Platform.c: int mib[] = { CTL_KERN,
> KERN_CPTIME2, cpu-1 };
>
> libuv & vendored copies
>
> libuv-1.19.1 src/unix/openbsd.c: which[1] = KERN_CPTIME2;
> cmake-3.10.2 Utilities/cmlibuv/src/unix/openbsd.c: which[1] =
> KERN_CPTIME2;
> moarvm-2017.10 3rdparty/libuv/src/unix/openbsd.c: which[1] =
> KERN_CPTIME2;
> node-8.12.0 deps/uv/src/unix/openbsd.c: which[1] = KERN_CPTIME2;
> passenger-5.1.11
> src/cxx_supportlib/vendor-copy/libuv/src/unix/openbsd.c: which[1] =
> KERN_CPTIME2;
> py-uv-1.3.0 deps/libuv/src/unix/openbsd.c: which[1] = KERN_CPTIME2;
>
> psutil & vendored copies
>
> py-psutil-5.4.3 psutil/arch/openbsd/specific.c: mib[1] =
> KERN_CPTIME2;
> firefox-esr-60.2.1
> third_party/python/psutil/psutil/arch/openbsd/specific.c: mib[1] =
> KERN_CPTIME2;
> firefox-62.0.2
> third_party/python/psutil/psutil/arch/openbsd/specific.c: mib[1] =
> KERN_CPTIME2;
>
> rust & vendored copies, consts only I believe:
>
> cbindgen-0.6.3
> modcargo-crates/libc-0.2.41/src/unix/bsd/netbsdlike/openbsdlike/mod.rs:pub
> const KERN_CPTIME2: ::c_int = 71;
> exa-0.8.0
> modcargo-crates/libc-0.2.30/src/unix/bsd/netbsdlike/openbsdlike/mod.rs:pub
> const KERN_CPTIME2: ::c_int = 71;
> firefox-62.0.2
> third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs:pub const
> KERN_CPTIME2: ::c_int = 71;
> firefox-esr-60.2.1
> third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs:pub const
> KERN_CPTIME2: ::c_int = 71;
> librsvg-2.44.4
> vendor/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs:pub const
> KERN_CPTIME2: ::c_int = 71;
> ripgrep-0.8.1
> modcargo-crates/libc-0.2.36/src/unix/bsd/netbsdlike/openbsdlike/mod.rs:pub
> const KERN_CPTIME2: ::c_int = 71;
> rust-1.29.1
> src/liblibc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs:pub const
> KERN_CPTIME2: ::c_int = 71;
> rust-1.29.1
> src/vendor/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs:pub const
> KERN_CPTIME2: ::c_int = 71;
> seamonkey-2.49.4
> mozilla/third_party/rust/libc/src/unix/bsd/openbsdlike/bitrig.rs:pub const
> KERN_CPTIME2: ::c_int = 71;
> seamonkey-2.49.4
> mozilla/third_party/rust/libc/src/unix/bsd/openbsdlike/openbsd.rs:pub const
> KERN_CPTIME2: ::c_int = 71;
> spidermonkey-52.8.1
> third_party/rust/libc/src/unix/bsd/openbsdlike/bitrig.rs:pub const
> KERN_CPTIME2: ::c_int = 71;
> spidermonkey-52.8.1
> third_party/rust/libc/src/unix/bsd/openbsdlike/openbsd.rs:pub const
> KERN_CPTIME2: ::c_int = 71;
> suricata-4.0.5
> rust/vendor/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs:pub const
> KERN_CPTIME2: ::c_int = 71;
> tb-browser-7.5.3
> third_party/rust/libc/src/unix/bsd/openbsdlike/bitrig.rs:pub const
> KERN_CPTIME2: ::c_int = 71;
> tb-browser-7.5.3
> third_party/rust/libc/src/unix/bsd/openbsdlike/openbsd.rs:pub const
> KERN_CPTIME2: ::c_int = 71;
> thunderbird-52.9.1
> mozilla/third_party/rust/libc/src/unix/bsd/openbsdlike/bitrig.rs:pub const
> KERN_CPTIME2: ::c_int = 71;
> thunderbird-52.9.1
> mozilla/third_party/rust/libc/src/unix/bsd/openbsdlike/openbsd.rs:pub const
> KERN_CPTIME2: ::c_int = 71;
doing more tests, I felt motivated.
xfce4-cpugraph: hw.smt=0 ERROR
no console output, displays 8 cpu bars and nothing move on it.
xfce4-cpugraph: hw.smt=0 OK
bars get updated
gnome-system-monitor: hw.smt=0 ERROR crash dump
(gdb) bt
#0 thrkill () at -:3
#1 0x000003624601c75e in _libc_abort () at /usr/src/lib/libc/stdlib/abort.c:51
#2 0x0000036245fe6959 in wrterror (d=0x361cac29380, msg=0x3624617de99 "chunk
is already free %p") at /usr/src/lib/libc/stdlib/malloc.c:291
#3 0x0000036245fe765d in ofree (argpool=<optimized out>, p=<optimized out>,
clear=0, check=0, argsz=0) at /usr/src/lib/libc/stdlib/malloc.c:1261
#4 0x0000036245fe6a5c in free (ptr=0x36195cec630) at
/usr/src/lib/libc/stdlib/malloc.c:1419
#5 0x00000361c2311a6f in g_variant_type_info_get (type=0x361c52dfd10) at
gvarianttypeinfo.c:776
#6 0x00000361c2309ba1 in g_variant_alloc (type=0x0, serialised=0, trusted=1)
at gvariant-core.c:477
#7 g_variant_new_from_children (type=0x0, children=0x3619eb58b10,
n_children=2, trusted=1) at gvariant-core.c:565
#8 0x00000361c2305aae in g_variant_builder_end (builder=0x7f7ffffea4c0) at
gvariant.c:3703
#9 0x00000361c2307739 in g_variant_valist_new (str=0x7f7ffffea638,
app=0x7f7ffffea640) at gvariant.c:5199
#10 0x00000361c2306d7c in g_variant_new_va (format_string=0x35f8aa44fce "",
endptr=<optimized out>, app=<optimized out>) at gvariant.c:5372
#11 g_variant_builder_add (builder=0x7f7ffffea698, format_string=<optimized
out>) at gvariant.c:5528
#12 0x0000035f8a924e3e in ?? ()
#13 0x0000035f8a92484c in GsmApplication::load_settings() ()
#14 0x0000035f8a926798 in GsmApplication::on_startup() ()
#15 0x00000361b51a64dd in
Gio::Application_Class::startup_callback(_GApplication*) () from
/usr/local/lib/libgiomm-2.4.so.14.0
#16 0x00000361dcde9053 in g_closure_invoke (closure=0x361ef76d620,
return_value=0x0, n_param_values=1, param_values=0x7f7fffffab90,
invocation_hint=<optimized out>) at gclosure.c:804
#17 0x00000361dce015d3 in signal_emit_unlocked_R (node=<optimized out>,
detail=<optimized out>, instance=<optimized out>, emission_return=<optimized
out>, instance_and_params=<optimized out>) at gsignal.c:3565
#18 0x00000361dce026a5 in g_signal_emit_valist (instance=0x3622d4781a0,
signal_id=<optimized out>, detail=0, var_args=0x7f7fffffada0) at gsignal.c:3391
#19 0x00000361dce02d8f in g_signal_emit (instance=0x0, signal_id=6, detail=0)
at gsignal.c:3447
#20 0x000003626556a904 in g_application_register (application=0x3622d4781a0,
cancellable=0x0, error=0x7f7fffffae40) at gapplication.c:2137
#21 0x000003626556cb37 in g_application_real_local_command_line
(application=0x3622d4781a0, arguments=<optimized out>, exit_status=<optimized
out>) at gapplication.c:1086
#22 0x00000361b51a7feb in Gio::Application::local_command_line_vfunc(char**&,
int&) () from /usr/local/lib/libgiomm-2.4.so.14.0
#23 0x00000361b51a604d in
Gio::Application_Class::local_command_line_vfunc_callback(_GApplication*,
char***, int*) () from /usr/local/lib/libgiomm-2.4.so.14.0
#24 0x000003626556af81 in g_application_run (application=0x3622d4781a0,
argc=<optimized out>, argv=<optimized out>) at gapplication.c:2439
#25 0x0000035f8a92841f in main ()
gnome-system-monitor: hw.smt=1 OK
symon: hw.smt=0 : Seems ok, it doesn't crash and send data but we don't have
shmux to receive it. Using nc -u -l 2100 displays binary
symon: hw.smt=1 : Seems ok
consul: hw.smt=0 : "OK", I tried to deploy it but it's rather complicated.
$ consul info
runtime:
arch = amd64
cpu_count = 8
goroutines = 75
max_procs = 8
consul: hw.smt=1 : OK
$ consul info
runtime:
arch = amd64
cpu_count = 8
goroutines = 75
max_procs = 8
filebeat: hw.smt=0 : I can start it but no idea how to use it
filebeat: hw.smt=1 : same ^
net-snmp: can't find how to start it
heartbeat: hw.smt=0 it starts... dunno how to use it
heartbeat: hw.smt=1 it starts... dunno how to use it
packetbeat: hw.smt=0 it starts... dunno how to use it
packetbeat: hw.smt=1 it starts... dunno how to use it
metricbeat: hw.smt=0 it starts... dunno how to use it
metricbeat: hw.smt=1 it starts... dunno how to use it
tor-browser: hw.smt=0 OK
tor-browser: hw.smt=1 OK