Closed Bug 1284934 Opened 8 years ago Closed 8 years ago

GLXVsync thread tries to access libpref

Categories

(Core :: Graphics: Layers, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: nical, Assigned: acomminos)

Details

Attachments

(1 file)

I just ran into this on a local debug build with gl layers enabled on linux.

#0  0x00007f9d7cc5d4cd in nanosleep () at /lib64/libc.so.6
#1  0x00007f9d7cc5d364 in sleep () at /lib64/libc.so.6
#2  0x00007f9d6b210b4a in ah_crap_handler(int) (signum=11) at toolkit/xre/nsSigHandlers.cpp:103
#3  0x00007f9d6b1f3007 in nsProfileLock::FatalSignalHandler(int, siginfo_t*, void*) (signo=11, info=0x7f9d4adfc170, context=0x7f9d4adfc040) at /home/nical/dev/mozilla/central/toolkit/profile/nsProfileLock.cpp:191
#4  0x00007f9d6cc04de7 in AsmJSFaultHandler(int, siginfo_t*, void*) (signum=11, info=0x7f9d4adfc170, context=0x7f9d4adfc040) at js/src/asmjs/WasmSignalHandlers.cpp:1167
#5  0x00007f9d7da05a00 in <signal handler called> () at /lib64/libpthread.so.0
#6  0x00007f9d668df1ee in mozilla::Preferences::InitStaticMembers() () at modules/libpref/Preferences.cpp:448
#7  0x00007f9d668e309c in mozilla::Preferences::GetInt(char const*, int*) (aPref=0x7f9d6d11da14 "layout.frame_rate", aResult=0x7f9d4adfc63c) at /home/nical/dev/mozilla/central/modules/libpref/Preferences.cpp:1395
#8  0x00007f9d668765fd in mozilla::Preferences::GetInt(char const*, int) (aPref=0x7f9d6d11da14 "layout.frame_rate", aDefault=-1) at /home/nical/dev/mozilla/objdir/dbg/dist/include/mozilla/Preferences.h:118
#9  0x00007f9d67f8ca2d in gfxPlatform::IsInLayoutAsapMode() () at gfx/thebes/gfxPlatform.cpp:2279
#10 0x00007f9d67d196ef in mozilla::gl::GLContextGLX::MakeCurrentImpl(bool) (this=0x7f9d4b5f7000, aForce=false) at gfx/gl/GLContextProviderGLX.cpp:950
#11 0x00007f9d67d1d8e9 in mozilla::gl::GLContext::MakeCurrent(bool) (this=0x7f9d4b5f7000, aForce=false) at gfx/gl/GLContext.h:3226
#12 0x00007f9d67d5bda1 in mozilla::gl::GLContext::InitWithPrefixImpl(char const*, bool) (this=0x7f9d4b5f7000, prefix=0x7f9d6d09c654 "gl", trygl=true) at /home/nical/dev/mozilla/central/gfx/gl/GLContext.cpp:707
#13 0x00007f9d67d5a874 in mozilla::gl::GLContext::InitWithPrefix(char const*, bool) (this=0x7f9d4b5f7000, prefix=0x7f9d6d09c654 "gl", trygl=true) at /home/nical/dev/mozilla/central/gfx/gl/GLContext.cpp:517
#14 0x00007f9d67d1958d in mozilla::gl::GLContextGLX::Init() (this=0x7f9d4b5f7000) at gfx/gl/GLContextProviderGLX.cpp:919
#15 0x00007f9d67d192e3 in mozilla::gl::GLContextGLX::CreateGLContext(mozilla::gl::CreateContextFlags, mozilla::gl::SurfaceCaps const&, mozilla::gl::GLContextGLX*, bool, _XDisplay*, unsigned long, __GLXFBConfigRec*, bool, gfxXlibSurface*, mozilla::gl::ContextProfile) (flags=mozilla::gl::CreateContextFlags::NONE, caps=..., shareContext=0x0, isOffscreen=false, display=0x7f9d527f2000, drawable=562, cfg=0xd5, deleteDrawable=false, pixmap=0x0, profile=mozilla::gl::ContextProfile::OpenGLCompatibility) at gfx/gl/GLContextProviderGLX.cpp:867
#16 0x00007f9d67f93957 in GLXVsyncSource::GLXDisplay::SetupGLContext() (this=0x7f9d5295a3c0) at gfx/thebes/gfxPlatformGtk.cpp:697
#17 0x00007f9d67f95287 in mozilla::detail::RunnableMethodArguments<>::applyImpl<GLXVsyncSource::GLXDisplay, void (GLXVsyncSource::GLXDisplay::*)()>(GLXVsyncSource::GLXDisplay*, void (GLXVsyncSource::GLXDisplay::*)(), mozilla::Tuple<>&, mozilla::IndexSequence<>) (o=0x7f9d5295a3c0, m=(void (GLXVsyncSource::GLXDisplay::*)(GLXVsyncSource::GLXDisplay * const)) 0x7f9d67f9373c <GLXVsyncSource::GLXDisplay::SetupGLContext()>, args=...) at /home/nical/dev/mozilla/objdir/dbg/dist/include/n
sThreadUtils.h:729
#18 0x00007f9d67f9521c in mozilla::detail::RunnableMethodArguments<>::apply<GLXVsyncSource::GLXDisplay, void (GLXVsyncSource::GLXDisplay::*)()>(GLXVsyncSource::G
LXDisplay*, void (GLXVsyncSource::GLXDisplay::*)()) (this=0x7f9d527b7af0, o=0x7f9d5295a3c0, m=(void (GLXVsyncSource::GLXDisplay::*)(GLXVsyncSource::GLXDisplay *
const)) 0x7f9d67f9373c <GLXVsyncSource::GLXDisplay::SetupGLContext()>) at /home/nical/dev/mozilla/objdir/dbg/dist/include/nsThreadUtils.h:736
#19 0x00007f9d67f95113 in mozilla::detail::RunnableMethodImpl<void (GLXVsyncSource::GLXDisplay::*)(), true, false>::Run() (this=0x7f9d527b7ac0) at /home/nical/de
v/mozilla/objdir/dbg/dist/include/nsThreadUtils.h:763
#20 0x00007f9d66f85ba8 in MessageLoop::RunTask(already_AddRefed<mozilla::Runnable>) (this=0x7f9d4adfed00, aTask=...) at ipc/chrom
ium/src/base/message_loop.cc:349
#21 0x00007f9d66f85c31 in MessageLoop::DeferOrRunPendingTask(MessageLoop::PendingTask&&) (this=0x7f9d4adfed00, pending_task=<unknown type in /home/nical/dev/mozi
lla/objdir/dbg/dist/bin/libxul.so, CU 0x1eb39c4, DIE 0x1efb746>) at ipc/chromium/src/base/message_loop.cc:357
#22 0x00007f9d66f85fc1 in MessageLoop::DoWork() (this=0x7f9d4adfed00) at ipc/chromium/src/base/message_loop.cc:432
#23 0x00007f9d66f8650c in base::MessagePumpDefault::Run(base::MessagePump::Delegate*) (this=0x7f9d527ab7f0, delegate=0x7f9d4adfed00) at /home/nical/dev/mozilla/c
entral/ipc/chromium/src/base/message_pump_default.cc:36
#24 0x00007f9d66f8540f in MessageLoop::RunInternal() (this=0x7f9d4adfed00) at ipc/chromium/src/base/message_loop.cc:235
#25 0x00007f9d66f853a2 in MessageLoop::RunHandler() (this=0x7f9d4adfed00) at ipc/chromium/src/base/message_loop.cc:228
#26 0x00007f9d66f8537b in MessageLoop::Run() (this=0x7f9d4adfed00) at ipc/chromium/src/base/message_loop.cc:208
#27 0x00007f9d66fa2b17 in base::Thread::ThreadMain() (this=0x7f9d5295a460) at ipc/chromium/src/base/thread.cc:180
#28 0x00007f9d66f9e079 in ThreadFunc(void*) (closure=0x7f9d5295a460) at ipc/chromium/src/base/platform_thread_posix.cc:38
#29 0x00007f9d7d9fc61a in start_thread () at /lib64/libpthread.so.0
#30 0x00007f9d7cc9759d in clone () at /lib64/libc.so.6
This patch changes the call to use gfxPrefs, as it's thread-safe after the initial gfxPrefs::GetSingleton call in gfxPlatform.
Comment on attachment 8768463 [details]
Bug 1284934 - Use gfxPrefs to check ASAP mode in GLContextProviderGLX.

https://reviewboard.mozilla.org/r/62702/#review60502

::: gfx/gl/GLContextProviderGLX.cpp:950
(Diff revision 1)
>  
>          if (!IsOffscreen() && mGLX->SupportsSwapControl()) {
>              // Many GLX implementations default to blocking until the next
>              // VBlank when calling glXSwapBuffers. We want to run unthrottled
>              // in ASAP mode. See bug 1280744.
> -            int interval = gfxPlatform::IsInLayoutAsapMode() ? 0 : 1;
> +            int interval = gfxPrefs::LayoutFrameRate() == 0 ? 0 : 1;

I prefer:
const bool isASAP = (gfxPrefs::LayoutFrameRate() == 0);
int interval = (isASAP ? 0 : 1);
Attachment #8768463 - Flags: review?(jgilbert) → review+
Comment on attachment 8768463 [details]
Bug 1284934 - Use gfxPrefs to check ASAP mode in GLContextProviderGLX.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/62702/diff/1-2/
Pushed by acomminos@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f95ff5bf4df8
Use gfxPrefs to check ASAP mode in GLContextProviderGLX. r=jgilbert
Status: NEW → ASSIGNED
https://hg.mozilla.org/mozilla-central/rev/f95ff5bf4df8
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: