GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    kimapr (kimapr@ublog.kimapr.net)'s status on Friday, 17-Apr-2026 09:33:03 JST kimapr kimapr

    Oh my god btop++ code is horrible. No wonder it fucking dies whenever you look at it wrong.

    In conversation about 2 months ago from ublog.kimapr.net permalink
    • Rich Felker repeated this.
    • Embed this notice
      kimapr (kimapr@ublog.kimapr.net)'s status on Friday, 17-Apr-2026 11:10:17 JST kimapr kimapr
      in reply to

      Notice how there are two threads. Why does a task manager program even have two threads? For a really bad reason. What the main thread does here is fire up a “secondary” thread that seems to be doing all the work. It waits 5 seconds for it to complete, and then if it still haven’t, calls pthread_cancel on it and tries to start it over. There’s a loop reading an atomic variable over and over with a 1ms sleep in between which is how the 5 second wait is implemented. Okay

      I assume there’s tons of bugs in the code that cause random hangs to happen, and this is how the dev decided to tackle the issue.

      In conversation about 2 months ago permalink
    • Embed this notice
      kimapr (kimapr@ublog.kimapr.net)'s status on Friday, 17-Apr-2026 11:10:19 JST kimapr kimapr
      in reply to

      Im basically trying to debug an issue in btop where under heavy system load it can sometimes just hang (the stress test i’m using is filling up RAM with garbage until the whole system gets severe levels of thrashing). It’s pretty annoying to reproduce and often instead of hanging it crashes instead (or maybe commit 6164470 always crashes while 1.4.6 hangs. can’t really tell for sure nope 1.4.6 also crashes). For the crashes, the backtraces seem to always be like this:

      (gdb) thread apply all bt Thread 2 (Thread 0x7fc967ed3780 (LWP 6988)): #0 0x00007fc967aaa4fe in __syscall_cancel_arch () from /gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-2.41/lib/libc.so.6 #1 0x00007fc967a9f788 in __internal_syscall_cancel () from /gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-2.41/lib/libc.so.6 #2 0x00007fc967a9fd9c in __futex_abstimed_wait_common () from /gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-2.41/lib/libc.so.6 #3 0x00007fc967aa4504 in __pthread_clockjoin_ex () from /gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-2.41/lib/libc.so.6 #4 0x000000000043ddb1 in Runner::run (box=..., no_update=no_update@entry=false, force_redraw=force_redraw@entry=false) at src/btop.cpp:749 #5 0x0000000000441069 in btop_main (args=...) at src/btop.cpp:1166 #6 0x00000000004378d2 in main (argc=<optimized out>, argv=<optimized out>) at src/main.cpp:11 Thread 1 (Thread 0x7fc9665fd6c0 (LWP 13929) (Exiting)): #0 0x00007fc967aa46dc in __pthread_kill_implementation () from /gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-2.41/lib/libc.so.6 #1 0x00007fc967a51a02 in raise () from /gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-2.41/lib/libc.so.6 #2 0x00007fc967a3aed1 in abort () from /gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-2.41/lib/libc.so.6 #3 0x00007fc967caea64 in ?? () from /gnu/store/xm7i1gvi0i9pyndlkv627r08rsw1ny96-gcc-15.2.0-lib/lib/libstdc++.so.6 #4 0x00007fc967cc109a in ?? () from /gnu/store/xm7i1gvi0i9pyndlkv627r08rsw1ny96-gcc-15.2.0-lib/lib/libstdc++.so.6 #5 0x00007fc967cae5ee in std::terminate() () from /gnu/store/xm7i1gvi0i9pyndlkv627r08rsw1ny96-gcc-15.2.0-lib/lib/libstdc++.so.6 #6 0x00007fc967cae506 in ?? () from /gnu/store/xm7i1gvi0i9pyndlkv627r08rsw1ny96-gcc-15.2.0-lib/lib/libstdc++.so.6 #7 0x00007fc967ef9f52 in ?? () from /gnu/store/xm7i1gvi0i9pyndlkv627r08rsw1ny96-gcc-15.2.0-lib/lib/libgcc_s.so.1 #8 0x00007fc967efa67a in _Unwind_ForcedUnwind () from /gnu/store/xm7i1gvi0i9pyndlkv627r08rsw1ny96-gcc-15.2.0-lib/lib/libgcc_s.so.1 #9 0x00007fc967aaab80 in __pthread_unwind () from /gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-2.41/lib/libc.so.6 #10 0x00007fc967a9f733 in __syscall_do_cancel () from /gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-2.41/lib/libc.so.6 #11 0x00007fc967a9f788 in __internal_syscall_cancel () from /gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-2.41/lib/libc.so.6 #12 0x00007fc967a9f7cd in __syscall_cancel () from /gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-2.41/lib/libc.so.6 #13 0x00007fc967b1f124 in sendto () from /gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-2.41/lib/libc.so.6 #14 0x00007fc967b2b274 in __netlink_request () from /gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-2.41/lib/libc.so.6 #15 0x00007fc967b2b5b6 in getifaddrs_internal () from /gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-2.41/lib/libc.so.6 #16 0x00007fc967b2c2e8 in getifaddrs () from /gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-2.41/lib/libc.so.6 #17 0x000000000053c1ca in Net::IfAddrsPtr::IfAddrsPtr (this=0x7fc9665fc8b0) at src/linux/../btop_shared.hpp:335 #18 Net::collect (no_update=<optimized out>) at src/linux/btop_collect.cpp:2611 #19 0x000000000044412e in Runner::_runner () at src/btop.cpp:619 #20 0x00007fc967aa2aed in start_thread () from /gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-2.41/lib/libc.so.6 #21 0x00007fc967b1d768 in __clone3 () from /gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-2.41/lib/libc.so.6
      In conversation about 2 months ago permalink
      Rich Felker repeated this.
    • Embed this notice
      Rich Felker (dalias@hachyderm.io)'s status on Friday, 17-Apr-2026 15:32:14 JST Rich Felker Rich Felker
      in reply to

      @kimapr I'm going to assume if the code is this bad, they have no idea how to use pthread_cancel, which is highly unsafe unless you know how to use it. Safe use requires the thread that might be cancelled to be aware that it's a potential cancellation target, to disable/enable cancellation at appropriate times, and to install cleanup handlers that restore a consistent state when cancellation is acted upon.

      In conversation about 2 months ago permalink
    • Embed this notice
      Rich Felker (dalias@hachyderm.io)'s status on Friday, 17-Apr-2026 19:39:22 JST Rich Felker Rich Felker
      in reply to
      • Gantua

      @gantua @kimapr Nope. The interaction between them is undefined. Making them the same is a glibcism.

      In conversation about 2 months ago permalink
    • Embed this notice
      Gantua (gantua@pleroma.marchera-pas.fr)'s status on Friday, 17-Apr-2026 19:39:25 JST Gantua Gantua
      in reply to
      • Rich Felker
      @dalias @kimapr This is C++. If your code is exception-safe, it is likely cancellation-safe for free.
      In conversation about 2 months ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.