Closed Bug 795670 Opened 12 years ago Closed 12 years ago

mach failed to build on Japanese Windows

Categories

(Firefox Build System :: Mach Core, enhancement)

x86_64
Windows 8
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla18

People

(Reporter: emk, Unassigned)

Details

Attachments

(2 files)

934.38 934.38 PObjectWrapperChild.cpp 934.38 Exception in thread Thread-4: Traceback (most recent call last): File "c:\mozilla-build\python\lib\threading.py", line 552, in __bootstrap_inne r self.run() File "c:\mozilla-build\python\lib\threading.py", line 505, in run self.__target(*self.__args, **self.__kwargs) File "h:\m\mozilla-central\testing/mozbase/mozprocess\mozprocess\processhandle r.py", line 683, in _processOutput self.processOutputLine(line.rstrip()) File "h:\m\mozilla-central\testing/mozbase/mozprocess\mozprocess\processhandle r.py", line 648, in processOutputLine handler(line) File "h:\m\mozilla-central\python/mozbuild\mozbuild\base.py", line 310, in han dleLine line = line.decode(sys.stdout.encoding) UnicodeDecodeError: 'cp932' codec can't decode bytes in position 112-113: illega l multibyte sequence Traceback (most recent call last): IO Completion Port unexpectedly closed File "./mach", line 48, in <module> mach.run(sys.argv[1:]) File "h:\m\mozilla-central\python/mach\mach\main.py", line 133, in run fn(**stripped) File "h:\m\mozilla-central\python/mach\mach\build.py", line 45, in build log=False, print_directory=False) File "h:\m\mozilla-central\python/mozbuild\mozbuild\base.py", line 256, in _ru n_make fn(**params) File "h:\m\mozilla-central\python/mozbuild\mozbuild\base.py", line 279, in _ru n_command_in_srcdir self._run_command(cwd=self.topsrcdir, **args) File "h:\m\mozilla-central\python/mozbuild\mozbuild\base.py", line 333, in _ru n_command status = p.wait() File "h:\m\mozilla-central\testing/mozbase/mozprocess\mozprocess\processhandle r.py", line 722, in wait return self.proc.wait() File "h:\m\mozilla-central\testing/mozbase/mozprocess\mozprocess\processhandle r.py", line 134, in wait self.returncode = self._wait() File "h:\m\mozilla-central\testing/mozbase/mozprocess\mozprocess\processhandle r.py", line 421, in _wait raise OSError(err) OSError: IO Completion Port failed to signal process shutdown
BTW, I have no idea where is PObjectWrapperChild.cpp in the tree from the mach output. How can I find the full-path of the building file?
So much for assuming child processes honor the parent's encoding. Please change h:\m\mozilla-central\python/mozbuild\mozbuild\base.py line 310 from: line = line.decode(sys.stdout.encoding) to line = line.decode('utf-8') and let me know if that works.
(In reply to Gregory Szorc [:gps] from comment #2) > So much for assuming child processes honor the parent's encoding. > > Please change h:\m\mozilla-central\python/mozbuild\mozbuild\base.py line 310 > from: > > line = line.decode(sys.stdout.encoding) > > to > > line = line.decode('utf-8') > > and let me know if that works. It failed much earlier: 18.42 checking compiler version... Microsoft(R) C/C++ Optimizing Compiler Versio n 17.00.50727.1 for x86 18.42 Copyright (C) Microsoft Corporation. All rights reserved. 18.42 Exception in thread Thread-4: Traceback (most recent call last): File "c:\mozilla-build\python\lib\threading.py", line 552, in __bootstrap_inne r self.run() File "c:\mozilla-build\python\lib\threading.py", line 505, in run self.__target(*self.__args, **self.__kwargs) File "h:\m\mozilla-central\testing/mozbase/mozprocess\mozprocess\processhandle r.py", line 683, in _processOutput self.processOutputLine(line.rstrip()) File "h:\m\mozilla-central\testing/mozbase/mozprocess\mozprocess\processhandle r.py", line 648, in processOutputLine handler(line) File "h:\m\mozilla-central\python/mozbuild\mozbuild\base.py", line 310, in han dleLine line = line.decode('utf-8') File "c:\mozilla-build\python\lib\encodings\utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0x83 in position 5: invalid s tart byte
This likely means that the build output is a mixture of UTF-8 and your configured system encoding (CP932). Not cool. So, I guess I was too optimistic in hoping that the entire build system output would A) conform to the system's configured encoding or B) UTF-8. The "easy" fix is to define the "error" parameter to .decode so ignore errors. e.g. line = line.decode('utf-8', 'ignore') OR line = line.decode(sys.stdout.encoding, 'ignore') The hard fix is to treat everything as byte arrays all the way through. If we do this, we'll run into the same encoding hell that we tried to fix in bug 794713. Oh, the joys of encoding.
Can python read the console output using Unicode APIs (such as ReadConsoleOutputW function) on Windows? It will resolve the problem fundamentally. I'll try the "easy" fix when I come home.
It's not reading an actual console here, it's reading the output of a process (using subprocess.Popen, then reading from its .stdout).
I tried line = line.decode(sys.stdout.encoding, 'ignore') and it ended with the following output. 7278.52 - AccessControl::DenyOnRegKey 7278.52 - AccessControl::DisableFileInheritance 7278.52 - AccessControl::DisableRegKeyInheritance 7278.52 - AccessControl::EnableFileInheritance 7278.52 - AccessControl::EnableRegKeyInheritance 7278.53 - AccessControl::GetCurrentUserName 7278.53 - AccessControl::GetFileGroup 7278.53 - AccessControl::GetFileOwner 7278.53 - AccessControl::GetRegKeyGroup 7278.53 - AccessControl::GetRegKeyOwner 7278.53 - AccessControl::GrantOnFile 7278.53 - AccessControl::GrantOnRegKey 7278.53 - AccessControl::IsUserTheAdministrator 7278.53 - AccessControl::RevokeOnFile 7278.53 - AccessControl::RevokeOnRegKey 7278.53 - AccessControl::SetFileGroup 7278.53 - AccessControl::SetFileOwner 7278.53 - AccessControl::SetOnFile 7278.53 - AccessControl::SetOnRegKey 7278.53 - AccessControl::SetRegKeyGroup 7278.53 - AccessControl::SetRegKeyOwner 7278.53 - AccessControl::SidToName 7278.53 - AppAssocReg::ClearUserAssociations 7278.54 - AppAssocReg::QueryAppIsDefault 7278.54 - AppAssocReg::QueryAppIsDefaultAll 7278.54 - AppAssocReg::QueryCurrentDefault 7278.54 - AppAssocReg::SetAppAsDefault 7278.54 - AppAssocReg::SetAppAsDefaultAll 7278.54 - ApplicationID::Set 7278.54 - ApplicationID::UninstallJumpLists 7278.54 - ApplicationID::UninstallPinnedItem 7278.54 - CertCheck::VerifyCertNameIssuer 7278.54 - CertCheck::VerifyCertTrust 7278.54 - CityHash::GetCityHash64 7278.54 - InetBgDL::Get 7278.54 - InetBgDL::GetStats 7278.54 - InvokeShellVerb::DoIt 7278.54 - ServicesHelper::IsInstalled 7278.54 - ServicesHelper::PathToUniqueRegistryPath 7278.54 - ServicesHelper::Stop 7278.54 - ShellLink::GetShortCutArgs 7278.55 - ShellLink::GetShortCutDescription 7278.55 - ShellLink::GetShortCutHotkey 7278.55 - ShellLink::GetShortCutIconIndex 7278.55 - ShellLink::GetShortCutIconLocation 7278.55 - ShellLink::GetShortCutShowMode 7278.55 - ShellLink::GetShortCutTarget 7278.55 - ShellLink::GetShortCutWorkingDirectory 7278.55 - ShellLink::SetRunAsAdministrator 7278.55 - ShellLink::SetShortCutArgs 7278.55 - ShellLink::SetShortCutDescription 7278.55 - ShellLink::SetShortCutHotkey 7278.55 - ShellLink::SetShortCutIconIndex 7278.55 - ShellLink::SetShortCutIconLocation 7278.55 - ShellLink::SetShortCutShowMode 7278.55 - ShellLink::SetShortCutTarget 7278.55 - ShellLink::SetShortCutWorkingDirectory 7278.55 - UAC::Exec 7278.55 - UAC::ExecCodeSegment 7278.55 - UAC::ExecWait 7278.55 - UAC::GetElevationType 7278.56 - UAC::GetOuterHwnd 7278.56 - UAC::GetShellFolderPath 7278.56 - UAC::IsAdmin 7278.56 - UAC::RunElevated 7278.56 - UAC::ShellExec 7278.56 - UAC::ShellExecWait 7278.56 - UAC::StackPush 7278.56 - UAC::SupportsUAC 7278.56 - UAC::Unload 7280.40 7280.40 Processed 1 file, writing output: 7280.42 7280.42 Output: "h:\m\mozilla-central\obj-i686-pc-mingw32\browser\installer\wind ows\instgen\helper.exe" 7280.43 Install: 2 pages (128 bytes), 1 section (16416 bytes), 4387 instructions (122836 bytes), 534 strings (19060 bytes), 1 language table (226 bytes). 7280.43 Uninstall: 5 pages (320 bytes), 7280.43 1 section (16416 bytes), 2458 instructions (68824 bytes), 433 strings (1 3092 bytes), 1 language table (314 bytes). 7280.43 Datablock optimizer saved 185392 bytes (~20.3%). 7280.43 7280.43 Using zlib compression. 7280.43 7280.43 EXE header size: 63488 / 39424 bytes 7280.43 Install code: 159046 / 159042 bytes 7280.43 Install data: 187144 / 372544 bytes 7280.43 Uninstall code+data: 472922 / 472914 bytes 7280.45 CRC (0x8F24A034): 4 / 4 bytes 7280.45 7280.46 Total size: 882604 / 1043928 bytes (84.5%) 7281.99 MakeNSIS v2.46-Unicode - Copyright 1995-2009 Contributors 7281.99 See the file COPYING for license details. 7281.99 Credits can be found in the Users Manual. 7281.99 7281.99 Processing config: 7282.00 Processing plugin dlls: "c:\mozilla-build\nsis-2.46u\Plugins\*.dll" 7282.00 - AdvSplash::show 7282.00 - Banner::destroy 7282.00 - Banner::getWindow 7282.00 - Banner::show 7282.00 - BgImage::AddImage 7282.00 - BgImage::AddText 7282.00 - BgImage::Clear 7282.00 - BgImage::Destroy 7282.00 - BgImage::Redraw 7282.00 - BgImage::SetBg 7282.01 - BgImage::SetReturn 7282.01 - BgImage::Sound 7282.01 - Dialer::AttemptConnect 7282.01 - Dialer::AutodialHangup 7282.01 - Dialer::AutodialOnline 7282.01 - Dialer::AutodialUnattended 7282.01 - Dialer::GetConnectedState 7282.01 - InstallOptions::dialog 7282.01 - InstallOptions::initDialog 7282.01 - InstallOptions::show 7282.01 - LangDLL::LangDialog 7282.01 - Math::Script 7282.01 - NSISdl::download 7282.01 - NSISdl::download_quiet 7282.01 - Splash::show 7282.01 - StartMenu::Init 7282.01 - StartMenu::Select 7282.01 - StartMenu::Show 7282.01 - System::Alloc 7282.02 - System::Call 7282.02 - System::Copy 7282.02 - System::Free 7282.02 - System::Get 7282.02 - System::Int64Op 7282.02 - System::Store 7282.02 - System::StrAlloc 7282.02 - TypeLib::GetLibVersion 7282.02 - TypeLib::Register 7282.02 - TypeLib::UnRegister 7282.02 - UserInfo::GetAccountType 7282.02 - UserInfo::GetName 7282.02 - UserInfo::GetOriginalAccountType 7282.02 - VPatch::GetFileCRC32 7282.02 - VPatch::GetFileMD5 7282.02 - VPatch::vpatchfile 7282.02 - nsDialogs::Create 7282.02 - nsDialogs::CreateControl 7282.02 - nsDialogs::CreateItem 7282.02 - nsDialogs::CreateTimer 7282.02 - nsDialogs::GetUserData 7282.02 - nsDialogs::KillTimer 7282.03 - nsDialogs::OnBack 7282.03 - nsDialogs::OnChange 7282.03 - nsDialogs::OnClick 7282.03 - nsDialogs::OnNotify 7282.03 - nsDialogs::SelectFileDialog 7282.03 - nsDialogs::SelectFolderDialog 7282.03 - nsDialogs::SetRTL 7282.03 - nsDialogs::SetUserData 7282.03 - nsDialogs::Show 7282.03 - nsExec::Exec 7282.03 - nsExec::ExecToLog 7282.03 - nsExec::ExecToStack 7282.03 7282.03 !define: "MUI_INSERT_NSISCONF"="" 7282.03 7282.03 Changing directory to: "h:\m\mozilla-central\obj-i686-pc-mingw32\browser \installer\windows\instgen" 7282.03 7282.03 Processing script file: "maintenanceservice_installer.nsi" 7282.42 - AccessControl::ClearOnFile 7282.42 - AccessControl::ClearOnRegKey 7282.42 - AccessControl::DenyOnFile 7282.42 - AccessControl::DenyOnRegKey 7282.42 - AccessControl::DisableFileInheritance 7282.42 - AccessControl::DisableRegKeyInheritance 7282.42 - AccessControl::EnableFileInheritance 7282.42 - AccessControl::EnableRegKeyInheritance 7282.42 - AccessControl::GetCurrentUserName 7282.42 - AccessControl::GetFileGroup 7282.42 - AccessControl::GetFileOwner 7282.42 - AccessControl::GetRegKeyGroup 7282.42 - AccessControl::GetRegKeyOwner 7282.42 - AccessControl::GrantOnFile 7282.42 - AccessControl::GrantOnRegKey 7282.42 - AccessControl::IsUserTheAdministrator 7282.42 - AccessControl::RevokeOnFile 7282.42 - AccessControl::RevokeOnRegKey 7282.42 - AccessControl::SetFileGroup 7282.43 - AccessControl::SetFileOwner 7282.43 - AccessControl::SetOnFile 7282.43 - AccessControl::SetOnRegKey 7282.43 - AccessControl::SetRegKeyGroup 7282.43 - AccessControl::SetRegKeyOwner 7282.43 - AccessControl::SidToName 7282.43 - AppAssocReg::ClearUserAssociations 7282.43 - AppAssocReg::QueryAppIsDefault 7282.43 - AppAssocReg::QueryAppIsDefaultAll 7282.43 - AppAssocReg::QueryCurrentDefault 7282.43 - AppAssocReg::SetAppAsDefault 7282.43 - AppAssocReg::SetAppAsDefaultAll 7282.43 - ApplicationID::Set 7282.43 - ApplicationID::UninstallJumpLists 7282.43 - ApplicationID::UninstallPinnedItem 7282.43 - CertCheck::VerifyCertNameIssuer 7282.43 - CertCheck::VerifyCertTrust 7282.43 - CityHash::GetCityHash64 7282.43 - InetBgDL::Get 7282.44 - InetBgDL::GetStats 7282.44 - InvokeShellVerb::DoIt 7282.44 - ServicesHelper::IsInstalled 7282.44 - ServicesHelper::PathToUniqueRegistryPath 7282.44 - ServicesHelper::Stop 7282.44 - ShellLink::GetShortCutArgs 7282.44 - ShellLink::GetShortCutDescription 7282.44 - ShellLink::GetShortCutHotkey 7282.44 - ShellLink::GetShortCutIconIndex 7282.44 - ShellLink::GetShortCutIconLocation 7282.44 - ShellLink::GetShortCutShowMode 7282.44 - ShellLink::GetShortCutTarget 7282.44 - ShellLink::GetShortCutWorkingDirectory 7282.44 - ShellLink::SetRunAsAdministrator 7282.44 - ShellLink::SetShortCutArgs 7282.44 - ShellLink::SetShortCutDescription 7282.44 - ShellLink::SetShortCutHotkey 7282.44 - ShellLink::SetShortCutIconIndex 7282.44 - ShellLink::SetShortCutIconLocation 7282.44 - ShellLink::SetShortCutShowMode 7282.44 - ShellLink::SetShortCutTarget 7282.44 - ShellLink::SetShortCutWorkingDirectory 7282.45 - UAC::Exec 7282.45 - UAC::ExecCodeSegment 7282.45 - UAC::ExecWait 7282.45 - UAC::GetElevationType 7282.45 - UAC::GetOuterHwnd 7282.45 - UAC::GetShellFolderPath 7282.45 - UAC::IsAdmin 7282.45 - UAC::RunElevated 7282.45 - UAC::ShellExec 7282.45 - UAC::ShellExecWait 7282.45 - UAC::StackPush 7282.45 - UAC::SupportsUAC 7282.45 - UAC::Unload 7282.46 7282.46 Processed 1 file, writing output: 7282.46 7282.46 Output: "h:\m\mozilla-central\obj-i686-pc-mingw32\browser\installer\wind ows\instgen\maintenanceservice_installer.exe" 7282.46 Install: 2 pages (128 bytes), 1 section (16416 bytes), 553 instructions (15484 bytes), 182 strings (4506 bytes), 1 language table (210 bytes). 7282.46 Uninstall: 3 pages (192 bytes), 7282.46 1 section (16416 bytes), 114 instructions (3192 bytes), 109 strings (390 8 bytes), 1 language table (250 bytes). 7282.46 Datablock optimizer saved 33804 bytes (~18.5%). 7282.46 7282.46 Using zlib compression. 7282.46 7282.47 EXE header size: 64000 / 39424 bytes 7282.47 Install code: 37124 / 37120 bytes 7282.47 Install data: 17416 / 51228 bytes 7282.47 Uninstall code+data: 67046 / 67038 bytes 7282.47 CRC (0xF45BF085): 4 / 4 bytes 7282.47 7282.47 Total size: 185590 / 194814 bytes (95.2%) 7329.84 tools_tier_app 7336.86 WARNING:pymake.data:browser_464620_a.js is disabled on Windows for inter mittent failures. Bug 552424 7336.86 WARNING:pymake.data:browser_464620_b.js is disabled on Windows for inter mittent failures. Bug 552424 7337.65 WARNING:pymake.data:browser_forgetthissite_single.js temporarily disable d because of very frequent oranges, see bug 551540 7337.66 WARNING:pymake.data:browser_sidebarpanels_click.js temporarily disabled cause it breaks the treeview, see bug 658744 7337.71 WARNING:pymake.data:browser_forgetthissite_single.js temporarily disable d because of very frequent oranges, see bug 551540 7337.71 WARNING:pymake.data:browser_sidebarpanels_click.js temporarily disabled cause it breaks the treeview, see bug 658744 7340.46 WARNING:pymake.data:browser_dbg_select-line.js temporarily disabled due to oranges, see bug 726609 Parent process exited without killing children, attempting to kill children Parent process exited without killing children, attempting to kill children Error Code 6 trying to query IO Completion Port, exiting 7527.27 834 compiler warnings present. Exception in thread Thread-3: Traceback (most recent call last): File "c:\mozilla-build\python\lib\threading.py", line 552, in __bootstrap_inne r self.run() File "c:\mozilla-build\python\lib\threading.py", line 505, in run self.__target(*self.__args, **self.__kwargs) File "h:\m\mozilla-central\testing/mozbase/mozprocess\mozprocess\processhandle r.py", line 282, in _procmgr self._poll_iocompletion_port() File "h:\m\mozilla-central\testing/mozbase/mozprocess\mozprocess\processhandle r.py", line 331, in _poll_iocompletion_port raise WinError(errcode) WindowsError: [Error 6] ハンドルが無効です。
If I executed ./build/pymake/make.py -f client.mk -j2 -s directly, the command ends with the following message without any errors. Does mach fail to find the end of the stream? EXE header size: 64000 / 39424 bytes Install code: 37124 / 37120 bytes Install data: 17416 / 51228 bytes Uninstall code+data: 67046 / 67038 bytes CRC (0xF45BF085): 4 / 4 bytes Total size: 185590 / 194814 bytes (95.2%) tools_tier_app WARNING:pymake.data:browser_464620_a.js is disabled on Windows for intermittent failures. Bug 552424 WARNING:pymake.data:browser_464620_b.js is disabled on Windows for intermittent failures. Bug 552424 WARNING:pymake.data:browser_forgetthissite_single.js temporarily disabled becaus e of very frequent oranges, see bug 551540 WARNING:pymake.data:browser_sidebarpanels_click.js temporarily disabled cause it breaks the treeview, see bug 658744 WARNING:pymake.data:browser_forgetthissite_single.js temporarily disabled becaus e of very frequent oranges, see bug 551540 WARNING:pymake.data:browser_sidebarpanels_click.js temporarily disabled cause it breaks the treeview, see bug 658744 WARNING:pymake.data:browser_dbg_select-line.js temporarily disabled due to orang es, see bug 726609
This worries me: Exception in thread Thread-3: Traceback (most recent call last): File "c:\mozilla-build\python\lib\threading.py", line 552, in __bootstrap_inne r self.run() File "c:\mozilla-build\python\lib\threading.py", line 505, in run self.__target(*self.__args, **self.__kwargs) File "h:\m\mozilla-central\testing/mozbase/mozprocess\mozprocess\processhandle r.py", line 282, in _procmgr self._poll_iocompletion_port() File "h:\m\mozilla-central\testing/mozbase/mozprocess\mozprocess\processhandle r.py", line 331, in _poll_iocompletion_port raise WinError(errcode) WindowsError: [Error 6] ハンドルが無効です。 That sure smells like a mozprocess bug. The good news is it appears line.decode(sys.stdout.encoding, 'ignore') gets you through the build. It's just at the very end where mozprocess is throwing an exception for some weird reason. You can safely ignore that error. FWIW, those times say it took 125 minutes to perform a build. That's a very long time, even for Windows. Either your computer is more than a few years old (slow) or your build is configured wrong. If your computer is relatively new (say a Core i5 or faster), I'd like to help you get faster build times.
(In reply to Gregory Szorc [:gps] from comment #9) > FWIW, those times say it took 125 minutes to perform a build. That's a very > long time, even for Windows. Either your computer is more than a few years > old (slow) or your build is configured wrong. If your computer is relatively > new (say a Core i5 or faster), I'd like to help you get faster build times. Don't worry about that. My build machine is four-years-old laptop.
:emk, I don't suppose you could translate this for us? WindowsError: [Error 6] ハンドルが無効です。
Error code 6 is INVALID_HANDLE_VALUE, which implies that self._io_port is somehow invalid, but how or why this would occur is a mystery to me. Might be worth dumping the value of self._io_port at http://mxr.mozilla.org/mozilla-central/source/testing/mozbase/mozprocess/mozprocess/processhandler.py#206, since we don't explicitly check the return value there.
After https://hg.mozilla.org/mozilla-central/rev/a119cc1cdf0a has been landed, invalid handle error does no longer occur. Yay!
This patch is still needed to complete the build without failure.
Attachment #668445 - Flags: review?(gps)
Comment on attachment 668445 [details] [diff] [review] Ignore conversion errors Review of attachment 668445 [details] [diff] [review]: ----------------------------------------------------------------- This line is highly contentious. We will likely work out a long term solution in bug 796875. Until then, I think a better short-term fix would be the line: line = line.decode(sys.stdout.encoding or 'utf-8', 'replace') While we're here we should detect sys.stdout.encoding == None. And, I also think replacing with the standard "unknown character" Unicode character is less lossy than ignoring the data. If that works on your machine, you have my r+. You can land directly in mozilla-central. Just add "DONTBUILD (NPOTB)" somewhere in the commit message to avoid triggering automated tree building.
Attachment #668445 - Flags: review?(gps)
Build completed with this patch. I have no level 3 commit priv. Could you land this patch for me?
Attachment #668722 - Flags: checkin?(gps)
https://hg.mozilla.org/mozilla-central/rev/729099167c99 Remaining encoding issues will be tracked in bug 796875.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
Attachment #668722 - Flags: checkin?(gps) → checkin+
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: