Skip to content
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

SIGFPE on startup #9

Closed
ddevault opened this issue Aug 10, 2018 · 2 comments
Closed

SIGFPE on startup #9

ddevault opened this issue Aug 10, 2018 · 2 comments

Comments

@ddevault
Copy link

Just built from source using the default config and gave it a run:

(gdb) bt full
#0  0x00005566cf88b4ff in waybar::modules::Battery::update() (this=0x5566cfeba460) at ../src/modules/battery.cpp:46
        total = 0
        charging = false
        format = "{}% "
#1  0x00005566cf88aa91 in waybar::modules::Battery::<lambda()>::operator()(void) const (__closure=0x5566cfedf7a0) at ../src/modules/battery.cpp:20
        this = 0x5566cfeba460
#2  0x00005566cf88b974 in std::_Function_handler<void(), waybar::modules::Battery::Battery(Json::Value)::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...)
    at /usr/include/c++/8.2.0/bits/std_function.h:297
#3  0x00005566cf88d88e in std::function<void ()>::operator()() const (this=0x5566cfedf7a0) at /usr/include/c++/8.2.0/bits/std_function.h:687
#4  0x00005566cf88c7eb in waybar::util::SleeperThread::operator=(std::function<void ()>)::{lambda()#1}::operator()() const (__closure=0x5566cfedf798) at ../include/util/chrono.hpp:48
        func = 
          {<std::_Maybe_unary_or_binary_function<void>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x5566cfeba460, _M_const_object = 0x5566cfeba460, _M_function_pointer = 0x5566cfeba460, _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x5566cfeba460, this adjustment 140723131598032}, _M_pod_data = "`\244\353\317fU\000\000\320DE\250\374\177\000"}, _M_manager = 0x5566cf88b977 <std::_Function_base::_Base_manager<waybar::modules::Battery::Battery(Json::Value)::<lambda()> >::_M_manager(std::_Any_data &, const std::_Any_data &, std::_Manager_operation)>}, _M_invoker = 0x5566cf88b954 <std::_Function_handler<void(), waybar::modules::Battery::Battery(Json::Value)::<lambda()> >::_M_invoke(const std::_Any_data &)>}
        this = 0x5566cfeba480
#5  0x00005566cf88eb01 in std::__invoke_impl<void, waybar::util::SleeperThread::operator=(std::function<void ()>)::{lambda()#1}>(std::__invoke_other, waybar::util::SleeperThread::operator=(std::function<void ()>)::{lambda()#1}&&) (__f=...) at /usr/include/c++/8.2.0/bits/invoke.h:60
#6  0x00005566cf88d94b in std::__invoke<waybar::util::SleeperThread::operator=(std::function<void ()>)::{lambda()#1}>(std::__invoke_result&&, (waybar::util::SleeperThread::operator=(std::function<void ()>)::{lambda()#1}&&)...) (__fn=...) at /usr/include/c++/8.2.0/bits/invoke.h:95
#7  0x00005566cf8911b2 in std::thread::_Invoker<std::tuple<waybar::util::SleeperThread::operator=(std::function<void ()>)::{lambda()#1}> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=0x5566cfedf798) at /usr/include/c++/8.2.0/thread:234
#8  0x00005566cf891188 in std::thread::_Invoker<std::tuple<waybar::util::SleeperThread::operator=(std::function<void ()>)::{lambda()#1}> >::operator()() (this=0x5566cfedf798)
    at /usr/include/c++/8.2.0/thread:243
#9  0x00005566cf89116c in std::thread::_State_impl<std::thread::_Invoker<std::tuple<waybar::util::SleeperThread::operator=(std::function<void ()>)::{lambda()#1}> > >::_M_run() (this=0x5566cfedf790) at /usr/include/c++/8.2.0/thread:186
#10 0x00007f08aa739043 in execute_native_thread_routine (__p=0x5566cfedf790) at /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:80
        __t = std::unique_ptr<std::thread::_State> = {get() = 0x5566cfedf790}
#11 0x00007f08aa4c4a8d in start_thread () at /usr/lib/libpthread.so.0
#12 0x00007f08aa3f4823 in clone () at /usr/lib/libc.so.6

Note, I don't have a battery.

@Alexays
Copy link
Owner

Alexays commented Aug 10, 2018

Hmm thats why 😄
There is no check when no batteries is available
Fixed in d728de2

@Alexays Alexays closed this as completed Aug 10, 2018
@ddevault
Copy link
Author

Thanks!

@Alexays Alexays mentioned this issue Aug 10, 2018
Alexays pushed a commit that referenced this issue Apr 17, 2020
cfillion added a commit to cfillion/Waybar that referenced this issue Oct 17, 2024
`Workspaces::*` and `IPC::startIPC` may both call `getSocketFolder` at the same time.

This randomly causes crashes and/or corruption of the socket path.

Typycal crash A:

    [2024-10-16 07:42:09.987] [info] Hyprland IPC starting
    malloc(): unaligned tcache chunk detected
    [2024-10-16 07:42:09.987] [error] Hyprland IPC: Unable to connect?
    Thread 1 "waybar" received signal SIGABRT, Aborted.
    (gdb) bt
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
    (omitted for brievety)
    Alexays#9  0x00007ffff64ae745 in operator new (sz=sz@entry=296) at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/new_op.cc:50
    Alexays#10 0x00007ffff65ab1f1 in std::filesystem::__cxx11::path::_List::_Impl::copy (this=0x555555a23350) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++17/fs_path.cc:249
    Alexays#11 0x00007ffff65ab3bd in std::filesystem::__cxx11::path::_List::_List (this=0x7fffffff9d30, other=<optimized out>) at /usr/src/debug/gcc/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/unique_ptr.h:454
    Alexays#12 0x00005555556f4ab1 in waybar::modules::hyprland::IPC::getSocket1Reply(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
    Alexays#13 0x00005555556f5e3d in waybar::modules::hyprland::IPC::getSocket1JsonReply(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
    Alexays#14 0x000055555571289c in waybar::modules::hyprland::Workspaces::setCurrentMonitorId() ()

Typical crash B:

    [2024-10-16 10:01:15.859] [info] Hyprland IPC starting
    [2024-10-16 10:01:15.859] [info] Loading persistent workspaces from Hyprland workspace rules
    Thread 8 "waybar" received signal SIGSEGV, Segmentation fault.
    (gdb) bt
    #0  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy
        (__d=0x5555558fbca8 "/", __s=0x2973961a26d35726 <error: Cannot access memory at address 0x2973961a26d35726>, __n=1)
        at /usr/src/debug/gcc/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:433
    (omitted for brievety)
    Alexays#15 waybar::modules::hyprland::IPC::getSocketFolder[abi:cxx11](char const*)
        (instanceSig=0x7fffffffe604 "4520b30d498daca8079365bdb909a8dea38e8d55_1729051218_1982280648") at ../src/modules/hyprland/backend.cpp:41
    Alexays#16 0x000055555564230f in waybar::modules::hyprland::IPC::startIPC()::{lambda()Alexays#1}::operator()() const ()
        at ../src/modules/hyprland/backend.cpp:70
    Alexays#17 0x00007ffff64e1c34 in std::execute_native_thread_routine (__p=0x5555558119c0) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:104
    Alexays#18 0x00007ffff62a339d in start_thread (arg=<optimized out>) at pthread_create.c:447
cfillion added a commit to cfillion/Waybar that referenced this issue Oct 17, 2024
`Workspaces::*` and `IPC::startIPC` may both call `getSocketFolder` at the same time.

This randomly causes crashes and/or corruption of the socket path.

Typical crash A:

    [2024-10-16 07:42:09.987] [info] Hyprland IPC starting
    malloc(): unaligned tcache chunk detected
    [2024-10-16 07:42:09.987] [error] Hyprland IPC: Unable to connect?
    Thread 1 "waybar" received signal SIGABRT, Aborted.
    (gdb) bt
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
    (omitted for brievety)
    Alexays#9  0x00007ffff64ae745 in operator new (sz=sz@entry=296) at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/new_op.cc:50
    Alexays#10 0x00007ffff65ab1f1 in std::filesystem::__cxx11::path::_List::_Impl::copy (this=0x555555a23350) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++17/fs_path.cc:249
    Alexays#11 0x00007ffff65ab3bd in std::filesystem::__cxx11::path::_List::_List (this=0x7fffffff9d30, other=<optimized out>) at /usr/src/debug/gcc/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/unique_ptr.h:454
    Alexays#12 0x00005555556f4ab1 in waybar::modules::hyprland::IPC::getSocket1Reply(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
    Alexays#13 0x00005555556f5e3d in waybar::modules::hyprland::IPC::getSocket1JsonReply(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
    Alexays#14 0x000055555571289c in waybar::modules::hyprland::Workspaces::setCurrentMonitorId() ()

Typical crash B:

    [2024-10-16 10:01:15.859] [info] Hyprland IPC starting
    [2024-10-16 10:01:15.859] [info] Loading persistent workspaces from Hyprland workspace rules
    Thread 8 "waybar" received signal SIGSEGV, Segmentation fault.
    (gdb) bt
    #0  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy
        (__d=0x5555558fbca8 "/", __s=0x2973961a26d35726 <error: Cannot access memory at address 0x2973961a26d35726>, __n=1)
        at /usr/src/debug/gcc/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:433
    (omitted for brievety)
    Alexays#15 waybar::modules::hyprland::IPC::getSocketFolder[abi:cxx11](char const*)
        (instanceSig=0x7fffffffe604 "4520b30d498daca8079365bdb909a8dea38e8d55_1729051218_1982280648") at ../src/modules/hyprland/backend.cpp:41
    Alexays#16 0x000055555564230f in waybar::modules::hyprland::IPC::startIPC()::{lambda()Alexays#1}::operator()() const ()
        at ../src/modules/hyprland/backend.cpp:70
    Alexays#17 0x00007ffff64e1c34 in std::execute_native_thread_routine (__p=0x5555558119c0) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:104
    Alexays#18 0x00007ffff62a339d in start_thread (arg=<optimized out>) at pthread_create.c:447
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants