Loading helgrind.supp 0 → 100644 +26 −0 Changes for helgrind.supp: 26 added lines, 0 removed lines. Original line number Diff line number Diff line # Helgrind suppression file for libnetplus # Suppress well-known false positives in libgcc_s unwinder initialization. # The GCC unwinder uses pthread_once for one-time frame-table init, which is # thread-safe but Helgrind cannot track through the low-level code. # # Usage: valgrind --tool=helgrind --suppressions=helgrind.supp ./your_binary { libgcc_s_unwind_init_race_1 Helgrind:Race obj:/usr/lib/x86_64-linux-gnu/libgcc_s.so.* } { libgcc_s_unwind_init_race_2 Helgrind:Race ... fun:_Unwind_RaiseException } { libgcc_s_unwind_resume_race Helgrind:Race ... fun:_Unwind_Resume } src/event/epoll.cpp +17 −0 Changes for src/event/epoll.cpp: 17 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -353,6 +353,12 @@ namespace netplus { // initial connection data (e.g. HTTP/2 SETTINGS). // This breaks the deadlock where the browser waits // for SETTINGS and the server waits for the browser. // IMPORTANT: Only run AFTER handshake completes. // Running during handshake adds data to SendData // that can't be sent yet (sendData throws Note), // which causes the EpollArmGuard to add EPOLLOUT, // creating a busy-loop that starves all workers. if (c->csock->getHandshakeDone()) { if (auto *sslsock = dynamic_cast<ssl*>(c->csock.get())) { const auto &fcb = sslsock->getFramingCallback(); if (fcb && c->SendData.pos >= c->SendData.size()) { Loading @@ -362,6 +368,7 @@ namespace netplus { } } } } // Step 3: Application data (handshake done) // Drain all available TLS records to avoid stalling Loading Loading @@ -587,6 +594,11 @@ namespace netplus { } for (int i = 0; i < wait; ++i) { // Per-event try/catch: an exception in one // event must not skip remaining events in // the batch. With EPOLLONESHOT, skipped // events leave fds permanently disabled. try { int evtype = pollptr.pollState(i); if (evtype == pollapi::EVCON) { Loading @@ -598,6 +610,11 @@ namespace netplus { int flags = pollptr.getEventFlags(i); pollptr.IoEventHandler(fd, flags, tid, args); } catch (NetException& e) { std::cerr << "Event error: " << e.what() << std::endl; } catch (...) { std::cerr << "Event error: unknown exception" << std::endl; } } } catch (NetException& e) { std::cerr << "Poll Error: " << e.what() << std::endl; Loading Loading
helgrind.supp 0 → 100644 +26 −0 Changes for helgrind.supp: 26 added lines, 0 removed lines. Original line number Diff line number Diff line # Helgrind suppression file for libnetplus # Suppress well-known false positives in libgcc_s unwinder initialization. # The GCC unwinder uses pthread_once for one-time frame-table init, which is # thread-safe but Helgrind cannot track through the low-level code. # # Usage: valgrind --tool=helgrind --suppressions=helgrind.supp ./your_binary { libgcc_s_unwind_init_race_1 Helgrind:Race obj:/usr/lib/x86_64-linux-gnu/libgcc_s.so.* } { libgcc_s_unwind_init_race_2 Helgrind:Race ... fun:_Unwind_RaiseException } { libgcc_s_unwind_resume_race Helgrind:Race ... fun:_Unwind_Resume }
src/event/epoll.cpp +17 −0 Changes for src/event/epoll.cpp: 17 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -353,6 +353,12 @@ namespace netplus { // initial connection data (e.g. HTTP/2 SETTINGS). // This breaks the deadlock where the browser waits // for SETTINGS and the server waits for the browser. // IMPORTANT: Only run AFTER handshake completes. // Running during handshake adds data to SendData // that can't be sent yet (sendData throws Note), // which causes the EpollArmGuard to add EPOLLOUT, // creating a busy-loop that starves all workers. if (c->csock->getHandshakeDone()) { if (auto *sslsock = dynamic_cast<ssl*>(c->csock.get())) { const auto &fcb = sslsock->getFramingCallback(); if (fcb && c->SendData.pos >= c->SendData.size()) { Loading @@ -362,6 +368,7 @@ namespace netplus { } } } } // Step 3: Application data (handshake done) // Drain all available TLS records to avoid stalling Loading Loading @@ -587,6 +594,11 @@ namespace netplus { } for (int i = 0; i < wait; ++i) { // Per-event try/catch: an exception in one // event must not skip remaining events in // the batch. With EPOLLONESHOT, skipped // events leave fds permanently disabled. try { int evtype = pollptr.pollState(i); if (evtype == pollapi::EVCON) { Loading @@ -598,6 +610,11 @@ namespace netplus { int flags = pollptr.getEventFlags(i); pollptr.IoEventHandler(fd, flags, tid, args); } catch (NetException& e) { std::cerr << "Event error: " << e.what() << std::endl; } catch (...) { std::cerr << "Event error: unknown exception" << std::endl; } } } catch (NetException& e) { std::cerr << "Poll Error: " << e.what() << std::endl; Loading