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

qtwebengine: Couldn't mmap icu data file #104008

Closed
2 tasks done
12101111 opened this issue Jun 19, 2022 · 6 comments
Closed
2 tasks done

qtwebengine: Couldn't mmap icu data file #104008

12101111 opened this issue Jun 19, 2022 · 6 comments
Assignees
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age

Comments

@12101111
Copy link

12101111 commented Jun 19, 2022

brew gist-logs <formula> link OR brew config AND brew doctor output

> brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /Users/han/.cargo/bin/cargo-install-update-config
> brew gist-logs qt
Error: No logs.
> brew config
HOMEBREW_VERSION: 3.5.2-109-g9416032
ORIGIN: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
HEAD: 9416032ee5d253fc00419f111373af54e1c6bc5d
Last commit: 7 hours ago
Core tap ORIGIN: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
Core tap HEAD: 9e9580c34221481f036cd533c6474d6be0b220ad
Core tap last commit: 2 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_BOTTLE_DOMAIN: https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
HOMEBREW_BREW_GIT_REMOTE: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
HOMEBREW_CASK_OPTS: []
HOMEBREW_CORE_GIT_REMOTE: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
HOMEBREW_DISPLAY: :0
HOMEBREW_EDITOR: nvim
HOMEBREW_MAKE_JOBS: 10
HOMEBREW_NO_AUTO_UPDATE: set
Homebrew Ruby: 2.6.8 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 13.1.6 build 1316
Git: 2.32.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.79.1 => /usr/bin/curl
macOS: 12.4-arm64
CLT: 13.4.0.0.1.1651278267
Xcode: 13.4.1
Rosetta 2: false

Verification

  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.

What were you trying to do (and why)?

A simple qtwebengine example:

#include <QApplication>
#include <QWebEngineView>

int main(int argc, char **argv)
{
    QApplication app(argc, argv);
    QWebEngineView view;
    view.load(QUrl("https://www.whatsmyua.info/"));
    view.show();

    return app.exec();
}

CMakeLists.txt:

cmake_minimum_required(VERSION 3.19.0)

project(bug VERSION 1.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt6 6.3 REQUIRED COMPONENTS Core Gui Widgets WebEngineWidgets REQUIRED)

add_executable(${PROJECT_NAME}
    main.cpp
)

target_link_libraries(${PROJECT_NAME} Qt6::Core Qt6::Gui Qt6::WebEngineCore Qt6::WebEngineWidgets Qt6::Widgets

What happened (include all command output)?

> mkdir build && cd build && cmake .. && make
-- The CXX compiler identification is AppleClang 13.1.6.13160021
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/OpenGL.framework
-- Found WrapOpenGL: TRUE
-- Found Cups: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/libcups.tbd (found version "2.3.4")
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/qtwebengine-bug/build
[ 50%] Building CXX object CMakeFiles/bug.dir/main.cpp.o
[100%] Linking CXX executable bug
[100%] Built target bug
> ./bug
qt.webenginecontext:

GL Type: core_profile
Surface Type: OpenGL
Surface Profile: CoreProfile
Surface Version: 4.1
QSG RHI Backend: OpenGL
Using Supported QSG Backend: yes
Using Software Dynamic GL: no
Using Multithreaded OpenGL: yes

Init Parameters:
  *  application-name bug
  *  browser-subprocess-path /opt/homebrew/Cellar/qt/6.3.0/lib/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess
  *  disable-features ConsolidatedMovementXY,InstalledApp,BackgroundFetch,WebOTP,WebPayments,WebUSB,PictureInPicture
  *  disable-speech-api
  *  enable-features NetworkServiceInProcess,TracingServiceInProcess
  *  enable-threaded-compositing
  *  in-process-gpu
  *  use-gl core_profile

[0619/161203.035460:ERROR:icu_util.cc(253)] Couldn't mmap icu data file
zsh: trace trap  ./bug

What did you expect to happen?

A browser window shoud open.

Step-by-step reproduction instructions (by running brew commands)

brew install qt
@12101111 12101111 added the bug Reproducible Homebrew/homebrew-core bug label Jun 19, 2022
@SMillerDev
Copy link
Member

What makes you suspect this is a bug in brew?

@12101111
Copy link
Author

In last update 5eb8463, a new patch is introduced to use "system icu" in qtwebengine:

homebrew-core/Formula/qt.rb

Lines 134 to 139 in 57da4e3

# Apply upstream commit to fix using system icu in chromium.
patch do
url "https://code.qt.io/cgit/qt/qtwebengine-chromium.git/patch/?id=75f0f4eb"
sha256 "ec28b71135f293f624365a50be0c329e396eaa9433655386af146614837e82a2"
directory "qtwebengine/src/3rdparty"
end

-DQT_FEATURE_webengine_system_icu=ON

However, this patch don't work. The qtwebengine binary don't link to icu4c libs provided by homebrew and contains the old bundled icu 69 symbols.

> otool -l /opt/homebrew/Cellar/qt/6.3.0/lib/QtWebEngineCore.framework/Versions/A/QtWebEngineCore | grep icu
> strings /opt/homebrew/Cellar/qt/6.3.0/lib/QtWebEngineCore.framework/Versions/A/QtWebEngineCore | grep icu_
icu_timezone_data
../../../3rdparty/chromium/base/i18n/icu_util.cc
icu_load_collation
N6icu_6917AnyTransliteratorE
@N6icu_6918CalendarAstronomer9AngleFuncE
N6icu_697UMemoryE
N6icu_6916SunTimeAngleFuncE
N6icu_6918CalendarAstronomer9CoordFuncE
N6icu_6916RiseSetCoordFuncE
N6icu_6917MoonTimeAngleFuncE

@cho-m
Copy link
Member

cho-m commented Jun 20, 2022

The formula comments mention:

# On macOS chromium will always use bundled copies and the QT_FEATURE_webengine_system_*
# arguments are ignored.

I would guess the Qt build system doesn't deal well with QT_FEATURE_webengine_system_icu=ON for macOS and may be trying to use unsupported system logic even though it builds with bundled libraries.

To confirm, would need to rebuild with -DQT_FEATURE_webengine_system* args only added to Linux build.

@cho-m cho-m mentioned this issue Jun 20, 2022
6 tasks
@danielnachun danielnachun self-assigned this Jun 20, 2022
@danielnachun
Copy link
Member

This sounds like the likely culprit here. I will update #103963 to make the -DQT_FEATURE_webengine_system arguments Linux-only as it appears they are not harmlessly ignored but somehow exert an effect despite the system dependencies not being linked.

@danielnachun
Copy link
Member

I test your example code and this should now be fixed by #103963. Please feel free to try yourself and close this issue if it's working.

@12101111
Copy link
Author

Yes, it's fixed

@github-actions github-actions bot added the outdated PR was locked due to age label Jul 23, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

4 participants