CacheVC zeroes its VIO and other non-trivial members with memset
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 69/100
Direzione di ricerca
Read the constructor in src/iocore/cache/CacheVC.cc around lines 160–165, free_CacheVC in src/iocore/cache/P_CacheInternal.h around line 243, and the VIO member in src/iocore/cache/CacheVC.h around line 258. Replace the raw reset of the region with member assignments or a value-initialized sub-struct, accounting for all members in that region. Done means construction and recycling reset those members without memset over non-trivial objects.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
CacheVC resets "region C", everything from vio to the end of the object, with a raw memset. This happens both in the constructor (CacheVC.cc#L160-L165) and on every recycle in free_CacheVC (P_CacheInternal.h#L243). The region starts with a VIO (CacheVC.h#L258). A VIO contains a Ptr<ProxyMutex> and a MIOBufferAccessor, so it isn't trivially copyable. The region also contains save_handler. The reinterpret_cast<void *> hides the -Wclass-memaccess warning that would otherwise flag this. The region's size is computed with a null-pointer member-offset trick on a non-standard-layout class.
Writing over those objects with memset is undefined behavior. In practice it works today: free_CacheVC clears vio.buffer and vio.mutex before the memset, a null Ptr is all-zero bits, and in the constructor the members were just default-initialized to the same state. It breaks silently, though, as soon as any member in that region gets a non-zero default or owns a resource, for example a new field in VIO.
Suggested fix: reset the region by assigning the members (or a value-initialized sub-struct) instead of memset, so new members get correct reset behavior from the compiler.
generated with Claude Opus 5.5 by Josiah VanderZee
- Lingua principale
- C++
- Stelle
- 2k
- Fork
- 903
- Merge medio
- 4g 4h
- PR unite (30g)
- 135
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/trafficserver
-
UnixNetVConnection::do_io_write with a null reader leaves the previous reader in the write VIOForse già presa @NginxL l’ha presa oggi. ApertaBug Good First Issue IOBuffer Network
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/trafficserver#14220 ·
I maintainer di solito rispondono entro 2 giorni
-
MallocAllocator does not check for allocation failureForse già presa @umrndem l’ha presa oggi. ApertaBug Core Good First Issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/trafficserver#14218 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Bug Event System Threads
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/trafficserver#14217 ·
I maintainer di solito rispondono entro 2 giorni
-
TSContScheduleEveryOnPool and TSContScheduleEveryOnThread accept a zero or negative periodForse già presa @rajeetvk l’ha presa 1 giorno fa. ApertaBug Event System Good First Issue TS API
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
apache/trafficserver#14214 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
HostDBContinuation::init memsets a polymorphic ActionForse già presa @ANMOLSCRIPT l’ha presa oggi. ApertaBug Good First Issue HostDB
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
apache/trafficserver#14204 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di apache/trafficserver
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
I maintainer di solito rispondono entro 2 giorni
-
bug data-types
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
ClickHouse/clickhouse-cpp#645 ·
I maintainer di solito rispondono entro 1 giorno
-
bug compatibility difficulty:easy prio:normal
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
NatronGitHub/openfx-misc#524 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation enhancement help wanted P0
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#359 ·
I maintainer di solito rispondono entro 1 giorno
-
Type: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
openscad/openscad#7360 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno