New issue
Advanced search Search tips

Issue 826018 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Fuchsia
Pri: 2
Type: Bug



Sign in to add a comment

Namespace cloning fails under pkgfs

Project Member Reported by kmarshall@chromium.org, Mar 26 2018

Issue description

The namespace cloning tests in ProcessUtilTest are failing under pkgfs. It seems as if fd clone/transfer operations fail for the fdio entries used by pkgfs.

Error text:

[10515:1007913991:0326/205653.291768:16917662:ERROR:launch_fuchsia.cc(91)] fdio_transfer_fd failed: (UNKNOWN)
[10515:1007913991:0326/205653.291890:16917785:FATAL:scoped_file.cc(42)] Check failed: 0 == ret. : Bad file descriptor (9)
#00: StackTrace at ../../base/debug/stack_trace_fuchsia.cc:173
#01: std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::endl<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) at ../../buildtools/third_party/libc++/trunk/include/ostream:1001
      (inlined by) ?? at ../../buildtools/third_party/libc++/trunk/include/ostream:195
      (inlined by) ~LogMessage at ../../base/logging.cc:595
#02: ~ErrnoLogMessage at ../../base/logging.cc:992
#03: base::internal::ScopedFDCloseTraits::Free(int) at ??:?
#04: base::LaunchProcess(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, base::LaunchOptions const&) at ../../base/scoped_generic.h:153
      (inlined by) base::ScopedGeneric<int, base::internal::ScopedFDCloseTraits>::~ScopedGeneric() at ../../base/scoped_generic.h:90
      (inlined by) base::(anonymous namespace)::MapPathsToLaunchpad(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, launchpad*) at ../../base/process/launch_fuchsia.cc:120
      (inlined by) base::LaunchProcess(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, base::LaunchOptions const&) at ../../base/process/launch_fuchsia.cc:229
#05: base::LaunchProcess(base::CommandLine const&, base::LaunchOptions const&) at ../../base/process/launch_fuchsia.cc:148
#06: base::SpawnMultiProcessTestChild(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, base::CommandLine const&, base::LaunchOptions const&) at ../../base/test/multiprocess_test.cc:28
#07: base::MultiProcessTest::SpawnChildWithOptions(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, base::LaunchOptions const&) at ../../base/test/multiprocess_test.cc:65
#08: base::ProcessUtilTest_CloneAlternateDir_Test::TestBody() at ../../buildtools/third_party/libc++/trunk/include/string:1255
      (inlined by) std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string() at ../../buildtools/third_party/libc++/trunk/include/string:1940
      (inlined by) base::ProcessUtilTest_CloneAlternateDir_Test::TestBody() at ../../base/process/process_util_unittest.cc:280
#09: testing::Test::Run() at ../../third_party/googletest/src/googletest/src/gtest.cc:5321
      (inlined by) testing::Test::Run() at ../../third_party/googletest/src/googletest/src/gtest.cc:2492
#10: testing::TestInfo::Run() at ../../third_party/googletest/src/googletest/src/gtest.cc:5321
      (inlined by) testing::TestInfo::Run() at ../../third_party/googletest/src/googletest/src/gtest.cc:2665
#11: testing::TestCase::Run() at ../../third_party/googletest/src/googletest/src/gtest.cc:2778
#12: testing::internal::UnitTestImpl::RunAllTests() at ../../third_party/googletest/src/googletest/src/gtest.cc:5035
#13: testing::UnitTest::Run() at ??:?
#14: RUN_ALL_TESTS() at ../../third_party/googletest/src/googletest/include/gtest/gtest.h:2314
      (inlined by) base::TestSuite::Run() at ../../base/test/test_suite.cc:275
#15: base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int, bool, base::OnceCallback<void ()>) at ../../base/callback.h:95
      (inlined by) base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int, bool, base::OnceCallback<void ()>) at ../../base/test/launcher/unit_test_launcher.cc:225
#16: base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>) at ../../base/test/launcher/unit_test_launcher.cc:576
#17: main at ../../base/test/run_all_base_unittests.cc:12
#18: pc 0x49a0f9b5066e (libc.so,0x1366e)

[1/1] ProcessUtilTest.CloneAlternateDir (CRASHED)

 

Comment 1 by w...@chromium.org, Mar 26 2018

Strange that the directory fd cloning is both failing _and_ tearing down the actual fd.  fdio_transfer_fd() is failing with error code 1, so we should check which paths can possibly return that.
Project Member

Comment 2 by bugdroid1@chromium.org, Mar 28 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/896d8a43bb3daced144b40e64f013f333d1fd782

commit 896d8a43bb3daced144b40e64f013f333d1fd782
Author: Kevin Marshall <kmarshall@chromium.org>
Date: Wed Mar 28 05:49:34 2018

Fuchsia: Disable failing ProcessUtilTests due to FD cloning failures.


Bug:  826018 
Change-Id: I685b96397753413cf55b0f82c5d3e6739bc0650b
Reviewed-on: https://chromium-review.googlesource.com/982903
Reviewed-by: Wez <wez@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546421}
[modify] https://crrev.com/896d8a43bb3daced144b40e64f013f333d1fd782/testing/buildbot/filters/fuchsia.base_unittests.filter

Owner: kmarshall@chromium.org
Status: Assigned (was: Untriaged)

Comment 4 by w...@chromium.org, May 5 2018

Cc: kmarshall@chromium.org
Labels: M-68
Owner: sergeyu@chromium.org
Status: Started (was: Assigned)
I believe Sergey has a CL out to fix this?
Project Member

Comment 5 by bugdroid1@chromium.org, May 7 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7e0542fb25c67ea1f0a6b1a4ab135e298bf0b76d

commit 7e0542fb25c67ea1f0a6b1a4ab135e298bf0b76d
Author: Sergey Ulanov <sergeyu@chromium.org>
Date: Mon May 07 23:44:08 2018

[Fuchsia] fix fdio_transfer_fd() result handling in base::LaunchProcess

fdio_transfer_fd() was returning number of returned handles, while
LaunchProcess() was expecting 0 on success. Also added a unittest.

Bug:  826018 
Change-Id: Iebc4457449036cc9bfe4eb2203363edde98d75af
Reviewed-on: https://chromium-review.googlesource.com/1045558
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556610}
[modify] https://crrev.com/7e0542fb25c67ea1f0a6b1a4ab135e298bf0b76d/base/process/launch_fuchsia.cc
[modify] https://crrev.com/7e0542fb25c67ea1f0a6b1a4ab135e298bf0b76d/base/process/process_util_unittest.cc

Project Member

Comment 6 by bugdroid1@chromium.org, May 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4c89d167ef938032649e61b2cd4daeb28df3f0fe

commit 4c89d167ef938032649e61b2cd4daeb28df3f0fe
Author: Sergey Ulanov <sergeyu@chromium.org>
Date: Tue May 08 20:43:09 2018

[Fuchsia] Enable ProcessUtilTests tests.

Enabled the following tests:
 ProcessUtilTest.CloneAlternateDir
 ProcessUtilTest.KillSlowChild
 ProcessUtilTest.SelectivelyClonedDir

The problem that broke these tests was fixed in crrev.com/556610 .

Also removed ProcessUtilTest.LaunchNamespaceMap because it overlaps
with the tests enabled in this CL.

Bug:  826018 
Change-Id: I211edb31ff6482e16ebad0967a5749e1dc353327
Reviewed-on: https://chromium-review.googlesource.com/1048880
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556951}
[modify] https://crrev.com/4c89d167ef938032649e61b2cd4daeb28df3f0fe/base/process/process_util_unittest.cc
[modify] https://crrev.com/4c89d167ef938032649e61b2cd4daeb28df3f0fe/testing/buildbot/filters/fuchsia.base_unittests.filter

Status: Fixed (was: Started)

Sign in to add a comment