[Development] Applications using -fno-rtti
Thiago Macieira
thiago.macieira at intel.com
Sun Jun 21 18:13:08 CEST 2020
On Sunday, 21 June 2020 08:22:14 PDT Alberto Mardegan wrote:
> On 20/06/20 23:45, Thiago Macieira wrote:
> > No, because it won't catch this:
> >
> > class MyProcess : QProcess
> > {
> > protected:
> > virtual void setupChildProcess();
> > };
> >
> > Note the lack of Q_OBJECT.
>
> But what is the harm if we don't catch that? It's still better than a
> crash, isn't it?
No, a crash is better than silent data corruption. I'm glad you had a hard
error that allowed us to detect the problem.
The idea of the check was so enable vfork() semantics before calling that
function above. If we don't know it's safe to call it, you could cause silent
data corruption. Now, the part of the vfork was rolled back because it
couldn't work, so the worst that could happen now is a deadlock, which means
the problem might be intermittent. A hard crash is still better.
> > But a variant of https://codereview.qt-project.org/c/qt/qtbase/+/292540
> > might be acceptable. It would replace the typeid() check with the GCC
> > extension, which will work for all GCC-based builds, which is the
> > totality of Linux distributions.
>
> If that is your preferred solution, I'm fine with that too. But is there
> something wron gwith that patch, or can it be applied as is?
A set of patches were dropped from the middle of the series, implementing the
vfork I mentioned. So the patch needs to be rebased and adjusted. Other than
that, it's fine.
> > By the way, can you say what you needed to derive from QProcess for? If it
> > was to override setupChildProcess() like in the example above, what are
> > you doing in the function?
>
> No, that code is not overriding any virtual methods, it's just extending
> the class.
Thanks.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel System Software Products
More information about the Development
mailing list