Two event senders pass a payload type their receivers don't declare
Maintainer antworten meist innerhalb von 2 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 65/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- cpp
- Bereich
- backend, networking
Rechercherichtung
Start with the cited event contract in include/iocore/eventsystem/Continuation.h, then inspect the send and receive sites in src/iocore/aio/AIO.cc, src/iocore/cache/CacheVC.cc, and src/iocore/net/UnixNetVConnection.cc. Check the direct handleEvent(AIO_EVENT_DONE, nullptr) callers before changing the CacheVC handler parameter. Done means the AIO handler accepts its actual payload type and the three net callbacks pass NetVConnection* as documented.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
ContinuationHandler converts an event's void* payload to the handler's declared data type with a static_cast. The contract on invoke and on Continuation::handler is that the payload was converted to void* from exactly that type, not from a pointer to a derived class (Continuation.h#L173, #L250). Two senders break it.
AIO completion to CacheVC::handleReadDone
AIOCallback::io_complete sends AIO_EVENT_DONE with this, an AIOCallback* (AIO.cc#L105). CacheVC::handleRead binds CacheVC::handleReadDone(int, Event *) as the receiving handler (CacheVC.cc#L554, CacheVC.cc#L363), so the AIOCallback* is cast to Event*. The parameter is unused, so nothing reads through the wrong type today.
Net VC callbacks
NET_EVENT_ACCEPT and NET_EVENT_OPEN are documented to carry a NetVConnection * (NetProcessor.h#L53, #L106), and receivers such as HttpSessionAccept do static_cast<NetVConnection *>(data) (HttpSessionAccept.cc#L101). UnixNetVConnection passes this directly, so the void* comes from a UnixNetVConnection* (or SSLNetVConnection*), not a NetVConnection* (UnixNetVConnection.cc#L1048, #L1050, #L1240). This works only because NetVConnection is the first base of UnixNetVConnection (P_UnixNetVConnection.h#L53) and so sits at the same address. Reordering the bases, or adding a polymorphic base in front, would hand receivers a wrong pointer.
Suggested fix
- Pass
static_cast<NetVConnection *>(this)in the three net callbacks. - Declare
handleReadDone's data parameter asAIOCallback *(orvoid *), since it receives AIO completions, and check the directhandleEvent(AIO_EVENT_DONE, nullptr)callers still match.
generated with Claude Opus 5.5 by Josiah VanderZee
- Vorherrschende Sprache
- C++
- Sterne
- 2k
- Forks
- 903
- Ø Merge
- 4 T. 4 Std.
- Gemergte PRs (30 T.)
- 135
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus apache/trafficserver
-
UnixNetVConnection::do_io_write with a null reader leaves the previous reader in the write VIOEvtl. vergeben @NginxL hat das heute übernommen. OffenBug Good First Issue IOBuffer Network
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
apache/trafficserver#14220 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
MallocAllocator does not check for allocation failureEvtl. vergeben @umrndem hat das heute übernommen. OffenBug Core Good First Issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
apache/trafficserver#14218 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Bug Event System Threads
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
apache/trafficserver#14217 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
TSContScheduleEveryOnPool and TSContScheduleEveryOnThread accept a zero or negative periodEvtl. vergeben @rajeetvk hat das vor 1 Tag übernommen. OffenBug Event System Good First Issue TS API
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
apache/trafficserver#14214 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
HostDBContinuation::init memsets a polymorphic ActionEvtl. vergeben @ANMOLSCRIPT hat das heute übernommen. OffenBug Good First Issue HostDB
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
apache/trafficserver#14204 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in apache/trafficserver
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
Maintainer antworten meist innerhalb von 2 Tagen
-
bug data-types
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
ClickHouse/clickhouse-cpp#645 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug compatibility difficulty:easy prio:normal
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
NatronGitHub/openfx-misc#524 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation enhancement help wanted P0
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#359 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Type: Bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
openscad/openscad#7360 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag