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

"Cannot make QOpenGLContext current in a different thread" #1642

Closed
jiangzhengwenjz opened this issue Jan 24, 2020 · 7 comments
Closed

"Cannot make QOpenGLContext current in a different thread" #1642

jiangzhengwenjz opened this issue Jan 24, 2020 · 7 comments

Comments

@jiangzhengwenjz
Copy link

The build you are using: 0.8-0.8.0-6037-2368391f
The operating system you're using: ubuntu 18.04
Your CPU and graphics card: i5-4210U/Intel Haswell Mobile

So, I downloaded the debian packages from mgba.io. In mgba-qt, I can load ROMs and play without any problem, but when I exit the program, the following appear in the terminal:

Cannot make QOpenGLContext current in a different thread
Aborted (core dumped)
@endrift
Copy link
Member

endrift commented Jan 24, 2020

Are you exiting via the menu or via the X in the corner? Are you using the Shutdown option in the Emulation menu?

It shouldn't matter, but I just want to narrow down if there are any potential places things could be going wrong. Also, are you using the OpenGL enhancement renderer? If so, I fixed a bug the other day that might be related.

@jiangzhengwenjz
Copy link
Author

jiangzhengwenjz commented Jan 24, 2020

@endrift

Are you exiting via the menu or via the X in the corner? Are you using the Shutdown option in the Emulation menu?

I tried both and they produced the same problem.

Also, are you using the OpenGL enhancement renderer?

No, I'm using software renderer. However, switching to OpenGL in tools -> settings -> enhancements (and restarting the program) produced the same problem.

@jiangzhengwenjz
Copy link
Author

Also I found switching ROM halfway can also cause the problem.

@endrift
Copy link
Member

endrift commented Jan 25, 2020

Do you have gdb installed? If so, can you get a backtrace of where it's aborting?

@jiangzhengwenjz
Copy link
Author

jiangzhengwenjz commented Jan 25, 2020

[Thread 0x7fffb53d5700 (LWP 8698) exited]
[Thread 0x7fffb4b73700 (LWP 8700) exited]
[Thread 0x7fffb4bb4700 (LWP 8699) exited]
Cannot make QOpenGLContext current in a different thread

Thread 10 "Painter Thread" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffb5bd6700 (LWP 8697)]
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt full
#0  0x00007ffff781be97 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
        set = 
            {__val = {0, 6867800724958234951, 0, 0, 1139802112, 0, 1104674816, 0, 0, 0, 36029346783166592, 36029346783166592, 4611375109753212693, 0, 4596535490694461912, 0}}
        pid = <optimized out>
        tid = <optimized out>
#1  0x00007ffff781d801 in __GI_abort () at abort.c:79
        save_stage = 1
        act = 
          {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = -1245883592, sa_restorer = 0x7fffb5bd5338}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x00007ffff4badfb7 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007ffff539ec73 in QOpenGLContext::makeCurrent(QSurface*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#4  0x00007ffff56b2234 in QOpenGLVertexArrayObject::destroy() () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#5  0x00007ffff56a52f8 in  () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#6  0x00007ffff56a5519 in  () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#7  0x00007ffff56a06d9 in QOpenGL2PaintEngineEx::~QOpenGL2PaintEngineEx() () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#8  0x00007ffff4bc19cd in QThreadStorageData::finish(void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007ffff4bc2293 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007ffff4bc3185 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007ffff62196db in start_thread (arg=0x7fffb5bd6700) at pthread_create.c:463
        pd = 0x7fffb5bd6700
        now = <optimized out>
        unwind_buf = 
              {cancel_jmp_buf = {{jmp_buf = {140736242476800, -5838237106816543698, 140736242472768, 0, 93825026988848, 140737488340144, 5838073807032685614, 5838219876727395374}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#12 0x00007ffff78fe88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

@endrift
Copy link
Member

endrift commented Jan 25, 2020

This should be fixed now; let me know if it's still broken for whatever reason.

@endrift
Copy link
Member

endrift commented Mar 6, 2020

Caused #1686.

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