--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
This is an odd bug to get so late in the game - I thought the entire point of bundling resources up and opening them so that the file descriptor can be shared by the zygote was to avoid this problem? Has something changed? I think your debug build could easily not reproduce production on this front.
-- Elliot
On Tue, Sep 24, 2013 at 11:28 PM, Elliot Glaysher (Chromium) <e...@chromium.org> wrote:
On Tue, Sep 24, 2013 at 2:09 PM, Scott Hess <sh...@chromium.org> wrote:
This is an odd bug to get so late in the game - I thought the entire point of bundling resources up and opening them so that the file descriptor can be shared by the zygote was to avoid this problem? Has something changed? I think your debug build could easily not reproduce production on this front.This is my understanding of how things were supposed to work. We opened the resource bundle early on and held onto the file descriptor so that if the file changed out from under us, we still held a reference to the version that was there when we opened.That sounds all nice and fine, but doesn't it assume that the process that clobbers the file actually does unlink/move in a new version instead of just opening and clobbering file contents? Maybe that's what Paweł is seeing? One way of preventing clobbering could be to make a copy of the file, open that, and unlink the copy - that'd only be fast on file systems that do copy-on-write behind the scenes though.
-- Elliot--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
On Wed, Sep 25, 2013 at 2:53 AM, Mattias Nissler <mnis...@chromium.org> wrote:
On Tue, Sep 24, 2013 at 11:28 PM, Elliot Glaysher (Chromium) <e...@chromium.org> wrote:
On Tue, Sep 24, 2013 at 2:09 PM, Scott Hess <sh...@chromium.org> wrote:
This is an odd bug to get so late in the game - I thought the entire point of bundling resources up and opening them so that the file descriptor can be shared by the zygote was to avoid this problem? Has something changed? I think your debug build could easily not reproduce production on this front.This is my understanding of how things were supposed to work. We opened the resource bundle early on and held onto the file descriptor so that if the file changed out from under us, we still held a reference to the version that was there when we opened.That sounds all nice and fine, but doesn't it assume that the process that clobbers the file actually does unlink/move in a new version instead of just opening and clobbering file contents? Maybe that's what Paweł is seeing? One way of preventing clobbering could be to make a copy of the file, open that, and unlink the copy - that'd only be fast on file systems that do copy-on-write behind the scenes though.We're dependent on the package manager to do the right thing, but AIUI apt and yum do it.
It would seem more likely that someone added a new resource somehow but didn't add the early open to pin things down.
#if defined(OS_ANDROID) // The renderer sandbox prevents us from accessing our .pak files directly. // Therefore file descriptors to the .pak files that we need are passed in // at process creation time. int locale_pak_fd = base::GlobalDescriptors::GetInstance()->MaybeGet( kAndroidLocalePakDescriptor); CHECK(locale_pak_fd != -1); ResourceBundle::InitSharedInstanceWithPakFile(locale_pak_fd, false); int extra_pak_keys[] = { kAndroidChrome100PercentPakDescriptor, kAndroidUIResourcesPakDescriptor, }; for (size_t i = 0; i < arraysize(extra_pak_keys); ++i) { int pak_fd = base::GlobalDescriptors::GetInstance()->MaybeGet(extra_pak_keys[i]); CHECK(pak_fd != -1); ResourceBundle::GetSharedInstance().AddDataPackFromFile( pak_fd, ui::SCALE_FACTOR_100P); } base::i18n::SetICUDefaultLocale(locale); const std::string loaded_locale = locale; #else const std::string loaded_locale = ResourceBundle::InitSharedInstanceWithLocale(locale, NULL); base::FilePath resources_pack_path; PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); ResourceBundle::GetSharedInstance().AddDataPackFromPath( resources_pack_path, ui::SCALE_FACTOR_NONE); #endif CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale;
More into my investigation it seems that each renderer loads the files freshly from disk (I've changed log in data_pack.cc to FATAL):[10052:10052:0925/140559:ERROR:memory_mapped_file.cc(51)] Couldn't open /usr/local/google/home/phajdan/chromium/src/out/Debug/chrome_100_percent.pak[10052:10052:0925/140559:FATAL:data_pack.cc(78)] Failed to mmap datapack[0x555556b32da0] base::debug::StackTrace::StackTrace()[0x555556b6dd2b] logging::LogMessage::~LogMessage()[0x5555572c54e6] ui::DataPack::LoadFromPath()[0x5555572c9790] ui::ResourceBundle::AddDataPackFromPathInternal()[0x5555572c776b] ui::ResourceBundle::AddDataPackFromPath()[0x5555572cda4c] ui::ResourceBundle::LoadCommonResources()[0x5555572c740d] ui::ResourceBundle::InitSharedInstanceWithLocale()[0x555555d6f4cf] ChromeMainDelegate::PreSandboxStartup()[0x555556b16d48] content::ContentMainRunnerImpl::Initialize()[0x555556b154fe] content::ContentMain()[0x555555d6e09d] ChromeMain[0x555555d6e05c] main[0x7ffff1e3476d] __libc_start_main[0x555555d6df69] <unknown>
Oops, this was with --no-sandbox for debugging, I think that may have bypassed the zygote.Still, I think the code I quoted earlier above pretty clearly loads from disk and not FD / memory.