Two event senders pass a payload type their receivers don't declare
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 65/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- cpp
- Domínio
- backend, networking
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- C++
- Estrelas
- 2k
- Forks
- 903
- Merge médio
- 4d 4h
- PRs com merge (30d)
- 135
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de apache/trafficserver
-
UnixNetVConnection::do_io_write with a null reader leaves the previous reader in the write VIOTalvez já em andamento @NginxL assumiu hoje. AbertaBug Good First Issue IOBuffer Network
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
apache/trafficserver#14220 ·
Mantenedores costumam responder em até 2 dias
-
MallocAllocator does not check for allocation failureTalvez já em andamento @umrndem assumiu hoje. AbertaBug Core Good First Issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
apache/trafficserver#14218 · 2 comentários ·
Mantenedores costumam responder em até 2 dias
-
Bug Event System Threads
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
apache/trafficserver#14217 ·
Mantenedores costumam responder em até 2 dias
-
TSContScheduleEveryOnPool and TSContScheduleEveryOnThread accept a zero or negative periodTalvez já em andamento @rajeetvk assumiu há 1 dia. AbertaBug Event System Good First Issue TS API
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
apache/trafficserver#14214 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
HostDBContinuation::init memsets a polymorphic ActionTalvez já em andamento @ANMOLSCRIPT assumiu hoje. AbertaBug Good First Issue HostDB
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
apache/trafficserver#14204 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
Todas as issues de apache/trafficserver
Issues semelhantes
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
Mantenedores costumam responder em até 2 dias
-
ColumnDecimal::Append(Int128) stores a value outside the Decimal(P, S) range with no error: cut to 32/64 bits, or with too many digitsTalvez já em andamento @RUSHIT305 assumiu hoje. Abertabug data-types
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
ClickHouse/clickhouse-cpp#645 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bug compatibility difficulty:easy prio:normal
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
NatronGitHub/openfx-misc#524 ·
Mantenedores costumam responder em até 1 dia
-
documentation enhancement help wanted P0
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#359 ·
Mantenedores costumam responder em até 1 dia
-
Type: Bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
openscad/openscad#7360 · 2 comentários ·
Mantenedores costumam responder em até 1 dia