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

Discovery of the "icudtl.dat" file fails on Linux. Merge patch into upstream. #231

Open
cztomczak opened this issue Jun 25, 2016 · 9 comments

Comments

@cztomczak
Copy link
Owner

cztomczak commented Jun 25, 2016

Tried running pygtk_.py and wxpython.py both fail. Stack trace:

#0  0x00007ffff68e1035 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff68e479b in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007ffff180eab2 in base::debug::BreakDebugger() ()
   from /home/czarek/github/cefpython/src/linux/binaries_64bit/libcef.so
#3  0x00007ffff43ceeec in content::ContentMainRunnerImpl::Initialize(content::ContentMainParams const&) ()
   from /home/czarek/github/cefpython/src/linux/binaries_64bit/libcef.so
#4  0x00007ffff173a62f in CefContext::Initialize(CefMainArgs const&, CefStructBase<CefSettingsTraits> const&, CefRefPtr<CefApp>, void*) () from /home/czarek/github/cefpython/src/linux/binaries_64bit/libcef.so
#5  0x00007ffff173a48b in CefInitialize(CefMainArgs const&, CefStructBase<CefSettingsTraits> const&, CefRefPtr<CefApp>, void*) () from /home/czarek/github/cefpython/src/linux/binaries_64bit/libcef.so
#6  0x00007ffff16e7c88 in cef_initialize ()
   from /home/czarek/github/cefpython/src/linux/binaries_64bit/libcef.so
#7  0x00007fffe85b82b3 in CefInitialize(CefMainArgs const&, CefStructBase<CefSettingsTraits> const&, CefRefPtr<CefApp>, void*) () from /home/czarek/github/cefpython/src/linux/binaries_64bit/cefpython_py27.so
...

cefclient and cefsimple do run fine however. Looks like it might be an issue with CHECK failing because it can't find the "icudtl.dat" resource. If file "icudtl.dat" is removed then cefclient also fails with the same stack trace.

cefpython logs:

[CEF Python] Initialize() called
[CEF Python] CefExecuteProcess(): exitCode = -1
[CEF Python] CefInitialize()
[CEF Python] App_OnBeforeCommandLineProcessing_BrowserProcess()
[CEF Python] Command line string for the browser process:  --browser-subprocess-path=/home/czarek/github/cefpython/src/linux/binaries_64bit/subprocess --no-sandbox --lang=en-US --log-file=/home/czarek/github/cefpython/src/linux/binaries_64bit/debug.log --log-severity=info --resources-dir-path=/home/czarek/github/cefpython/src/linux/binaries_64bit --locales-dir-path=/home/czarek/github/cefpython/src/linux/binaries_64bit/locales --remote-debugging-port=50900

Program received signal SIGABRT, Aborted.

New error message, more descriptive in CEF 51:

[0626/190605:ERROR:icu_util.cc(183)] Invalid file descriptor to ICU data received.
@cztomczak cztomczak changed the title CefInitialize fails in CEF Python 47 on Linux Discovery of the "icudtl.dat" file fails Jun 26, 2016
@cztomczak
Copy link
Owner Author

cztomczak commented Jun 26, 2016

Same error happens with CEF 51 and the message is more descriptive this time. It's definitely an issue with the icudtl.dat file. Reported with details on the CEF Forum:

http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=14271

cztomczak added a commit that referenced this issue Jun 26, 2016
It builds fine, but there is an error when running (Issue #231).

Use prebuilt binaries from Spotify automated builds.

Changes in API that break backward compatibility:
* Remove 'accept_lang' arg in JavascriptDialogHandler.OnJavascriptDialog()
* Remove LifespanHandler.RunModal()

Other changes in API:
* Add Browser.TryCloseBrowser()
@cztomczak
Copy link
Owner Author

cztomczak commented Jun 27, 2016

Temporary fix for the issue:

sudo cp icudtl.dat /usr/bin
sudo cp natives_blob.bin /usr/bin

The pygtk_.py example runs fine with this fix.

@cztomczak
Copy link
Owner Author

cztomczak commented Jun 27, 2016

Related code in Chromium that causes issues:

  • In base/i18n/icu_util.cc: bool path_ok = PathService::Get(DIR_EXE, &data_path);
  • In gin/v8_initializer: PathService::Get(base::DIR_EXE, &data_path); - to load "natives_blob.bin" which also causes issue

PathService keys like DIR_EXE, DIR_MODULE etc. can be overriden using PathService::Override, see base/path_service.h:
https://cs.chromium.org/chromium/src/base/path_service.h?cl=GROK&gsn=PathService&l=47

CEF already exposes CefGetPath() function to fetch paths using PathKey:
https://bitbucket.org/chromiumembedded/cef/src/05ee60b7b4704f5e763b65d2a1fbea83815b34ac/libcef/browser/path_util_impl.cc?at=master

Here are the values for some of the path keys when running cefpython:

[CEF Python] ---- PK_DIR_EXE: /usr/bin
[CEF Python] ---- PK_DIR_MODULE: /usr/bin
[CEF Python] ---- PK_DIR_CURRENT: /home/czarek/github/cefpython/src/linux/binaries_64bit
[CEF Python] ---- PK_FILE_EXE: /usr/bin/python2.7
[CEF Python] ---- PK_FILE_MODULE: /usr/bin/python2.7

When changing DIR_EXE we should probably also change DIR_MODULE to the same value. The question is what will be implications of overriding these paths. What would be better?
a) to create a patch for CEF to expose a new function CefOverridePath in path_util.impl.cc and then override DIR_EXE and DIR_MODULE paths before calling CefInitialize
b) or maybe just modify those two lines of code in Chromium and replace DIR_EXE with DIR_CURRENT

Note also the warning in path_service.h > Override:

// WARNING: Consumers of PathService::Get may expect paths to be constant
// over the lifetime of the app, so this method should be used with caution.

So when overriding path it should be done as early as possible.

In "chrome/test/base/chrome_test_suite.cc" there is already a case for overrriding DIR_EXE and DIR_MODULE, so it should work fine:

  if (!browser_dir_.empty()) {
    PathService::Override(base::DIR_EXE, browser_dir_);
    PathService::Override(base::DIR_MODULE, browser_dir_);
  }

@cztomczak cztomczak added this to the Chrome 51 milestone Jun 28, 2016
@cztomczak cztomczak changed the title Discovery of the "icudtl.dat" file fails Discovery of the "icudtl.dat" file fails on Linux Jun 28, 2016
@cztomczak cztomczak changed the title Discovery of the "icudtl.dat" file fails on Linux Discovery of the "icudtl.dat" file fails Jun 28, 2016
@cztomczak cztomczak removed the linux label Jun 28, 2016
@cztomczak
Copy link
Owner Author

Fixed in commit 2e9928d. New issue231 patch added to patches/.

@cztomczak cztomczak changed the title Discovery of the "icudtl.dat" file fails Discovery of the "icudtl.dat" file fails on Linux Sep 8, 2016
@cztomczak cztomczak changed the title Discovery of the "icudtl.dat" file fails on Linux Discovery of the "icudtl.dat" file fails on Linux. Merge patch into upstream. Nov 2, 2016
@cztomczak
Copy link
Owner Author

Merge issue231 patch into upstream to allow for using Spotify binaries with cefpython. Pull request was already created some time ago with a reworked version of the patch that was to be accepted, but there was an issue with unit tests. The patch required another rework. See upstream Pull request #66 and upstream Issue #1936.

@cztomczak cztomczak reopened this Nov 2, 2016
cztomczak added a commit that referenced this issue Feb 17, 2017
There is still issue with building vcproj files to be resolved.

Currently supported on Windows is only Python 2.7 32-bit.

Remove patch deps on Windows and Mac platforms to facilitate building (#300,
#231, #251).

Create tools/build.py and tools/build_module.py (#210). Cleanup in directories
due to new build tools.

Update tools/automate.py.

DragData methods become Linux-only: GetImage(), HasImage(). This functionality
will be available on all platforms when patch is merged into upstream (#251).
@cztomczak cztomczak modified the milestones: v51, Chrome 50+ Feb 24, 2017
@cztomczak
Copy link
Owner Author

Alternative pull request for CEF on GitHub:
chromiumembedded/cef#4

ClarkWang-2013 added a commit to ClarkWang-2013/cef that referenced this issue Aug 29, 2017
deepin-gerrit pushed a commit to martyr-deepin/qcef-chromium that referenced this issue Mar 6, 2018
Project: cef dev-3112 48f0926c60c854604d1d5a92ac46d6307514ae37

Remove unused gn argument


Merge branch 'dev-3112' of github.com:LiuLang/cef into dev-3112


Support atomic operation on mips64el


Add more gn arguments


Support overriding paths

Merge patch from chromiumembedded/cef#4
Issue link is cztomczak/cefpython#231


Disable kerberos


Add more gn options


Support IME on linux


Added default gn args for linux platform


Windows: Fix crash during window creation (see https://crbug.com/761389)


Windows: Wait for WM_NCDESTROY before calling OnBeforeClose (issue #2248)


Update to Chromium version 60.0.3112.113


Windows: Fix crash during window creation (see https://crbug.com/761389)


Windows: Wait for WM_NCDESTROY before calling OnBeforeClose (issue #2248)


Support atomic operation on mips64el


Add more gn arguments


Update to Chromium version 60.0.3112.113


Support overriding paths

Merge patch from chromiumembedded/cef#4
Issue link is cztomczak/cefpython#231


Disable kerberos


Add more gn options


Support IME on linux


Added default gn args for linux platform


Fix Widevine DRM loading


Update to Chromium version 60.0.3112.90


views: Fix LabelButton size calculation


Linux: Work around gold linker bug for 32-bit code.


Fix encoding of linux_build.patch


Fix encoding of linux_build.patch


Linux: Fix build error related to GTK dependency version.


Update to Chromium version 60.0.3112.78


Linux/Mac: Fix handling of command-line arguments (issue #2208)


Windows: Build cef_sandbox.lib with different GN args for official binary distributions (issue #2220)


Add support for loading certificate revocation lists (issue #2213)


Fix incorrect OSR browser display during navigation (issue #2209)


Fix OSR PDF mouse events after keyboard input (issue #2078)


Update to Chromium version 60.0.3112.40


Fix OSR PDF mouse wheel scrolling (issue #2078)


Windows: cefclient: Fix ATL-related build errors (issue #2200)


Linux: Don't pass NULL CefBrowser to PrintHandler::GetPdfPaperSize (issue #2199)


Linux: Pass CefBrowser to CefPrintHandler callbacks (issue #2196)


Fix gtest path (issue #2188)


macOS: Fix error: unknown type name 'size_t'


Linux: Update to debian jessie sysroots


Linux: Fix error: use of undeclared identifier 'GetPreferredSize'


Update to Chromium version 60.0.3112.10
@cztomczak cztomczak modified the milestones: v51, v66 May 22, 2018
cztomczak added a commit that referenced this issue Jun 12, 2018
PK_DIR_RESOURCES should not be included in CefOverridePath patch
(Issue #231), since there is already a way to set resources dir
path using CefSettings.resources_dir_path.
@cztomczak cztomczak removed this from the v66 milestone Aug 20, 2018
@cztomczak
Copy link
Owner Author

Fixed in upstream in commit https://bitbucket.org/chromiumembedded/cef/commits/602c163 - needs testing.

@cztomczak
Copy link
Owner Author

Another related commit in upstream: https://bitbucket.org/chromiumembedded/cef/commits/942899d2fc3d

Both required commits are available in the latest 3945 branch (v79). This will allow to use Spotify binaries with cefpython on Linux.

@IoIxD
Copy link

IoIxD commented Sep 5, 2024

Hi, I'm actually using CEF with C++ and I found this due to my own build error I'm having.

How did you end up solving this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants