Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in QString OwncloudPropagator::fullLocalPath #9170

Closed
sentry-io bot opened this issue Oct 22, 2021 · 2 comments
Closed

Crash in QString OwncloudPropagator::fullLocalPath #9170

sentry-io bot opened this issue Oct 22, 2021 · 2 comments
Milestone

Comments

@sentry-io
Copy link

sentry-io bot commented Oct 22, 2021

Sentry Issue: DESKTOP-WIN-AND-MAC-AYF

EXCEPTION_ACCESS_VIOLATION_READ: Fatal Error: EXCEPTION_ACCESS_VIOLATION_READ
  File "qbytearray.h", line 506, in QString::QString
  File "owncloudpropagator.cpp", line 598, in OCC::OwncloudPropagator::fullLocalPath
  File "owncloudpropagator.cpp", line 762, in OCC::OwncloudPropagator::updateMetadata
  File "propagateremotemkdir.cpp", line 180, in <lambda>::operator()
  File "qtconcurrentstoredfunctioncall.h", line 60, in QtConcurrent::StoredFunctorCall0<T>::runFunctor
...
(5 additional frame(s) were not displayed)
@TheOneRing TheOneRing added this to the 2.9.3 milestone Oct 22, 2021
@erikjv
Copy link
Contributor

erikjv commented Nov 19, 2021

The future where this is executed gets the parent propagator pointer passed into it. I think that that parent object has been freed by the time the future needs it.

@erikjv
Copy link
Contributor

erikjv commented Nov 19, 2021

Actually, the future holds on to the PropagateRemoteMkdir through an std::shared_ptr. But this is a QObject subclass, with a parent (which is returned by the propagator() call), so this object will probably be deleted when the parent disappears. Passed into the future is a lambda, which get the parent (pointer) by value.

So could the following be the fix (propagateremotemkdir.cpp:157):

- auto *watcher = new QFutureWatcher<resultTypePtr>(this);
+ auto *watcher = new QFutureWatcher<resultTypePtr>(propagator());

So hold on to the parent, thereby preventing deletion of the child, plus keeping that parent alive for inside the lambda?

TheOneRing added a commit that referenced this issue Nov 19, 2021
TheOneRing added a commit that referenced this issue Nov 19, 2021
TheOneRing added a commit that referenced this issue Nov 22, 2021
TheOneRing added a commit that referenced this issue Nov 22, 2021
Fixes: #9170
(cherry picked from commit 07aaba8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants