-
-
Notifications
You must be signed in to change notification settings - Fork 604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Ryzen 7000 Perplexing Error (FreeBSD 13/14 / Windows 11) #629
Comments
Since it's CPU specific you might have to step through the source code and tell us where the exception is thrown. The message |
I'm now 100% certain it is a Ryzen 7000 specific thing. Pulled the SSD from the Ryzen 7000 platform, installed it in an Intel platform, booted that SSD & |
gdb is not very helpful when stepping through the code. Guess the crash happens too early?
This is about as much as I can get from it... Really not sure what's going on. The resulting binary, building from source, does work on other platforms -- Intel 9th & 10th Gen, along with Ryzen 3000 & 5000 series. Not sure what the heck is going here. |
What do you mean? The error can't happen 'too early' Can you backup your config file and try to launch btop with an empty config directory? |
Pulled latest git updates, same issue still.
|
? |
Can confirm I get the same problem with FreeBSD 14. This was not an issue with 13.2. Only after the upgrade. |
With/without config directory present, it crashes all the same. It must be something related to new libs/headers from FreeBSD code base, at least that is my hunch. The odd thing being that it only applies to |
I've created a FreeBSD classic/thick jail with a fresh 14.0 Userland. btop works perfectly fine on it. But not the upgraded host system itself. Which tells me it's something with userland. Checking freebsd-version -kru or -ru on jail shows the same versions for all (14.0-RELEASE-p2). The weird thing is doing the upgrade, on a different machine, in a Hyper-V VM, worked perfectly fine without issues. But not on the host machine on bare metal. Despite going through the same processes and seeing same versions. For me personally. Out of all the applications, only btop has broken from the upgrade 13.2 -> 14.0. |
On a Ryzen 7000 system, I get a similar but not identical error on master:
I suppose it's the same underlying problem. The OS is Fedora Linux 39 though. make info
|
@zenofile |
What I just realized when trying to get more useful information with the debugger: It seems to only throws on my vertical/portrait mode display when there are noticeable more rows than columns and only if started with terminal already being that size. When running in a smaller terminal and resizing, I cannot reproduce the error. It crashes as soon as
|
@zenofile So will need to add some more checks for @imwints For example a The same could be done for The code will need to adapted somewhat however to check if the value returned when querying a map is empty in some places to avoid other errors in the draw functions. |
@aristocratos I have about 10 NFSv4 network shares that require Kerberos authentication. When they are authenticated, btop runs fine, otherwise I get a bunch of As they were reported as “Ignored” I didn't think anything of it. |
@zenofile Thanks for the info. The crash is likely then because the disks that are not responding are removed from the disks list but the draw functions are still expecting them to be there. The fix should still be the same by just adding a extra check if the disk exists when drawing. |
But do you think this is the same that happens to the original issuer? The first error happens either directly in This now is about But I'm curious why this happens only with Ryzen CPU like the author claims |
OP here. Things are still weird.... ~/Downloads/btop> gmake
██████╗ ████████╗ ██████╗ ██████╗
██╔══██╗╚══██╔══╝██╔═══██╗██╔══██╗ ██╗ ██╗
██████╔╝ ██║ ██║ ██║██████╔╝ ██████╗██████╗
██╔══██╗ ██║ ██║ ██║██╔═══╝ ╚═██╔═╝╚═██╔═╝
██████╔╝ ██║ ╚██████╔╝██║ ╚═╝ ╚═╝
╚═════╝ ╚═╝ ╚═════╝ ╚═╝ Makefile v1.6
PLATFORM ?| FreeBSD
ARCH ?| x86_64
GPU_SUPPORT :| false
CXX ?| c++ (16.0.6)
THREADS :| 32
REQFLAGS !| -std=c++20
WARNFLAGS :| -Wall -Wextra -pedantic
OPTFLAGS :| -O2 -ftree-vectorize -flto=thin
LDCXXFLAGS :| -pthread -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -D_FILE_OFFSET_BITS=64 -fexceptions -fstack-clash-protection -fcf-protection -fstack-protector -lm -lkvm -ldevstat -Wl,-rpath=/usr/local/lib/gcc16 -lstdc++
CXXFLAGS +| $(REQFLAGS) $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS)
LDFLAGS +| $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS)
Building btop++ (v1.3.0) FreeBSD x86_64
Compiling src/btop_tools.cpp
Compiling src/btop.cpp
Compiling src/freebsd/btop_collect.cpp
Compiling src/btop_input.cpp
Compiling src/btop_theme.cpp
Compiling src/btop_draw.cpp
Compiling src/btop_menu.cpp
Compiling src/btop_shared.cpp
Compiling src/btop_config.cpp
c++: warning: c++: -lm: 'linker' input unused [-Wunused-command-line-argument]warning:
c++: -lm: 'linker' input unused [-Wunused-command-line-argument]warning:
-lkvm: 'linker' input unused [-Wunused-command-line-argument]c++
: c++: warning: warning: -lkvm: 'linker' input unused [-Wunused-command-line-argument]-ldevstat: 'linker' input unused [-Wunused-command-line-argument]
c++: c++warning: : warning: -ldevstat: 'linker' input unused [-Wunused-command-line-argument]-Wl,-rpath=/usr/local/lib/gcc16: 'linker' input unused [-Wunused-command-line-argument]
c++: c++warning: : -Wl,-rpath=/usr/local/lib/gcc16: 'linker' input unused [-Wunused-command-line-argument]
c++warning: : -Z-reserved-lib-stdc++: 'linker' input unused [-Wunused-command-line-argument]warning:
-Z-reserved-lib-stdc++: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -lkvm: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -ldevstat: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -Wl,-rpath=/usr/local/lib/gcc16: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -Z-reserved-lib-stdc++: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -lkvm: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -ldevstat: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -Wl,-rpath=/usr/local/lib/gcc16: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -Z-reserved-lib-stdc++: 'linker' input unused [-Wunused-command-line-argument]
c++c++: : warning: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
-lm: 'linker' input unused [-Wunused-command-line-argument]
c++: c++: warning: -lkvm: 'linker' input unused [-Wunused-command-line-argument]warning: -lkvm: 'linker' input unused [-Wunused-command-line-argument]
c++:
warning: -ldevstat: 'linker' input unused [-Wunused-command-line-argument]
c++c++: : warning: -ldevstat: 'linker' input unused [-Wunused-command-line-argument]
warning: -Wl,-rpath=/usr/local/lib/gcc16: 'linker' input unused [-Wunused-command-line-argument]
c++c++: warning: -Wl,-rpath=/usr/local/lib/gcc16: 'linker' input unused [-Wunused-command-line-argument]: warning: -Z-reserved-lib-stdc++: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -Z-reserved-lib-stdc++: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -lkvm: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -ldevstat: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -Wl,-rpath=/usr/local/lib/gcc16: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -Z-reserved-lib-stdc++: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -lkvm: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -ldevstat: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -Wl,-rpath=/usr/local/lib/gcc16: 'linker' input unused [-Wunused-command-line-argument]
c++: c++: warning: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
c++-Z-reserved-lib-stdc++: 'linker' input unused [-Wunused-command-line-argument]
: warning: -lkvm: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -ldevstat: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -Wl,-rpath=/usr/local/lib/gcc16: 'linker' input unused [-Wunused-command-line-argument]
c++: warning: -Z-reserved-lib-stdc++: 'linker' input unused [-Wunused-command-line-argument]
src/btop_tools.cpp:197:30: warning: 'codecvt_utf8<wchar_t>' is deprecated [-Wdeprecated-declarations]
std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
^
/usr/include/c++/v1/codecvt:187:28: note: 'codecvt_utf8<wchar_t>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8
^
/usr/include/c++/v1/__config:808:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
# define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
^
/usr/include/c++/v1/__config:781:49: note: expanded from macro '_LIBCPP_DEPRECATED'
# define _LIBCPP_DEPRECATED __attribute__((deprecated))
^
src/btop_tools.cpp:197:9: warning: 'wstring_convert<std::codecvt_utf8<wchar_t>>' is deprecated [-Wdeprecated-declarations]
std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
^
/usr/include/c++/v1/locale:3603:28: note: 'wstring_convert<std::codecvt_utf8<wchar_t>>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert
^
/usr/include/c++/v1/__config:808:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
# define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
^
/usr/include/c++/v1/__config:781:49: note: expanded from macro '_LIBCPP_DEPRECATED'
# define _LIBCPP_DEPRECATED __attribute__((deprecated))
^
src/btop_tools.cpp:227:31: warning: 'codecvt_utf8<wchar_t>' is deprecated [-Wdeprecated-declarations]
std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
^
/usr/include/c++/v1/codecvt:187:28: note: 'codecvt_utf8<wchar_t>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8
^
/usr/include/c++/v1/__config:808:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
# define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
^
/usr/include/c++/v1/__config:781:49: note: expanded from macro '_LIBCPP_DEPRECATED'
# define _LIBCPP_DEPRECATED __attribute__((deprecated))
^
src/btop_tools.cpp:227:10: warning: 'wstring_convert<std::codecvt_utf8<wchar_t>>' is deprecated [-Wdeprecated-declarations]
std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
^
/usr/include/c++/v1/locale:3603:28: note: 'wstring_convert<std::codecvt_utf8<wchar_t>>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert
^
/usr/include/c++/v1/__config:808:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
# define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
^
/usr/include/c++/v1/__config:781:49: note: expanded from macro '_LIBCPP_DEPRECATED'
# define _LIBCPP_DEPRECATED __attribute__((deprecated))
^
10% -> obj/btop_input.o (356KiB) (03s)
20% -> obj/btop_theme.o (380KiB) (03s)
30% -> obj/btop_shared.o (448KiB) (03s)
4 warnings generated.
40% -> obj/btop_tools.o (640KiB) (03s)
50% -> obj/btop_config.o (672KiB) (03s)
60% -> obj/btop.o (736KiB) (04s)
70% -> obj/freebsd/btop_collect.o (736KiB) (04s)
80% -> obj/btop_menu.o (896KiB) (04s)
90% -> obj/btop_draw.o (1.1MiB) (04s)
Linking and optimizing binary...
100% -> bin/btop (1.7MiB) (12s)
Build complete in (16s)
~/Downloads/btop> cd bin
~/Downloads/btop/bin>
~/Downloads/btop/bin> ./btop
ERROR: Exception in Shared::init() -> key not found
~/Downloads/btop/bin> |
I'm gonna be implementing some safer containers shortly which should prevent the crash from happening and produce some useful output instead of only It might crash at a later point instead however since something obviously is going wrong when initializing. |
@thesunexpress @zenofile Compile: git pull
git checkout map_safety
gmake distclean
gmake DEBUG=true And then run |
If the full backtrace is needed, I can provide it somewhat anonymized. I don't want to hijack OP's thread at this point if this is unrelated. |
No love from my terminal...
|
@thesunexpress @zenofile |
@thesunexpress Need the output from your logfile also. |
With the new commits it doesn't crash anymore. The network shares show up for a single refresh cycle in the disks output window (as 0/0 Bytes used) and then just disappear at the same time the |
Indeed, listing temps for only 2 cpus at the moment. Here's a quick log, starting with a clean state without a
EDIT: Never mind that up ^^^ there. |
PR #696 merged which fixes the crashes. But leaving the issue open since the cause of the issue isn't fixed yet. |
This latest merge is working for me. I'll keep an eye on it for a little bit as I noticed occasional crashes before the latest commits, while under heavy load/long running. |
I also had an actual segmentation fault with a8fda16 on a very lightly loaded Ryzen 7000 Linux system just now. No coredump was captured, so no backtrace but planning on obtaining one next time. |
Thread 3 (Thread 0x7fe9f0ff96c0 (LWP 77873)):
#0 0x00007fea07b2619a in read () from /lib64/libc.so.6
#1 0x00007fea07cd805f in std::__basic_file<char>::xsgetn (this=this@entry=0x7fea07e4fb08 <__gnu_internal::buf_cin+104>, __s=0x56219dde7090 "", __n=__n@entry=8191) at basic_file.cc:340
#2 0x00007fea07d1b308 in std::basic_filebuf<char, std::char_traits<char> >::underflow (this=0x7fea07e4faa0 <__gnu_internal::buf_cin>) at /usr/src/debug/gcc-13.2.1-6.fc39.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/fstream.tcc:354
#3 0x00007fea07d50d36 in std::basic_streambuf<char, std::char_traits<char> >::uflow (this=0x7fea07e4faa0 <__gnu_internal::buf_cin>) at /usr/src/debug/gcc-13.2.1-6.fc39.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/streambuf:710
#4 0x00007fea07d2854e in std::basic_streambuf<char, std::char_traits<char> >::sbumpc (this=<optimized out>) at /usr/src/debug/gcc-13.2.1-6.fc39.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/streambuf:323
#5 std::basic_streambuf<char, std::char_traits<char> >::sbumpc (this=<optimized out>) at /usr/src/debug/gcc-13.2.1-6.fc39.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/streambuf:323
#6 std::basic_istream<char, std::char_traits<char> >::get (this=0x56219d7f2d20 <std::cin>, __c=@0x7fe9f0ff8e6f: 0 '\000') at /usr/src/debug/gcc-13.2.1-6.fc39.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/istream.tcc:306
#7 0x000056219d71baef in Input::InputThr::runImpl (this=0x56219de434f0) at src/btop_input.cpp:112
#8 Input::InputThr::run (that=0x56219de434f0) at src/btop_input.cpp:105
#9 0x00007fea07ce31e3 in std::execute_native_thread_routine (__p=0x56219ddde980) at ../../../../../libstdc++-v3/src/c++11/thread.cc:104
#10 0x00007fea07aac897 in start_thread () from /lib64/libc.so.6
#11 0x00007fea07b336fc in clone3 () from /lib64/libc.so.6
Thread 2 (Thread 0x7fea07ea3740 (LWP 77853)):
#0 0x00007fea07af71a3 in clock_nanosleep@GLIBC_2.2.5 () from /lib64/libc.so.6
#1 0x00007fea07b09a37 in nanosleep () from /lib64/libc.so.6
#2 0x000056219d72287a in std::this_thread::sleep_for<long, std::ratio<1l, 1000l> > (__rtime=...) at /usr/include/c++/13/bits/this_thread_sleep.h:80
#3 Tools::sleep_ms (ms=<optimized out>) at src/btop_tools.hpp:308
#4 Input::poll (timeout=1000) at src/btop_input.cpp:161
#5 0x000056219d6af0a4 in main (argc=<optimized out>, argv=<optimized out>) at /usr/include/c++/13/bits/stl_algobase.h:233
Thread 1 (Thread 0x7fe9f17fa6c0 (LWP 77863)):
#0 0x000056219d719143 in std::_Hashtable<unsigned long, std::pair<unsigned long const, int>, std::allocator<std::pair<unsigned long const, int> >, std::__detail::_Select1st, std::equal_to<unsigned long>, std::hash<unsigned long>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::erase (__k=<optimized out>, this=<optimized out>) at /usr/include/c++/13/bits/hashtable.h:984
#1 std::unordered_map<unsigned long, int, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, int> > >::erase (__x=<optimized out>, this=<optimized out>) at /usr/include/c++/13/bits/unordered_map.h:770
#2 Proc::draw[abi:cxx11](std::vector<Proc::proc_info, std::allocator<Proc::proc_info> > const&, bool, bool) (plist=std::vector of length 688, capacity 688 = {...}, force_redraw=<optimized out>, data_same=false) at src/btop_draw.cpp:1933
#3 0x000056219d6ceab1 in Runner::_runner () at src/btop.cpp:645
#4 0x00007fea07aac897 in start_thread () from /lib64/libc.so.6
#5 0x00007fea07b336fc in clone3 () from /lib64/libc.so.6 |
I've had a crash/dump or two as well, without a coredump captured. Are you running |
@thesunexpress |
I was unable to get it to crash when gdb was attached. The trace from above is from an optimized build with extra debug symbols and the core file was saved by the registered handler (kernel.core_pattern = systemd-coredump…) after it got invoked by the kernel, like @imwints said. I believe FreeBSD has a similar kernel knob ( The actual event also seems to be pretty random and a single btop instance that ran overnight is still running fine. |
I can now reproduce the crash reliably with I also did test with |
@zenofile Can you post the full debug output you get when crashing during stress testing with |
Sure, this is all I got: A backtrace followed by a full backtrace, btop.log, a binary with debug symbols and the core. gdb.txt Edit: Also a backtrace for a non-optimized debug build gdb_debug_build.txt |
@zenofile Edit: Ignore that, got an old cached gdb.txt for some reason... |
@zenofile Pushed some changes to improve safety for map erase in |
That seems to have fixed the issue, at least it does not crash with stress-ng. |
On FreeBSD, systemd is teh supreme evil to some of us ;-) |
Can confirm the new main repo fixed the issue for me by just running git clone and gmake. |
Describe the bug
Running
btop++
either on FreeBSD 13 or 14, along with testing on Windows 11, results in immediate crash ofbtop++
A rather cryptic:
...is returned.
Crucially, this occurs exactly the same on both FreeBSD & Windows, which would seem to suggest there is something up with how btop++ detects this hardware.
To Reproduce
Build from git repo source for FreeBSD, run ./btop
Installed from available btop4win releases for Windows 11.
With or without ~/.config/btop present.
Expected behavior
Sexy top stats, instead, no love.
Screenshots
N/A no useful graphical output
Info (please complete the following information):
ERROR: Exception in Shared::init() -> key not found
Running btop++ with --debug or with gdb offers no additional information, other than the previously mentioned
ERROR: Exception in Shared::init() -> key not found
(which isn't very helpful at all...)Running
btop++
on any of my other boxes, be that a retiring Intel X299 or Ryzen 5950X build-box, works as expected & have been running for ages now, without issue. Whatever this bug may be, it seems to be a Ryzen 7000 thing. For what it is worth,bpytop
runs fine on all boxes, regardless of Ryzen generation.The text was updated successfully, but these errors were encountered: