You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "ywkaras (via GitHub)" <gi...@apache.org> on 2024/01/08 22:53:39 UTC
Re: [I] Downcast from `Thread` to `EThread` in `Thread::Thread` is undefined behavior [trafficserver]
ywkaras commented on issue #10966:
URL: https://github.com/apache/trafficserver/issues/10966#issuecomment-1881948611
`Thread::Thread()` is a protected member, and is the only constructor. Looking at this:
```
wkaras ~/REPOS/TS
O$ grep '^ *class.*\WThread' $(findsrc)
./include/iocore/eventsystem/EventProcessor.h: class ThreadInit : public Continuation
./include/iocore/eventsystem/Processor.h:class Thread;
./include/iocore/eventsystem/Thread.h: class called EThread, derived from Thread. It is the responsibility of
./include/iocore/eventsystem/Thread.h:class Thread
./include/iocore/eventsystem/EThread.h:class EThread : public Thread
./src/iocore/eventsystem/UnixEventProcessor.cc:class ThreadAffinityInitializer : public Continuation
./src/iocore/eventsystem/UnixEventProcessor.cc:class ThreadInitByFunc : public Continuation
./src/proxy/logging/LogObject.cc:class ThreadLocalLogBufferManager : public Continuation
./tools/benchmark/benchmark_ProxyAllocator.cc:class BThread : public Thread
wkaras ~/REPOS/TS
O$
```
It looks like the issue is only a problem in the proxy allocator benchmark tool. Otherwise, Thread instances only exist as subinstances of EThread. But, still krufy and fragile, best removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org