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

How to run flutter in ky10.aarch64 system #148659

Open
18611429192 opened this issue May 20, 2024 · 8 comments
Open

How to run flutter in ky10.aarch64 system #148659

18611429192 opened this issue May 20, 2024 · 8 comments
Labels
platform-linux Building on or for Linux specifically team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@18611429192
Copy link

Steps to reproduce

  1. git clone https://github.com/flutter/flutter.git -b stable
  2. bin/flutter

AND ANOTHER PROBLEM

  1. git clone https://github.com/flutter/flutter.git
  2. git checkout 3.10.0
  3. rm -rf bin/cache
  4. bin/flutter

Actual results

I want to use Flutter in my environment(Linux version 4.19.90-23.1.v2101.ky10.aarch64 (KYLINSOFT@localhost.localdomain) (gcc version 7.3.0 (GCC)) #1 SMP Mon Feb 1 13:55:38 CST 2021), but occur a error which is related ../../runtime/bin/snapshot_utils.cc.
when I directly fetch flutter.git , and run bin/flutter, I receive

[eng@localhost flutter]$ flutter
Building flutter tool...
../../runtime/bin/snapshot_utils.cc: 154: error: Failed to memory map snapshot: /home/eng/flutter/bin/cache/dart-sdk/bin/snapshots/dartdev.dart.snapshot

version=3.4.0 (stable) (Mon May 6 07:59:58 2024 -0700) on "linux_arm64"
pid=24026, thread=24029, isolate_group=(nil)((nil)), isolate=(nil)((nil))
os=linux, arch=arm64, comp=no, sim=no
isolate_instructions=0, vm_instructions=aaac7874a340
fp=fffcee6ee630, sp=fffcee6ed500, pc=aaac78911788
  pc 0x0000aaac78911788 fp 0x0000fffcee6ee630 dart::Profiler::DumpStackTrace+0x84
-- End of DumpStackTrace
/home/eng/flutter/bin/internal/shared.sh:行 23: 24026 已放弃               (core dumpd)"$DART" pub upgrade --suppress-analytics
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)
 

I tried different version of dart-sdk, I found version 3.1.0 of dart-sdk is ok for my environment, so I switch version to 3.13.0 of flutter and bin/flutter again, then I receive another error about ../../runtime/bin/snapshot_utils.cc:.

[eng@localhost bin]$ ./flutter 
Downloading Linux arm64 Dart SDK from Flutter engine d44b5a94c976fbb65815374f61ab5392a220b084...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  115M  100  115M    0     0  10.7M      0  0:00:10  0:00:10 --:--:-- 11.9M
Building flutter tool...
Resolving dependencies... (4.0s)
Got dependencies.
../../runtime/bin/snapshot_utils.cc: 141: error: Failed to memory map snapshot: /home/eng/flutter/bin/cache/flutter_tools.snapshot


===== CRASH =====
si_signo=Segmentation fault(11), si_code=1, si_addr=0x10
Aborting reentrant request for stack trace.
已放弃 (core dumpd)

Logs

Logs
[eng@localhost flutter]$ flutter
Building flutter tool...
../../runtime/bin/snapshot_utils.cc: 154: error: Failed to memory map snapshot: /home/eng/flutter/bin/cache/dart-sdk/bin/snapshots/dartdev.dart.snapshot

version=3.4.0 (stable) (Mon May 6 07:59:58 2024 -0700) on "linux_arm64"
pid=24026, thread=24029, isolate_group=(nil)((nil)), isolate=(nil)((nil))
os=linux, arch=arm64, comp=no, sim=no
isolate_instructions=0, vm_instructions=aaac7874a340
fp=fffcee6ee630, sp=fffcee6ed500, pc=aaac78911788
  pc 0x0000aaac78911788 fp 0x0000fffcee6ee630 dart::Profiler::DumpStackTrace+0x84
-- End of DumpStackTrace
/home/eng/flutter/bin/internal/shared.sh:行 23: 24026 已放弃               (核心已转储)"$DART" pub upgrade --suppress-analytics
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)
../../runtime/bin/snapshot_utils.cc: 154: error: Failed to memory map snapshot: /home/eng/flutter/bin/cache/dart-sdk/bin/snapshots/dartdev.dart.snapshot

version=3.4.0 (stable) (Mon May 6 07:59:58 2024 -0700) on "linux_arm64"
pid=24036, thread=24039, isolate_group=(nil)((nil)), isolate=(nil)((nil))
os=linux, arch=arm64, comp=no, sim=no
isolate_instructions=0, vm_instructions=aaac79ffa340
fp=ffff5506e630, sp=ffff5506d500, pc=aaac7a1c1788
  pc 0x0000aaac7a1c1788 fp 0x0000ffff5506e630 dart::Profiler::DumpStackTrace+0x84
-- End of DumpStackTrace
/home/eng/flutter/bin/internal/shared.sh:行 23: 24036 已放弃               (核心已转储)"$DART" pub upgrade --suppress-analytics
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (8 tries left)
^C[eng@localhost flutter]$ flutter > ~/flutter.log
Building flutter tool...
../../runtime/bin/snapshot_utils.cc: 154: error: Failed to memory map snapshot: /home/eng/flutter/bin/cache/dart-sdk/bin/snapshots/dartdev.dart.snapshot

version=3.4.0 (stable) (Mon May 6 07:59:58 2024 -0700) on "linux_arm64"
pid=24112, thread=24115, isolate_group=(nil)((nil)), isolate=(nil)((nil))
os=linux, arch=arm64, comp=no, sim=no
isolate_instructions=0, vm_instructions=aaad08baa340
fp=fffeb23ee630, sp=fffeb23ed500, pc=aaad08d71788
  pc 0x0000aaad08d71788 fp 0x0000fffeb23ee630 dart::Profiler::DumpStackTrace+0x84
-- End of DumpStackTrace
/home/eng/flutter/bin/internal/shared.sh:行 23: 24112 已放弃               (核心已转储)"$DART" pub upgrade --suppress-analytics
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)
../../runtime/bin/snapshot_utils.cc: 154: error: Failed to memory map snapshot: /home/eng/flutter/bin/cache/dart-sdk/bin/snapshots/dartdev.dart.snapshot

version=3.4.0 (stable) (Mon May 6 07:59:58 2024 -0700) on "linux_arm64"
pid=24120, thread=24123, isolate_group=(nil)((nil)), isolate=(nil)((nil))
os=linux, arch=arm64, comp=no, sim=no
isolate_instructions=0, vm_instructions=aaacc7eba340
fp=fffbebeee630, sp=fffbebeed500, pc=aaacc8081788
  pc 0x0000aaacc8081788 fp 0x0000fffbebeee630 dart::Profiler::DumpStackTrace+0x84
-- End of DumpStackTrace
/home/eng/flutter/bin/internal/shared.sh:行 23: 24120 已放弃               (核心已转储)"$DART" pub upgrade --suppress-analytics
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (8 tries left)
../../runtime/bin/snapshot_utils.cc: 154: error: Failed to memory map snapshot: /home/eng/flutter/bin/cache/dart-sdk/bin/snapshots/dartdev.dart.snapshot

version=3.4.0 (stable) (Mon May 6 07:59:58 2024 -0700) on "linux_arm64"
pid=24128, thread=24131, isolate_group=(nil)((nil)), isolate=(nil)((nil))
os=linux, arch=arm64, comp=no, sim=no
isolate_instructions=0, vm_instructions=aaaccaaea340
fp=fffe06f3e630, sp=fffe06f3d500, pc=aaaccacb1788
  pc 0x0000aaaccacb1788 fp 0x0000fffe06f3e630 dart::Profiler::DumpStackTrace+0x84
-- End of DumpStackTrace
/home/eng/flutter/bin/internal/shared.sh:行 23: 24128 已放弃               (核心已转储)"$DART" pub upgrade --suppress-analytics
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (7 tries left)
../../runtime/bin/snapshot_utils.cc: 154: error: Failed to memory map snapshot: /home/eng/flutter/bin/cache/dart-sdk/bin/snapshots/dartdev.dart.snapshot

version=3.4.0 (stable) (Mon May 6 07:59:58 2024 -0700) on "linux_arm64"
pid=24136, thread=24139, isolate_group=(nil)((nil)), isolate=(nil)((nil))
os=linux, arch=arm64, comp=no, sim=no
isolate_instructions=0, vm_instructions=aaacabc7a340
fp=ffff486de630, sp=ffff486dd500, pc=aaacabe41788
  pc 0x0000aaacabe41788 fp 0x0000ffff486de630 dart::Profiler::DumpStackTrace+0x84
-- End of DumpStackTrace
/home/eng/flutter/bin/internal/shared.sh:行 23: 24136 已放弃               (核心已转储)"$DART" pub upgrade --suppress-analytics
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (6 tries left)
../../runtime/bin/snapshot_utils.cc: 154: error: Failed to memory map snapshot: /home/eng/flutter/bin/cache/dart-sdk/bin/snapshots/dartdev.dart.snapshot

version=3.4.0 (stable) (Mon May 6 07:59:58 2024 -0700) on "linux_arm64"
pid=24169, thread=24172, isolate_group=(nil)((nil)), isolate=(nil)((nil))
os=linux, arch=arm64, comp=no, sim=no
isolate_instructions=0, vm_instructions=aaaad649a340
fp=fffe0c5be630, sp=fffe0c5bd500, pc=aaaad6661788
  pc 0x0000aaaad6661788 fp 0x0000fffe0c5be630 dart::Profiler::DumpStackTrace+0x84
-- End of DumpStackTrace
/home/eng/flutter/bin/internal/shared.sh:行 23: 24169 已放弃               (核心已转储)"$DART" pub upgrade --suppress-analytics
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (5 tries left)
../../runtime/bin/snapshot_utils.cc: 154: error: Failed to memory map snapshot: /home/eng/flutter/bin/cache/dart-sdk/bin/snapshots/dartdev.dart.snapshot

version=3.4.0 (stable) (Mon May 6 07:59:58 2024 -0700) on "linux_arm64"
pid=24185, thread=24188, isolate_group=(nil)((nil)), isolate=(nil)((nil))
os=linux, arch=arm64, comp=no, sim=no
isolate_instructions=0, vm_instructions=aaac4d5ba340
fp=ffff13a6e630, sp=ffff13a6d500, pc=aaac4d781788
  pc 0x0000aaac4d781788 fp 0x0000ffff13a6e630 dart::Profiler::DumpStackTrace+0x84
-- End of DumpStackTrace
/home/eng/flutter/bin/internal/shared.sh:行 23: 24185 已放弃               (核心已转储)"$DART" pub upgrade --suppress-analytics
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (4 tries left)
../../runtime/bin/snapshot_utils.cc: 154: error: Failed to memory map snapshot: /home/eng/flutter/bin/cache/dart-sdk/bin/snapshots/dartdev.dart.snapshot

version=3.4.0 (stable) (Mon May 6 07:59:58 2024 -0700) on "linux_arm64"
pid=24200, thread=24203, isolate_group=(nil)((nil)), isolate=(nil)((nil))
os=linux, arch=arm64, comp=no, sim=no
isolate_instructions=0, vm_instructions=aaadaa11a340
fp=ffff35aee630, sp=ffff35aed500, pc=aaadaa2e1788
  pc 0x0000aaadaa2e1788 fp 0x0000ffff35aee630 dart::Profiler::DumpStackTrace+0x84
-- End of DumpStackTrace
/home/eng/flutter/bin/internal/shared.sh:行 23: 24200 已放弃               (核心已转储)"$DART" pub upgrade --suppress-analytics
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (3 tries left)
../../runtime/bin/snapshot_utils.cc: 154: error: Failed to memory map snapshot: /home/eng/flutter/bin/cache/dart-sdk/bin/snapshots/dartdev.dart.snapshot

version=3.4.0 (stable) (Mon May 6 07:59:58 2024 -0700) on "linux_arm64"
pid=24217, thread=24220, isolate_group=(nil)((nil)), isolate=(nil)((nil))
os=linux, arch=arm64, comp=no, sim=no
isolate_instructions=0, vm_instructions=aaac525ea340
fp=fffbd3b1e630, sp=fffbd3b1d500, pc=aaac527b1788
  pc 0x0000aaac527b1788 fp 0x0000fffbd3b1e630 dart::Profiler::DumpStackTrace+0x84
-- End of DumpStackTrace
/home/eng/flutter/bin/internal/shared.sh:行 23: 24217 已放弃               (核心已转储)"$DART" pub upgrade --suppress-analytics
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (2 tries left)
../../runtime/bin/snapshot_utils.cc: 154: error: Failed to memory map snapshot: /home/eng/flutter/bin/cache/dart-sdk/bin/snapshots/dartdev.dart.snapshot

version=3.4.0 (stable) (Mon May 6 07:59:58 2024 -0700) on "linux_arm64"
pid=24232, thread=24235, isolate_group=(nil)((nil)), isolate=(nil)((nil))
os=linux, arch=arm64, comp=no, sim=no
isolate_instructions=0, vm_instructions=aaae5211a340
fp=fffcc9eee630, sp=fffcc9eed500, pc=aaae522e1788
  pc 0x0000aaae522e1788 fp 0x0000fffcc9eee630 dart::Profiler::DumpStackTrace+0x84
-- End of DumpStackTrace
/home/eng/flutter/bin/internal/shared.sh:行 23: 24232 已放弃               (核心已转储)"$DART" pub upgrade --suppress-analytics
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (1 tries left)
Command 'pub upgrade' still failed after 10 tries, giving up.

Flutter Doctor output

Doctor output
same as above
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label May 20, 2024
@darshankawar
Copy link
Member

Closing this as duplicate of #90837. Please follow-up in it for further updates.

@darshankawar darshankawar closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2024
@darshankawar darshankawar added r: duplicate Issue is closed as a duplicate of an existing issue and removed in triage Presently being triaged by the triage team labels May 20, 2024
@mraleph
Copy link
Member

mraleph commented May 22, 2024

I don't think it is duplicate of #90837.

I assume that the Linux is running natively and not inside WSL?

cc @rmacnak-google do you have any idea what this can be?

@darshankawar darshankawar reopened this May 22, 2024
@darshankawar darshankawar added in triage Presently being triaged by the triage team platform-linux Building on or for Linux specifically tool Affects the "flutter" command-line tool. See also t: labels. team-tool Owned by Flutter Tool team and removed r: duplicate Issue is closed as a duplicate of an existing issue in triage Presently being triaged by the triage team labels May 22, 2024
@18611429192
Copy link
Author

Yeah, I installed Flutter on a real computer. After that, I reinstalled Centos7 on my real computer but encountered the same error.

But I found Flutter 2.2.3 still works well.

@rmacnak-google
Copy link
Contributor

@18611429192 Can you report the output of strace flutter so we can see what error mmap is giving? The output of getconf PAGESIZE might also be helpful, since the page size can vary for ARM64 systems.

@18611429192
Copy link
Author

When I run the newest stable of flutter I encountered a dart memory map error, the result of strace bin/flutter is flutter_stable_map_error.log.

Then I switch to flutter 3.13.0, run strace bin/flutter, I got this log flutter3.13.0_map_error.log

My computer's result of getconf PAGESIZE is 65536.

I hope that can be useful.

@18611429192
Copy link
Author

I switch to 3.3.10 of flutter, it works well. But I still want to use the newest version of flutter. I found that the PAGESIZE of the devices near me that can run the latest version of flutter are all 4096. I don't know if it has something to do with PAGESIZE, but this is what I saw. @rmacnak-google

[eng@bogon bundle]$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel unknown, 3.3.10, on AlmaLinux 8.9 (Midnight Oncilla)
    4.18.0-513.5.1.el8_9.aarch64, locale en_US.UTF-8)
    ! Flutter version 3.3.10 on channel unknown at /home/eng/flutter
    ! Upstream repository unknown
[✗] Chrome - develop for the web (Cannot find Chrome executable at
    google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop
[!] Flutter IDE Support (No supported IDEs installed)
[!] Proxy Configuration
    ! NO_PROXY does not contain 127.0.0.1
[✓] Connected device (1 available)
[✓] HTTP Host Availability

! Doctor found issues in 4 categories.
[eng@bogon bundle]$ flutter --version
Flutter 3.3.10 • channel unknown • unknown source
Framework • revision 135454af32 (1 year, 5 months ago) • 2022-12-15 07:36:55
-0800
Engine • revision 3316dd8728
Tools • Dart 2.18.6 • DevTools 2.15.0

@rmacnak-google
Copy link
Contributor

openat(AT_FDCWD, ".../flutter/bin/cache/flutter_tools.snapshot", O_RDONLY|O_CLOEXEC) = 3
...
mmap(NULL, 31146368, PROT_READ, MAP_PRIVATE, 3, 0x4000) = -1 EINVAL (Invalid argument)

Great, that helps at lot. We're trying to map at a 16k aligned position, but the page size is 64k.

copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue May 29, 2024
Linux ARM64 may have a page size of 4k, 16k, or 64k.

Cf. 935b69e.

TEST=no 64k device available
Bug: flutter/flutter#148659
Change-Id: I1894db74bc61719f7deb2537bc3ff17168644ed1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368525
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
@18611429192
Copy link
Author

I will try it later.
If it works, I will close this issue.
Thanks lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-linux Building on or for Linux specifically team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests

4 participants