Skip to content

Instantly share code, notes, and snippets.

View rousskov's full-sized avatar

Alex Rousskov rousskov

  • The Measurement Factory
View GitHub Profile
@rousskov
rousskov / j55-official-fixes.md
Last active December 11, 2023 14:47
Official Squid fixes for "Joshua 55" vulnerabilities
@rousskov
rousskov / mark-overridden.sh
Created January 4, 2023 15:40
Apply CppCoreGuidelines recommendation C.128: Virtual functions should specify exactly one of virtual, override, or final.
#!/bin/bash
set -e
log=/tmp/mark-overridden.log
echo "Install these if you have not already:"
echo sudo apt install clang-tidy-14
echo sudo apt install libkrb5-dev
echo sudo apt install libcap-dev
@rousskov
rousskov / no-NULLs.sh
Last active June 28, 2022 20:17
Remove Squid NULLs using clang-tidy modernize-use-nullptr
#!/bin/bash
set -e
log=/tmp/no-NULLs.log
if ! git diff --quiet; then
echo "There are unstaged changes. This script may modify sources."
echo "Stage changes to avoid permanent losses when things go bad."
exit 1
@rousskov
rousskov / squid-cache.log
Created May 9, 2022 13:50
trace-context.pl conn19 output for PR 1039
2022/05/09 09:48:22.694| 1,5| CodeContext.cc(60) Entering: conn19
2022/05/09 09:48:22.694| 5,5| TcpAcceptor.cc(295) acceptOne: Listener: conn13 local=[::]:3128 remote=[::] FD 36 flags=9 accepted new connection conn19 local=127.0.0.1:3128 remote=127.0.0.1:57162 FD 20 flags=65 handler Subscription: 0x560eec10fcb0*1
2022/05/09 09:48:22.695| 5,5| AsyncCall.cc(29) AsyncCall: The AsyncCall httpAccept constructed, this=0x560eec114ec0 [call51]
2022/05/09 09:48:22.695| 5,5| AsyncCall.cc(96) ScheduleCall: TcpAcceptor.cc(331) will call httpAccept(conn19 local=127.0.0.1:3128 remote=127.0.0.1:57162 FD 20 flags=65, master52) [call51]
--
2022/05/09 09:48:22.695| 1,5| CodeContext.cc(60) Entering: conn19
2022/05/09 09:48:22.695| 5,5| AsyncCallQueue.cc(59) fireNext: entering httpAccept(conn19 local=127.0.0.1:3128 remote=127.0.0.1:57162 FD 20 flags=65, master52)
2022/05/09 09:48:22.695| 5,5| AsyncCall.cc(41) make: make call httpAccept [call51]
2022/05/09 09:48:22.695| 33,4| client_side.cc(2313) httpAccept: conn19 local=127.0.0.
@rousskov
rousskov / valgrind.supp
Created December 23, 2021 14:18
Poorly maintained Valgrind suppressions for Squid
# Invalid read of size 4
{
mainInitialize-addr4
Memcheck:Addr4
...
fun:_ZL14mainInitializev
...
fun:main
}
{
@rousskov
rousskov / squid-pr950-logging-changes.md
Last active December 15, 2021 04:47
Squid PR 950 message logging changes

Legend and caveats:

  • before PR 474: commit f319174
  • before this PR: commit d7ca82e
  • after this PR: commit 17c5d2d
  • Source code links point to debugs() in a recent master/v6 commit 2b9a2bba0f10e2aa9096883efc5b597a3a68bf5c
  • The exact spelling of some debugs() messages may differ across Squid versions

squid -N

@rousskov
rousskov / remove-here.sh
Created August 10, 2017 22:42
Auto-remove HERE in Squid debugs().
#!/bin/sh
# Removes "HERE" macro from Squid debugs() calls in the given files.
# By default, scans all files (containing HERE words) under git control.
# Specify file name(s) as parameters to define the set of files to scan.
if test -z "$1"
then
# Find the names of all git-controlled files containing the word HERE.
Search='git grep --full-name --name-only --word-regexp HERE'