Re: Crash in pmc: [pmc,1762] negative increment cpu=1 ri=17 newvalue=45d4906d saved=fffff616cee9 incr=ffff00004fbdc184
Date: Sun, 19 Jul 2026 12:26:42 UTC
Am 2026-07-14 20:49, schrieb Alexander Leidinger:
> Am 2026-07-14 00:28, schrieb Ali Mashtizadeh:
>
>> Hello Alexander,
>>
>> I believe this is related to a bug I'm looking into, otherwise you may
>> be using a counter that's not really a counter. We probably need to
>> remove that assert for some of the memory counters.
>>
>> With process mode counters we eventually don't re-enable the pmc on a
>> context switch and you will eventually just see zeros for the
>> incremental counts. That's probably what's happening here is that
>> when it queries the PMC it goes from some positive number to zero in
>> the next sample. Also explains why you don't see this problem with
>> sleep because it takes a few context switches for it to show up.
>>
>> Not sure when this bug was introduced but it seems to be fairly old
>> and I wasn't readily hitting it in some cases.
>>
>> Do you mind sharing the pmcstat command you tested with?
>
> cpuset -l 1 pmcstat -p inst_retired.any_p -p cpu_clk_unhalted.thread_p
> -p br_misp_retired.all_branches \
> /tmp/lame-off/lame/frontend/lame --quiet -b 320 /tmp/corpus.wav
> /tmp/o.mp3
>
> CPU Intel Xeon X5675 (Westmere-EP)
>
> from inside a jail
Fix and unit tests and another panic fix in:
https://reviews.freebsd.org/D58340
https://reviews.freebsd.org/D58341
https://reviews.freebsd.org/D58342
https://reviews.freebsd.org/D5834 [1]
Bye,
Alexander.
--
http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF
http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF
Links:
------
[1] https://reviews.freebsd.org/D58343