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

[Impeller] Play/RendererTest.DefaultIndexSize/Vulkan: X Error of failed request: BadAccess (attempt to access private resource denied) #116130

Closed
filmil opened this issue Nov 28, 2022 · 12 comments
Labels
c: crash Stack traces logged to the console e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels. P2 Important issues not at the top of the work list team-engine Owned by Engine team triaged-engine Triaged by Engine team

Comments

@filmil
Copy link

filmil commented Nov 28, 2022

This error breaks the ICU roller into Fuchsia. The error seems unrelated to the roller - the ICU library has nothing to do with graphics output.

Steps to Reproduce

See: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8796611293756295121/+/u/test:_Host_Tests_for_host_debug_impeller_vulkan__3_/stdout

[ RUN      ] Play/RendererTest.DefaultIndexSize/Vulkan
X Error of failed request:  BadAccess (attempt to access private resource denied)
  Major opcode of failed request:  130 ()
  Minor opcode of failed request:  1
  Serial number of failed request:  7108
  Current serial number in output stream:  7117
[FATAL:flutter/fml/thread_local.cc(32)] Check failed: false. pthread_setspecific failed (22): Invalid argument
[ERROR:flutter/fml/backtrace.cc(108)] Caught signal SIGABRT during program execution.
Frame 0: 0x7f7b760db7f1 abort
Frame 1: 0x55b155b0c379 Unknown
Frame 2: 0x55b155b0c358 fml::LogMessage::~LogMessage()
Frame 3: 0x55b155b26e13 fml::internal::ThreadLocalPointer::swap()
Frame 4: 0x55b155b1026d fml::ThreadLocalUniquePtr<>::reset()
Frame 5: 0x55b155b10d3b fml::MessageLoopTaskQueues::GetNextTaskToRun()
Frame 6: 0x55b155b0f7fa fml::MessageLoopImpl::FlushTasks()
Frame 7: 0x55b155b0f73a fml::MessageLoopImpl::RunExpiredTasksNow()
Frame 8: 0x55b155b292ca fml::MessageLoopLinux::OnEventFired()
Frame 9: 0x55b155b2927c fml::MessageLoopLinux::Run()
Frame 10: 0x55b155b0f6d9 fml::MessageLoopImpl::DoRun()
Frame 11: 0x55b155b0e76d fml::MessageLoop::Run()
Frame 12: 0x55b155b242ce fml::Thread::Thread()::$_0::operator()()
Frame 13: 0x55b155b24235 std::_LIBCPP_ABI_NAMESPACE::__invoke[abi:v15000]<>()
Frame 14: 0x55b155b2420d std::_LIBCPP_ABI_NAMESPACE::__thread_execute[abi:v15000]<>()
Frame 15: 0x55b155b23ff8 std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<>()
Frame 16: 0x7f7b764936db start_thread
Frame 17: 0x7f7b761bc61f __clone
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Failed Command:
/b/s/w/ir/cache/builder/src/out/host_debug_impeller_vulkan/exe.unstripped/impeller_unittests --gtest_repeat=2 --gtest_shuffle --gtest_filter="*CanRegisterStage/Vulkan:*CanCreatePipelineFromRuntimeStage/Vulkan:*CanvasCTMCanBeUpdated/Vulkan:*CanvasCanPushPopCTM/Vulkan:*CanRenderColoredRect/Vulkan:*CanRenderStrokes/Vulkan:*CanRenderCurvedStrokes/Vulkan:*CanRenderClips/Vulkan:*CanRenderNestedClips/Vulkan:*CanRenderDifferenceClips/Vulkan:*ClipsUseCurrentTransform/Vulkan:*CanSaveLayerStandalone/Vulkan:*CanRenderLinearGradient/Vulkan:*CanRenderLinearGradientManyColors/Vulkan:*CanRenderLinearGradientWayManyColors/Vulkan:*CanRenderLinearGradientManyColorsUnevenStops/Vulkan:*CanRenderRadialGradient/Vulkan:*CanRenderRadialGradientManyColors/Vulkan:*CanRenderSweepGradient/Vulkan:*CanRenderSweepGradientManyColors/Vulkan:*CanRenderDifferentShapesWithSameColorSource/Vulkan:*CanPictureConvertToImage/Vulkan:*BlendModeShouldCoverWholeScreen/Vulkan:*CanRenderGroupOpacity/Vulkan:*CanPerformFullScreenMSAA/Vulkan:*CanPerformSkew/Vulkan:*CanPerformSaveLayerWithBounds/Vulkan:*CanPerformSaveLayerWithBoundsAndLargerIntermediateIsNotAllocated/Vulkan:*CanRenderRoundedRectWithNonUniformRadii/Vulkan:*CanRenderTextFrame/Vulkan:*CanRenderItalicizedText/Vulkan:*CanRenderEmojiTextFrame/Vulkan:*CanRenderTextInSaveLayer/Vulkan:*CanDrawPaint/Vulkan:*PaintBlendModeIsRespected/Vulkan:*ColorWheel/Vulkan:*TransformMultipliesCorrectly/Vulkan:*SolidStrokesRenderCorrectly/Vulkan:*GradientStrokesRenderCorrectly/Vulkan:*DrawRectStrokesRenderCorrectly/Vulkan:*SaveLayerDrawsBehindSubsequentEntities/Vulkan:*SiblingSaveLayerBoundsAreRespected/Vulkan:*CanRenderClippedLayers/Vulkan:*CanDrawRect/Vulkan:*CanDrawTextBlob/Vulkan:*CanDrawCapsAndJoins/Vulkan:*CanDrawArc/Vulkan:*StrokedPathsDrawCorrectly/Vulkan:*CanDrawWithOddPathWinding/Vulkan:*CanDrawPoints/Vulkan:*CanDrawZeroLengthLine/Vulkan:*CanDrawShadow/Vulkan:*CanConvertTriangleFanToTriangles/Vulkan:*CanDrawZeroWidthLine/Vulkan:*CanDrawRectWithLinearToSrgbColorFilter/Vulkan:*CanBlendDstOverAndDstCorrectly/Vulkan:*CanCreateEntity/Vulkan:*EntityPassCoverageRespectsDelegateBoundsHint/Vulkan:*EntityPassCoverageRespectsCoverageLimit/Vulkan:*CanDrawRect/Vulkan:*ThreeStrokesInOnePath/Vulkan:*TriangleInsideASquare/Vulkan:*StrokeCapAndJoinTest/Vulkan:*CubicCurveTest/Vulkan:*CubicCurveAndOverlapTest/Vulkan:*SolidColorContentsStrokeSetStrokeCapsAndJoins/Vulkan:*SolidColorContentsStrokeSetMiterLimit/Vulkan:*BlendingModeOptions/Vulkan:*BezierCircleScaled/Vulkan:*SetBlendMode/Vulkan:*ContentsGetBoundsForEmptyPathReturnsNullopt/Vulkan:*SolidStrokeCoverageIsCorrect/Vulkan:*BorderMaskBlurCoverageIsCorrect/Vulkan:*DrawVerticesSolidColorTrianglesWithoutIndices/Vulkan:*DrawVerticesLinearGradientWithoutIndices/Vulkan:*DrawVerticesSolidColorTrianglesWithIndices/Vulkan:*SolidFillCoverageIsCorrect/Vulkan:*SolidFillShouldRenderIsCorrect/Vulkan:*ClipContentsShouldRenderIsCorrect/Vulkan:*RRectShadowTest/Vulkan:*ColorMatrixFilterCoverageIsCorrect/Vulkan:*LinearToSrgbFilterCoverageIsCorrect/Vulkan:*SrgbToLinearFilterCoverageIsCorrect/Vulkan:*TTTBlendColor/Vulkan:*SdfText/Vulkan:*RuntimeEffect/Vulkan:*ArrayUniforms/Vulkan:*CanCreateCPUBackedTexture/Vulkan:*DefaultIndexSize/Vulkan:*VertexBufferBuilder/Vulkan:*CanCreateComputePass/Vulkan:*CanConvertTextBlob/Vulkan:*CanCreateRenderContext/Vulkan:*LazyAtlasTracksColor/Vulkan:"
Exit Code: -6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Stopping Xvfb with pid 13505 ...
Xvfb pid file removed
Traceback (most recent call last):
  File "/b/s/w/ir/cache/builder/src/flutter/testing/run_tests.py", line 1152, in <module>
    sys.exit(main())
  File "/b/s/w/ir/cache/builder/src/flutter/testing/run_tests.py", line 1101, in main
    coverage=args.coverage
  File "/b/s/w/ir/cache/builder/src/flutter/testing/run_tests.py", line 236, in RunEngineExecutable
    env=env
  File "/b/s/w/ir/cache/builder/src/flutter/testing/run_tests.py", line 91, in RunCmd
    (command_string, process.returncode)
Exception: Command "/b/s/w/ir/cache/builder/src/out/host_debug_impeller_vulkan/exe.unstripp

Logs

@filmil
Copy link
Author

filmil commented Nov 28, 2022

@akbiggs FYI

@jonahwilliams
Copy link
Member

I don't think that failure is even making it to the test itself, might be a different issue. FYI @iskakaushik

@filmil
Copy link
Author

filmil commented Nov 28, 2022

So, IIUC, you are saying that the failure is unrelated to the stack trace shown?

@jonahwilliams
Copy link
Member

The failure seems unrelated to the contents of the test itself. its failing in the setup code and not in the test body

@huycozy huycozy added in triage Presently being triaged by the triage team c: crash Stack traces logged to the console engine flutter/engine repository. See also e: labels. and removed in triage Presently being triaged by the triage team labels Nov 29, 2022
@chinmaygarde chinmaygarde added e: impeller Impeller rendering backend issues and features requests P2 Important issues not at the top of the work list labels Dec 5, 2022
@chinmaygarde
Copy link
Member

We may be accessing a thread local on a thread that is terminating in the unit-test harness. If I had to guess, the Vulkan backend in Impeller does create a separate thread to wait on fences and such. Perhaps that's the thread? cc @iskakaushik

@jason-simmons
Copy link
Member

I can reproduce this by running flutter/testing/run_tests.py --type impeller-vulkan a few times on my Linux workstation.

The X client library is sometimes getting an error, and after logging the "failed request" message it calls exit to terminate the process.

That causes destruction of global objects, including the ThreadLocalUniquePtr<TaskSourceGradeHolder> in fml/message_loop_task_queues.cc. The destructor calls pthread_key_delete on the TLS key used by that ThreadLocalUniquePtr.

But other threads may still be running while exit is doing this. If one of those threads uses that ThreadLocalUniquePtr and its key, then you get the pthread_setspecific failure above.

The Impeller Vulkan tests are using Xvfb. I don't know why the interaction with Xvfb is sometimes producing these X protocol errors.

@jason-simmons
Copy link
Member

Stack trace of the Xlib API failure:

#5  0x00007fae14e3ffb5 in __run_exit_handlers (status=1, listp=0x7fae14ff4818 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at ./stdlib/exit.c:113
#6  0x00007fae14e4012a in __GI_exit (status=<optimized out>) at ./stdlib/exit.c:143
#7  0x00007fae151b65c7 in _XDefaultError () from /lib/x86_64-linux-gnu/libX11.so.6
#8  0x00007fae151b66fb in _XError () from /lib/x86_64-linux-gnu/libX11.so.6
#9  0x00007fae151b3367 in ?? () from /lib/x86_64-linux-gnu/libX11.so.6
#10 0x00007fae151b3405 in ?? () from /lib/x86_64-linux-gnu/libX11.so.6
#11 0x00007fae151b3eb2 in _XEventsQueued () from /lib/x86_64-linux-gnu/libX11.so.6
#12 0x00007fae151b6e15 in _XGetRequest () from /lib/x86_64-linux-gnu/libX11.so.6
#13 0x00007fae151919fa in XCreateColormap () from /lib/x86_64-linux-gnu/libX11.so.6
#14 0x000055a317ec8210 in createNativeWindow (window=0x55a31aa50640, wndconfig=0x7fff8bdd6288, visual=0x55a31a84ae00, depth=24) at ../../third_party/glfw/src/x11_window.c:596
#15 0x000055a317ec8034 in _glfwPlatformCreateWindow (window=0x55a31aa50640, wndconfig=0x7fff8bdd6288, ctxconfig=0x7fff8bdd61e0, fbconfig=0x7fff8bdd6218) at ../../third_party/glfw/src/x11_window.c:1976
#16 0x000055a317ebb765 in glfwCreateWindow (width=800, height=600, title=0x55a31558c9cd "Test Vulkan Window", monitor=0x0, share=0x0) at ../../third_party/glfw/src/window.c:214
#17 0x000055a316626155 in impeller::PlaygroundImplVK::PlaygroundImplVK (this=0x55a31aa1d650) at ../../flutter/impeller/playground/backend/vulkan/playground_impl_vk.cc:66
#18 0x000055a31661fa5d in std::_LIBCPP_ABI_NAMESPACE::make_unique[abi:v15000]<impeller::PlaygroundImplVK>() () at ../../third_party/libcxx/include/__memory/unique_ptr.h:714
#19 0x000055a31661f700 in impeller::PlaygroundImpl::Create (backend=impeller::PlaygroundBackend::kVulkan) at ../../flutter/impeller/playground/playground_impl.cc:37
#20 0x000055a31661b82d in impeller::Playground::SetupContext (this=0x55a31adb5380, backend=impeller::PlaygroundBackend::kVulkan) at ../../flutter/impeller/playground/playground.cc:110
#21 0x000055a317db5a91 in impeller::PlaygroundTest::SetUp (this=0x55a31adb5380) at ../../flutter/impeller/playground/playground_test.cc:26

@iskakaushik
Copy link
Contributor

@jason-simmons could this be because xvfb setup isn't complete yet? see: https://github.com/flutter/engine/blob/40019b79d4f84bbadc7412b76b6a4daf88295c8c/testing/xvfb.py#L100, maybe we should increase the timeout here?

@jason-simmons
Copy link
Member

This is happening midway through the Impeller/Vulkan test suite. Xvfb is running and many tests have successfully completed by the time this error happens.

@jason-simmons
Copy link
Member

The "Major opcode of failed request: 130" message corresponds to the MIT-SHM X extension. So I tried disabling that by adding -extension MIT-SHM to the Xvfb command line.

That appears to work around this issue. I've been running the Impeller/Vulkan tests repeatedly on my Linux setup with that patch and have not seen this error.

jason-simmons added a commit to jason-simmons/flutter_engine that referenced this issue Dec 6, 2022
auto-submit bot pushed a commit to flutter/engine that referenced this issue Dec 6, 2022
@chinmaygarde chinmaygarde changed the title Play/RendererTest.DefaultIndexSize/Vulkan: X Error of failed request: BadAccess (attempt to access private resource denied) [Impeller] Play/RendererTest.DefaultIndexSize/Vulkan: X Error of failed request: BadAccess (attempt to access private resource denied) Dec 9, 2022
@flutter-triage-bot flutter-triage-bot bot added team-engine Owned by Engine team triaged-engine Triaged by Engine team labels Jul 8, 2023
@jonahwilliams
Copy link
Member

I don't think has been recurring. can we close this issue?

@github-actions
Copy link

github-actions bot commented Sep 8, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: crash Stack traces logged to the console e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels. P2 Important issues not at the top of the work list team-engine Owned by Engine team triaged-engine Triaged by Engine team
Projects
No open projects
Archived in project
Development

No branches or pull requests

6 participants