https://bugs.kde.org/show_bug.cgi?id=363753

--- Comment #48 from Yichao Yu <yyc1...@gmail.com> ---
> I cannot reproduce that - with my patch in place. If your reasoning is 
> correct that patch should make me vulnerable to the crash.

Yes it'll make you vulnerable but it won't actually crash unless some unknown
conditions are met. I suspect it's related to other plugins that are also using
dbus but I'm not sure.

> What I can confirm is that Style::connectDBus() is called (exactly once in 
> this case), but not the Style dtor. That's a bit surprising to me, somewhere 
> I was under the impression that class dtors were always called even if you 
> don't delete them explicitly.

Exactly. Good to know at least you can observe this. I can only say that I've
seen this leads to crashes before and I don't really think this should happen.
I've just checked that this doesn't crash for me anymore but I've also noticed
that it is because the library is somehow not ummaped anymore, meaning if it
does in some case the crash I saw before will come back again. Not sure why.
(OTOH, another way to work around this is to dlopen the library itself so that
the dlclose won't actually unmmap the library code. Not sure how that can be
done though)

> There's no way to use something like a Q*Pointer class to get automatic 
> deleting of those Style instances?

= = .... I actually have no idea who created them and how the memory is managed
by either qt or the application

> But good, if you can reproduce it you can also try to figure out what other 
> methods there are to avoid it.

The problem now is that I can't reproduce the crash at the moment anymore but
almost everything that leads to it are still reproducible (i.e. the distructor
is not called before the library is dlclosed) which means it's hard for me to
tell if any alternative solution can work........ I'm checking why is dlclose
not unmapping the library, though don't expect that to be very easy....

> What Qt version are you using?

5.8.0 ATM

> I believe that's effectly the same. The closure isn't what's causing the
> crash.


> Effectively the same but with the closure we don't really know where the 
> Style instance pointer comes from. That's what I hinted at earlier; if the 
> cleanup closure is registered twice for the same instance it's not certain 
> how valid the this pointer ("data") is when called the 2nd time. Seems 
> farfetched, I know, but we're dealing with an issue here that we don't really 
> understand, so the mechanism to prevent it should be as easy to understand 
> and verify as possible.

Sure, I'll be certainly fine with that. Though given many (all?) of the
backtrace points to `QDBusConnection::sessionBus` I don't think that'll solve
the problem...

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to