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

QObject::setParent: Cannot set parent, new parent is in a different thread #365

Closed
Ho-Ro opened this issue Apr 8, 2023 · 3 comments
Closed
Assignees
Labels
ARM ARM architecture related MacOS MacOS related, WONTFIX unless a volunteer steps in no-stale Old but still important Volunteers wanted NO SUPPORT unless someone wants to help! Windows Windows related, WONTFIX unless a volunteer steps in

Comments

@Ho-Ro
Copy link
Member

Ho-Ro commented Apr 8, 2023

Some user report this error/warning: QObject::setParent: Cannot set parent, new parent is in a different thread.
Unfortunately I have neither a Mac nor a Win machine to debug this error - It does not (yet) happen on Linux. So I ask for support from Qt gurus as well as developers with these systems, e.g. @gitguest0 and @varna9000.

Describe the bug

Computer environment (please complete the following information):

  • OpenHantek version: 3.3.2.2
  • OS: MacOS on ARM HW; Win11 on Intel
  • Qt version:
    • Win: mingw-w64-x86_64-qt5-static-5.15.8-1
    • MacOS: 5.15.8_2
  • C++ compiler version:
    • Win: The CXX compiler identification is GNU 12.2.0
    • MacOS: The CXX compiler identification is AppleClang 13.0.0.13000029

Scope device (please complete the following information):

  • Device Hantek 6022BE
@Ho-Ro Ho-Ro added Volunteers wanted NO SUPPORT unless someone wants to help! MacOS MacOS related, WONTFIX unless a volunteer steps in Windows Windows related, WONTFIX unless a volunteer steps in ARM ARM architecture related labels Apr 8, 2023
@Ho-Ro Ho-Ro self-assigned this Apr 26, 2023
@Ho-Ro
Copy link
Member Author

Ho-Ro commented Apr 26, 2023

I could trigger this error also on Linux (Debian stable 11.6 bullseye):

image

scrolling up/down of the Timebase value can crash the program with this debug info below (Openhantek --verbose 4). But the crash is not always directly after the error message QObject::setParent: Cannot set parent, new parent is in a different thread. Sometimes I can scoll up/down/up/down... before it happens.

...
  HDock::timebaseSelected() 0.05
   ThreadID: 0x7fd6752ad7c0
   sRate, sRate*timebase 100 5
   sRate, sRate*timebase 200 10
   sRate, sRate*timebase 500 25
   sRate, sRate*timebase 1000 50
   sRate, sRate*timebase 2000 100
   sRate, sRate*timebase 5000 250
   sRate, sRate*timebase 10000 500
   sRate, sRate*timebase 20000 1000
   sRate, sRate*timebase 50000 2500
   sRate, sRate*timebase 100000 5000
   sRate, sRate*timebase 200000 10000
   sRate, sRate*timebase 500000 25000
   sRate, sRate*timebase 1e+06 50000
   sRate, sRate*timebase 2e+06 100000
   sRate, sRate*timebase 5e+06 250000
   sRate, sRate*timebase 1e+07 500000
   sRate, sRate*timebase 1.2e+07 600000
   sRate, sRate*timebase 1.5e+07 750000
  HDock::calculateSamplerateSteps() 0.05 10000 20000
  HDock::setSamplerateLimits() 10000 20000
  HDC::setRecordTime() 0.5
   ThreadID: 0x7fd6577fe700
  duration = 0.5
   sampleIndex: 0 sRate: 100 sRate*duration: 50
   sampleIndex: 0 sRate: 200 sRate*duration: 100
   sampleIndex: 1 sRate: 500 sRate*duration: 250
   sampleIndex: 2 sRate: 1000 sRate*duration: 500
   sampleIndex: 3 sRate: 2000 sRate*duration: 1000
   sampleIndex: 4 sRate: 5000 sRate*duration: 2500
   sampleIndex: 5 sRate: 10000 sRate*duration: 5000
   sampleIndex: 6 sRate: 20000 sRate*duration: 10000
   sampleIndex: 7 sRate: 50000 sRate*duration: 25000
   sampleIndex: 7 sRate: 100000 sRate*duration: 50000
   sampleIndex: 7 sRate: 200000 sRate*duration: 100000
   sampleIndex: 7 sRate: 500000 sRate*duration: 250000
   sampleIndex: 7 sRate: 1e+06 sRate*duration: 500000
   sampleIndex: 7 sRate: 2e+06 sRate*duration: 1e+06
   sampleIndex: 7 sRate: 5e+06 sRate*duration: 2.5e+06
   sampleIndex: 7 sRate: 1e+07 sRate*duration: 5e+06
   sampleIndex: 7 sRate: 1.2e+07 sRate*duration: 6e+06
   sampleIndex: 7 sRate: 1.5e+07 sRate*duration: 7.5e+06
   sampleIndex: 7 sRate: 2.4e+07 sRate*duration: 1.2e+07
   sampleIndex: 7 sRate: 3e+07 sRate*duration: 1.5e+07
   sampleIndex: 7 sRate: 4.8e+07 sRate*duration: 2.4e+07
  HDC::controlSetSamplerate() 7 id: 2
   ThreadID: 0x7fd6577fe700
  HDC::setRecordTime() emit samplerateChanged 20000
  DsoWidget::updateMarkerDetails()
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
  HDock::setSamplerate() 20000
   ThreadID: 0x7fd6752ad7c0
  SDock::setSamplerate() 20000
   ThreadID: 0x7fd6752ad7c0
  HDock::timebaseSelected() 0.1
   ThreadID: 0x7fd6752ad7c0
   sRate, sRate*timebase 100 10
   sRate, sRate*timebase 200 20
   sRate, sRate*timebase 500 50
   sRate, sRate*timebase 1000 100
   sRate, sRate*timebase 2000 200
   sRate, sRate*timebase 5000 500
   sRate, sRate*timebase 10000 1000
   sRate, sRate*timebase 20000 2000
   sRate, sRate*timebase 50000 5000
   sRate, sRate*timebase 100000 10000
   sRate, sRate*timebase 200000 20000
   sRate, sRate*timebase 500000 50000
   sRate, sRate*timebase 1e+06 100000
   sRate, sRate*timebase 2e+06 200000
   sRate, sRate*timebase 5e+06 500000
   sRate, sRate*timebase 1e+07 1e+06
   sRate, sRate*timebase 1.2e+07 1.2e+06
   sRate, sRate*timebase 1.5e+07 1.5e+06
  HDock::calculateSamplerateSteps() 0.1 10000 10000
  HDock::setSamplerateLimits() 10000 10000
  HDock::setSamplerate() 20000
   ThreadID: 0x7fd6752ad7c0
  HDC::setRecordTime() 1
   ThreadID: 0x7fd6577fe700
  duration = 1
   sampleIndex: 0 sRate: 100 sRate*duration: 100
   sampleIndex: 0 sRate: 200 sRate*duration: 200
   sampleIndex: 1 sRate: 500 sRate*duration: 500
   sampleIndex: 2 sRate: 1000 sRate*duration: 1000
   sampleIndex: 3 sRate: 2000 sRate*duration: 2000
   sampleIndex: 4 sRate: 5000 sRate*duration: 5000
   sampleIndex: 5 sRate: 10000 sRate*duration: 10000
   sampleIndex: 6 sRate: 20000 sRate*duration: 20000
   sampleIndex: 6 sRate: 50000 sRate*duration: 50000
   sampleIndex: 6 sRate: 100000 sRate*duration: 100000
   sampleIndex: 6 sRate: 200000 sRate*duration: 200000
   sampleIndex: 6 sRate: 500000 sRate*duration: 500000
   sampleIndex: 6 sRate: 1e+06 sRate*duration: 1e+06
   sampleIndex: 6 sRate: 2e+06 sRate*duration: 2e+06
   sampleIndex: 6 sRate: 5e+06 sRate*duration: 5e+06
   sampleIndex: 6 sRate: 1e+07 sRate*duration: 1e+07
   sampleIndex: 6 sRate: 1.2e+07 sRate*duration: 1.2e+07
   sampleIndex: 6 sRate: 1.5e+07 sRate*duration: 1.5e+07
   sampleIndex: 6 sRate: 2.4e+07 sRate*duration: 2.4e+07
   sampleIndex: 6 sRate: 3e+07 sRate*duration: 3e+07
   sampleIndex: 6 sRate: 4.8e+07 sRate*duration: 4.8e+07
  HDC::controlSetSamplerate() 6 id: 1
   ThreadID: 0x7fd6577fe700
  HDC::setRecordTime() emit samplerateChanged 10000
  DsoWidget::updateMarkerDetails()
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
  HDock::setSamplerate() 10000
   ThreadID: 0x7fd6752ad7c0
  SDock::setSamplerate() 10000
   ThreadID: 0x7fd6752ad7c0
  HDock::timebaseSelected() 0.05
   ThreadID: 0x7fd6752ad7c0
   sRate, sRate*timebase 100 5
   sRate, sRate*timebase 200 10
   sRate, sRate*timebase 500 25
   sRate, sRate*timebase 1000 50
   sRate, sRate*timebase 2000 100
   sRate, sRate*timebase 5000 250
   sRate, sRate*timebase 10000 500
   sRate, sRate*timebase 20000 1000
   sRate, sRate*timebase 50000 2500
   sRate, sRate*timebase 100000 5000
   sRate, sRate*timebase 200000 10000
   sRate, sRate*timebase 500000 25000
   sRate, sRate*timebase 1e+06 50000
   sRate, sRate*timebase 2e+06 100000
   sRate, sRate*timebase 5e+06 250000
   sRate, sRate*timebase 1e+07 500000
   sRate, sRate*timebase 1.2e+07 600000
   sRate, sRate*timebase 1.5e+07 750000
  HDock::calculateSamplerateSteps() 0.05 10000 20000
  HDock::setSamplerateLimits() 10000 20000
  HDC::setRecordTime() 0.5
   ThreadID: 0x7fd6577fe700
  duration = 0.5
   sampleIndex: 0 sRate: 100 sRate*duration: 50
   sampleIndex: 0 sRate: 200 sRate*duration: 100
   sampleIndex: 1 sRate: 500 sRate*duration: 250
   sampleIndex: 2 sRate: 1000 sRate*duration: 500
   sampleIndex: 3 sRate: 2000 sRate*duration: 1000
   sampleIndex: 4 sRate: 5000 sRate*duration: 2500
   sampleIndex: 5 sRate: 10000 sRate*duration: 5000
   sampleIndex: 6 sRate: 20000 sRate*duration: 10000
   sampleIndex: 7 sRate: 50000 sRate*duration: 25000
   sampleIndex: 7 sRate: 100000 sRate*duration: 50000
   sampleIndex: 7 sRate: 200000 sRate*duration: 100000
   sampleIndex: 7 sRate: 500000 sRate*duration: 250000
   sampleIndex: 7 sRate: 1e+06 sRate*duration: 500000
   sampleIndex: 7 sRate: 2e+06 sRate*duration: 1e+06
   sampleIndex: 7 sRate: 5e+06 sRate*duration: 2.5e+06
   sampleIndex: 7 sRate: 1e+07 sRate*duration: 5e+06
   sampleIndex: 7 sRate: 1.2e+07 sRate*duration: 6e+06
   sampleIndex: 7 sRate: 1.5e+07 sRate*duration: 7.5e+06
   sampleIndex: 7 sRate: 2.4e+07 sRate*duration: 1.2e+07
   sampleIndex: 7 sRate: 3e+07 sRate*duration: 1.5e+07
   sampleIndex: 7 sRate: 4.8e+07 sRate*duration: 2.4e+07
  HDC::controlSetSamplerate() 7 id: 2
   ThreadID: 0x7fd6577fe700
  HDC::setRecordTime() emit samplerateChanged 20000
  DsoWidget::updateMarkerDetails()
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
  HDock::setSamplerate() 20000
   ThreadID: 0x7fd6752ad7c0
  SDock::setSamplerate() 20000
   ThreadID: 0x7fd6752ad7c0
  HDock::timebaseSelected() 0.1
   ThreadID: 0x7fd6752ad7c0
   sRate, sRate*timebase 100 10
   sRate, sRate*timebase 200 20
   sRate, sRate*timebase 500 50
   sRate, sRate*timebase 1000 100
   sRate, sRate*timebase 2000 200
   sRate, sRate*timebase 5000 500
   sRate, sRate*timebase 10000 1000
   sRate, sRate*timebase 20000 2000
   sRate, sRate*timebase 50000 5000
   sRate, sRate*timebase 100000 10000
   sRate, sRate*timebase 200000 20000
   sRate, sRate*timebase 500000 50000
   sRate, sRate*timebase 1e+06 100000
   sRate, sRate*timebase 2e+06 200000
   sRate, sRate*timebase 5e+06 500000
   sRate, sRate*timebase 1e+07 1e+06
   sRate, sRate*timebase 1.2e+07 1.2e+06
   sRate, sRate*timebase 1.5e+07 1.5e+06
  HDock::calculateSamplerateSteps() 0.1 10000 10000
  HDock::setSamplerateLimits() 10000 10000
  HDock::setSamplerate() 20000
   ThreadID: 0x7fd6752ad7c0
  HDC::setRecordTime() 1
   ThreadID: 0x7fd6577fe700
  duration = 1
   sampleIndex: 0 sRate: 100 sRate*duration: 100
   sampleIndex: 0 sRate: 200 sRate*duration: 200
   sampleIndex: 1 sRate: 500 sRate*duration: 500
   sampleIndex: 2 sRate: 1000 sRate*duration: 1000
   sampleIndex: 3 sRate: 2000 sRate*duration: 2000
   sampleIndex: 4 sRate: 5000 sRate*duration: 5000
   sampleIndex: 5 sRate: 10000 sRate*duration: 10000
   sampleIndex: 6 sRate: 20000 sRate*duration: 20000
   sampleIndex: 6 sRate: 50000 sRate*duration: 50000
   sampleIndex: 6 sRate: 100000 sRate*duration: 100000
   sampleIndex: 6 sRate: 200000 sRate*duration: 200000
   sampleIndex: 6 sRate: 500000 sRate*duration: 500000
   sampleIndex: 6 sRate: 1e+06 sRate*duration: 1e+06
   sampleIndex: 6 sRate: 2e+06 sRate*duration: 2e+06
   sampleIndex: 6 sRate: 5e+06 sRate*duration: 5e+06
   sampleIndex: 6 sRate: 1e+07 sRate*duration: 1e+07
   sampleIndex: 6 sRate: 1.2e+07 sRate*duration: 1.2e+07
   sampleIndex: 6 sRate: 1.5e+07 sRate*duration: 1.5e+07
   sampleIndex: 6 sRate: 2.4e+07 sRate*duration: 2.4e+07
   sampleIndex: 6 sRate: 3e+07 sRate*duration: 3e+07
   sampleIndex: 6 sRate: 4.8e+07 sRate*duration: 4.8e+07
  HDC::controlSetSamplerate() 6 id: 1
   ThreadID: 0x7fd6577fe700
  HDC::setRecordTime() emit samplerateChanged 10000
  DsoWidget::updateMarkerDetails()
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
  HDock::setSamplerate() 10000
   ThreadID: 0x7fd6752ad7c0
  SDock::setSamplerate() 10000
   ThreadID: 0x7fd6752ad7c0
Speicherzugriffsfehler

@github-actions
Copy link

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment.
Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@github-actions github-actions bot added the stale The TO is probably no longer interested in a solution label May 25, 2023
@Ho-Ro Ho-Ro added no-stale Old but still important and removed stale The TO is probably no longer interested in a solution labels May 25, 2023
nseam added a commit to nseam/OpenHantek6022 that referenced this issue Aug 7, 2023
…imebaseChanged event handler from doing operations on dsoControl and dsoWidget in the same callback. Now there two callback and each uses the Widget it operates on.
nseam added a commit to nseam/OpenHantek6022 that referenced this issue Aug 7, 2023
…imebaseChanged event handler from doing operations on dsoControl and dsoWidget in the same callback. Now there two callback and each uses the Widget it operates on.

Signed-off-by: Adrian Kierzkowski <[email protected]>
Ho-Ro added a commit that referenced this issue Aug 8, 2023
@Ho-Ro
Copy link
Member Author

Ho-Ro commented Aug 8, 2023

Solved by #372

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM ARM architecture related MacOS MacOS related, WONTFIX unless a volunteer steps in no-stale Old but still important Volunteers wanted NO SUPPORT unless someone wants to help! Windows Windows related, WONTFIX unless a volunteer steps in
Projects
None yet
Development

No branches or pull requests

1 participant