Bug 262866 - sysutils/turbostat crash at start (segmentation fault (core dumped)) on Ivy Bridge
Summary: sysutils/turbostat crash at start (segmentation fault (core dumped)) on Ivy B...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jan Beich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-27 15:52 UTC by Graham Perrin
Modified: 2023-02-19 00:51 UTC (History)
0 users

See Also:
jbeich: merge-quarterly+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Perrin freebsd_committer freebsd_triage 2022-03-27 15:52:03 UTC
% turbostat
turbostat version 17.06.23 - Len Brown <lenb@kernel.org>
Segmentation fault (core dumped)
% man turbostat
% gdb /usr/local/sbin/turbostat
…
(gdb) run
Starting program: /usr/local/sbin/turbostat 
warning: Could not load shared library symbols for [vdso].
Do you need "set solib-search-path" or "set sysroot"?
turbostat version 17.06.23 - Len Brown <lenb@kernel.org>

Program received signal SIGSEGV, Segmentation fault.
Address not mapped to object.
0x000000000021292f in ?? ()
(gdb) q
A debugging session is active.

        Inferior 1 [process 28494] will be killed.

Quit anyway? (y or n) y
% pkg info -x turbostat
turbostat-4.17_2
% date ; uname -aKU
Sun 27 Mar 2022 16:34:42 BST
FreeBSD mowa219-gjp4-8570p-freebsd 14.0-CURRENT FreeBSD 14.0-CURRENT #7 main-n253861-92e6b4712b5-dirty: Sat Mar 19 02:40:21 GMT 2022     root@mowa219-gjp4-8570p-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64 1400053 1400053
% cpufetch --debug
cpufetch v1.00 (FreeBSD x86_64 build)
Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz
- Max standard level: 0x0000000D
- Max extended level: 0x80000008
- CPUID dump: 0x000306A9
%
Comment 1 commit-hook freebsd_committer freebsd_triage 2023-02-19 00:48:16 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b27279cba1cad5a4f00237ddfffe11789e1c2053

commit b27279cba1cad5a4f00237ddfffe11789e1c2053
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2023-02-19 00:28:44 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2023-02-19 00:44:25 +0000

    sysutils/turbostat: unbreak runtime on FreeBSD >= 13.1

    $ turbostat
    turbostat version 17.06.23 - Len Brown <lenb@kernel.org>
    Segmentation fault

    * thread #1, name = 'turbostat', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
        frame #0: 0x0000000000216992 turbostat`topology_probe at turbostat.c:4685:7
       4682          * Validate that all cpus in cpu_subset are also in cpu_present_set
       4683          */
       4684         for (i = 0; i < CPU_SUBSET_MAXCPUS; ++i) {
    -> 4685                 if (CPU_ISSET_S(i, cpu_subset_size, cpu_subset))
       4686                         if (!CPU_ISSET_S(i, cpu_present_setsize, cpu_present_set))
       4687                                 err(1, "cpu%d not present", i);
       4688         }
    (lldb) bt
    * thread #1, name = 'turbostat', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
      * frame #0: 0x0000000000216992 turbostat`topology_probe at turbostat.c:4685:7
        frame #1: 0x00000000002111c9 turbostat`setup_all_buffers at turbostat.c:4853:2
        frame #2: 0x0000000000217909 turbostat`turbostat_init at turbostat.c:4888:2
        frame #3: 0x0000000000218f3f turbostat`main(argc=1, argv=0x0000000820444710) at turbostat.c:5447:2
        frame #4: 0x0000000000207160 turbostat`_start(ap=<unavailable>, cleanup=<unavailable>) at crt1_c.c:73:7
    (lldb) p cpu_subset
    (cpu_set_t *) $0 = NULL

    PR:             262866

 sysutils/turbostat/Makefile                |  2 +-
 sysutils/turbostat/files/patch-turbostat.c | 11 ++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-02-19 00:50:19 UTC
A commit in branch 2023Q1 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c89319e9c7b0e184ebbd82549788279b04a9cf76

commit c89319e9c7b0e184ebbd82549788279b04a9cf76
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2023-02-19 00:28:44 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2023-02-19 00:49:22 +0000

    sysutils/turbostat: unbreak runtime on FreeBSD >= 13.1

    $ turbostat
    turbostat version 17.06.23 - Len Brown <lenb@kernel.org>
    Segmentation fault

    * thread #1, name = 'turbostat', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
        frame #0: 0x0000000000216992 turbostat`topology_probe at turbostat.c:4685:7
       4682          * Validate that all cpus in cpu_subset are also in cpu_present_set
       4683          */
       4684         for (i = 0; i < CPU_SUBSET_MAXCPUS; ++i) {
    -> 4685                 if (CPU_ISSET_S(i, cpu_subset_size, cpu_subset))
       4686                         if (!CPU_ISSET_S(i, cpu_present_setsize, cpu_present_set))
       4687                                 err(1, "cpu%d not present", i);
       4688         }
    (lldb) bt
    * thread #1, name = 'turbostat', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
      * frame #0: 0x0000000000216992 turbostat`topology_probe at turbostat.c:4685:7
        frame #1: 0x00000000002111c9 turbostat`setup_all_buffers at turbostat.c:4853:2
        frame #2: 0x0000000000217909 turbostat`turbostat_init at turbostat.c:4888:2
        frame #3: 0x0000000000218f3f turbostat`main(argc=1, argv=0x0000000820444710) at turbostat.c:5447:2
        frame #4: 0x0000000000207160 turbostat`_start(ap=<unavailable>, cleanup=<unavailable>) at crt1_c.c:73:7
    (lldb) p cpu_subset
    (cpu_set_t *) $0 = NULL

    PR:             262866
    (cherry picked from commit b27279cba1cad5a4f00237ddfffe11789e1c2053)

 sysutils/turbostat/Makefile                |  2 +-
 sysutils/turbostat/files/patch-turbostat.c | 11 ++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)