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

Crash si_signo=Illegal instruction(4) when running dart run build_runner build with dart-musl image on StarFive Visionfive 2 RISC-V board #56671

Open
cpswan opened this issue Sep 9, 2024 · 7 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. P3 A lower priority bug or feature request triaged Issue has been triaged by sub team type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@cpswan
Copy link
Contributor

cpswan commented Sep 9, 2024

  • Dart version: Dart SDK version: 3.5.2 (stable) (Wed Aug 28 10:01:20 2024 +0000) on "linux_riscv64"
    • I confirmed with @athomas that riscv64 is correctly in the stable channel from 3.3.0
  • Linux
    • Ubuntu 24.04.1 LTS
    • StarFive VisionFive 2 rev 1.3b
  • No browser

Whilst running dart run build_runner build on RISC-V (using the dart-musl image):

===== CRASH =====
si_signo=Illegal instruction(4), si_code=ILL_ILLOPC(1), si_addr=0x34d22439c6
version=3.5.2 (stable) (Wed Aug 28 10:01:20 2024 +0000) on "linux_riscv64"
pid=83, thread=90, isolate_group=dartdev(0x34d80de010), isolate=dartdev(0x34d80df800)
os=linux, arch=riscv64, comp=no, sim=no
isolate_instructions=34d4cf6000, vm_instructions=34f4be8100
fp=34d287aff0, sp=34d287af88, pc=34d22439c6
  pc 0x00000034d22439c6 fp 0x00000034d287aff0 [Optimized] _JsonStringParser@10003594.get:isUtf16Input+0x6
  pc 0x00000034d223e4ba fp 0x00000034d287b038 [Unoptimized] _parseJson@10003594+0x13a
  pc 0x00000034d223e30a fp 0x00000034d287b078 [Unoptimized] JsonDecoder.convert+0x17a
  pc 0x00000034d223e0d4 fp 0x00000034d287b0e0 [Unoptimized] JsonCodec.decode+0x354
  pc 0x00000034d223da0a fp 0x00000034d287b150 [Unoptimized] Entrypoint._loadPackageConfig@74245003+0x37a
  pc 0x00000034d223d294 fp 0x00000034d287b180 [Unoptimized] Entrypoint.ensureUpToDate.isResolutionUpToDate.#packageConfig#initializer+0xc4
  pc 0x00000034d222bb08 fp 0x00000034d287b298 [Unoptimized] Entrypoint.ensureUpToDate.isResolutionUpToDate+0x15a8
  pc 0x00000034d2229d54 fp 0x00000034d287b368 [Unoptimized] Entrypoint.ensureUpToDate+0x644
  pc 0x00000034d2225382 fp 0x00000034d287b470 [Unoptimized] getExecutableForCommand+0x9f2
  pc 0x00000034d29ecd92 fp 0x00000034d287b548 [Unoptimized] RunCommand.run+0x7f2
  pc 0x00000034d4d5ec92 fp 0x00000034d287b598 [Unoptimized] _SuspendState@4048458._createAsyncCallbacks@4048458.thenCallback+0x92
  pc 0x00000034d4d17bb0 fp 0x00000034d287b5f0 [Unoptimized] _RootZone@4048458.runUnary+0x140
  pc 0x00000034d29f937a fp 0x00000034d287b640 [Unoptimized] _FutureListener@4048458.handleValue+0x1ca
  pc 0x00000034d29f9048 fp 0x00000034d287b6a0 [Unoptimized] _Future@4048458._propagateToListeners@4048458.handleValueCallback+0xa8
  pc 0x00000034d4d0d842 fp 0x00000034d287b720 [Unoptimized] _Future@4048458._propagateToListeners@4048458+0xba2
  pc 0x00000034d4d0f592 fp 0x00000034d287b768 [Unoptimized] _Future@4048458._completeWithValue@4048458+0x1b2
  pc 0x00000034d4d5ee50 fp 0x00000034d287b7b0 [Unoptimized] _SuspendState@4048458._returnAsync@4048458+0x180
  pc 0x00000034d8108cba fp 0x00000034d287b7e0 [Stub] ReturnAsync+0x4a
  pc 0x00000034d4d5ec92 fp 0x00000034d287b830 [Unoptimized] _SuspendState@4048458._createAsyncCallbacks@4048458.thenCallback+0x92
  pc 0x00000034d4d17bb0 fp 0x00000034d287b888 [Unoptimized] _RootZone@4048458.runUnary+0x140
  pc 0x00000034d29f937a fp 0x00000034d287b8d8 [Unoptimized] _FutureListener@4048458.handleValue+0x1ca
  pc 0x00000034d29f9048 fp 0x00000034d287b938 [Unoptimized] _Future@4048458._propagateToListeners@4048458.handleValueCallback+0xa8
  pc 0x00000034d4d0d842 fp 0x00000034d287b9b8 [Unoptimized] _Future@4048458._propagateToListeners@4048458+0xba2
  pc 0x00000034d4d0f592 fp 0x00000034d287ba00 [Unoptimized] _Future@4048458._completeWithValue@4048458+0x1b2
  pc 0x00000034d4d5ee50 fp 0x00000034d287ba48 [Unoptimized] _SuspendState@4048458._returnAsync@4048458+0x180
  pc 0x00000034d8108cba fp 0x00000034d287ba78 [Stub] ReturnAsync+0x4a
  pc 0x00000034d4d5ec92 fp 0x00000034d287bac8 [Unoptimized] _SuspendState@4048458._createAsyncCallbacks@4048458.thenCallback+0x92
  pc 0x00000034d4d17bb0 fp 0x00000034d287bb20 [Unoptimized] _RootZone@4048458.runUnary+0x140
  pc 0x00000034d29f937a fp 0x00000034d287bb70 [Unoptimized] _FutureListener@4048458.handleValue+0x1ca
  pc 0x00000034d29f9048 fp 0x00000034d287bbd0 [Unoptimized] _Future@4048458._propagateToListeners@4048458.handleValueCallback+0xa8
  pc 0x00000034d4d0d842 fp 0x00000034d287bc50 [Unoptimized] _Future@4048458._propagateToListeners@4048458+0xba2
  pc 0x00000034d4d0f592 fp 0x00000034d287bc98 [Unoptimized] _Future@4048458._completeWithValue@4048458+0x1b2
  pc 0x00000034d4d5ee50 fp 0x00000034d287bce0 [Unoptimized] _SuspendState@4048458._returnAsync@4048458+0x180
  pc 0x00000034d8108cba fp 0x00000034d287bd10 [Stub] ReturnAsync+0x4a
  pc 0x00000034d4d5ec92 fp 0x00000034d287bd60 [Unoptimized] _SuspendState@4048458._createAsyncCallbacks@4048458.thenCallback+0x92
  pc 0x00000034d4d17bb0 fp 0x00000034d287bdb8 [Unoptimized] _RootZone@4048458.runUnary+0x140
  pc 0x00000034d29f937a fp 0x00000034d287be08 [Unoptimized] _FutureListener@4048458.handleValue+0x1ca
  pc 0x00000034d29f9048 fp 0x00000034d287be68 [Unoptimized] _Future@4048458._propagateToListeners@4048458.handleValueCallback+0xa8
  pc 0x00000034d4d0d842 fp 0x00000034d287bee8 [Unoptimized] _Future@4048458._propagateToListeners@4048458+0xba2
  pc 0x00000034d4d0f592 fp 0x00000034d287bf30 [Unoptimized] _Future@4048458._completeWithValue@4048458+0x1b2
  pc 0x00000034d29f76ac fp 0x00000034d287bf70 [Unoptimized] _Future@4048458._asyncCompleteWithValue@4048458.<anonymous closure>+0x8c
  pc 0x00000034d4d176ee fp 0x00000034d287bfb8 [Unoptimized] _microtaskLoop@4048458+0x1ce
  pc 0x00000034d4d17824 fp 0x00000034d287bff8 [Unoptimized] _startMicrotaskLoop@4048458+0x94
  pc 0x00000034d4d17a3a fp 0x00000034d287c020 [Unoptimized] _startMicrotaskLoop@4048458+0x6a
  pc 0x00000034d4d5df3c fp 0x00000034d287c060 [Unoptimized] _runPendingImmediateCallback@1026248+0xec
  pc 0x00000034d4d60416 fp 0x00000034d287c0a0 [Unoptimized] _RawReceivePort@1026248._handleMessage@1026248+0x176
  pc 0x00000034d81030ac fp 0x00000034d287c1a0 [Stub] InvokeDartCode+0xac
  pc 0x00000034f4cecd24 fp 0x00000034d287c210 /usr/lib/dart/bin/dart+0x220ad24
  pc 0x00000034f4cee318 fp 0x00000034d287c250 /usr/lib/dart/bin/dart+0x220c318
  pc 0x00000034f4d09944 fp 0x00000034d287c800 /usr/lib/dart/bin/dart+0x2227944
  pc 0x00000034f4d2aef0 fp 0x00000034d287c8a0 /usr/lib/dart/bin/dart+0x2248ef0
  pc 0x00000034f4d2b310 fp 0x00000034d287c900 /usr/lib/dart/bin/dart+0x2249310
  pc 0x00000034f4e17128 fp 0x00000034d287c9a0 /usr/lib/dart/bin/dart+0x2335128
  pc 0x00000034f4e17370 fp 0x00000034d287c9d0 /usr/lib/dart/bin/dart+0x2335370
  pc 0x00000034f4da8c6a fp 0x00000034d287caa0 /usr/lib/dart/bin/dart+0x22c6c6a
  pc 0x00000034d88f55ea fp 0x00000034d287cad0 /lib/ld-musl-riscv64.so.1+0x515ea
-- End of DumpStackTrace
Aborted (core dumped)

The command sequence that led to that was:

sudo docker run -it ghcr.io/dart-musl/dart:3.5.2 /bin/ash
apk add git
git clone https://github.com/atsign-foundation/noports
cd noports/packages/dart/sshnoports/
dart pub get --enforce-lockfile
dart run build_runner build --delete-conflicting-outputs

The same sequence (and more) runs just fine on x64.

@dart-github-bot
Copy link
Collaborator

Summary: The user is experiencing a crash with the error "Illegal instruction(4)" when running dart run build_runner build on a StarFive VisionFive 2 RISC-V board using the dart-musl image. The crash occurs during JSON decoding, potentially indicating an issue with the RISC-V architecture support in the Dart runtime.

@dart-github-bot dart-github-bot added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Sep 9, 2024
@rmacnak-google
Copy link
Contributor

The build command works for me on Debian RISCV64 with the official build.

I'm not able to run the musl version on my RV device because of some docker network issue. Can you run this under gdb and disassemble around the bad address?

gdb --args dart run build_runner build --delete-conflicting-outputs
(gdb) run
...
si_signo=Illegal instruction(4), si_code=ILL_ILLOPC(1), si_addr=0x34d22439c6
...
(gdb) disassemble 0x00000034d22439b0,+100

Or run with the VM's disassembler and search backwords for the address?

dart --disassemble --isolate-log-filter=dartdev run build_runner build --delete-conflicting-outputs

@lrhn lrhn removed the triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. label Sep 9, 2024
@cpswan
Copy link
Contributor Author

cpswan commented Sep 10, 2024

@rmacnak-google here's the output from (gdb) run:

Starting program: /usr/lib/dart/bin/dart run build_runner build --delete-conflicting-outputs
warning: Error disabling address space randomization: Operation not permitted
[New LWP 125]
[New LWP 126]
[New LWP 127]
[New LWP 128]
[New LWP 129]
[New LWP 130]
[New LWP 131]
[LWP 131 exited]
[LWP 127 exited]
[New LWP 132]

Thread 9 "DartWorker" received signal SIGILL, Illegal instruction.
[Switching to LWP 132]
0x0000003ed2bd9e36 in ?? ()

Then (gdb) disassemble 0x0000003ed2bd9e36,+100:

Dump of assembler code from 0x3ed2bd9e36 to 0x3ed2bd9e9a:
=> 0x0000003ed2bd9e36:  ld      a3,23(s5)
   0x0000003ed2bd9e3a:  li      a1,59
   0x0000003ed2bd9e3e:  andi    a4,a0,1
   0x0000003ed2bd9e42:  beqz    a4,0x3ed2bd9e4a
   0x0000003ed2bd9e44:  lwu     a1,-1(a0)
   0x0000003ed2bd9e48:  srli    a1,a1,0xc
   0x0000003ed2bd9e4a:  slli    a1,a1,0x1
   0x0000003ed2bd9e4c:  bne     a3,a1,0x3ed2bd9e30
   0x0000003ed2bd9e50:  ld      a3,31(s5)
   0x0000003ed2bd9e54:  addi    a3,a3,2
   0x0000003ed2bd9e56:  sd      a3,31(s5)
   0x0000003ed2bd9e5a:  li      s4,0
   0x0000003ed2bd9e5c:  addi    sp,sp,-32
   0x0000003ed2bd9e5e:  sd      ra,24(sp)
   0x0000003ed2bd9e60:  sd      s0,16(sp)
   0x0000003ed2bd9e62:  sd      a2,8(sp)
   0x0000003ed2bd9e64:  addi    a5,a5,1
   0x0000003ed2bd9e66:  sd      a5,0(sp)
   0x0000003ed2bd9e68:  addi    s0,sp,32
   0x0000003ed2bd9e6a:  ld      a5,39(a2)
   0x0000003ed2bd9e6e:  addi    a5,a5,-1
   0x0000003ed2bd9e70:  ld      a1,32(sp)
   0x0000003ed2bd9e72:  andi    a4,a1,1
   0x0000003ed2bd9e76:  beqz    a4,0x3ed2bd9ec6
   0x0000003ed2bd9e7a:  lwu     a2,-1(a1)
   0x0000003ed2bd9e7e:  srli    a2,a2,0xc
   0x0000003ed2bd9e80:  li      a4,1292
   0x0000003ed2bd9e84:  bne     a2,a4,0x3ed2bd9ec6
--Type <RET> for more, q to quit, c to continue without paging--c
   0x0000003ed2bd9e88:  ld      a2,31(a1)
   0x0000003ed2bd9e8c:  ld      a6,23(a1)
   0x0000003ed2bd9e90:  sub     a7,a2,a6
   0x0000003ed2bd9e94:  slti    a3,a6,0
   0x0000003ed2bd9e98:  slt     a4,a2,a7
End of assembler dump.

@cpswan
Copy link
Contributor Author

cpswan commented Sep 10, 2024

For completeness I tried the same sequence on my Ubuntu (and hence glibc) based build image and that also crashes (in this case at dart pub get):

Resolving dependencies... (11.1s)
===== CRASH =====
si_signo=Segmentation fault(11), si_code=SEGV_MAPERR(1), si_addr=0x6a
version=3.5.2 (stable) (Wed Aug 28 10:01:20 2024 +0000) on "linux_riscv64"
pid=24, thread=31, isolate_group=dartdev(0x3308000d20), isolate=dartdev(0x3308008d30)
os=linux, arch=riscv64, comp=no, sim=no
isolate_instructions=355d8296c0, vm_instructions=355d8296c0
fp=3310e7d240, sp=3310e7d1b0, pc=32ece988e0
  pc 0x00000032ece988e0 fp 0x0000003310e7d240 [Stub] Type Test Type: List<PackageId?>+0x0
  pc 0x00000032ece8ccce fp 0x0000003310e7d2c0 [Optimized] _Future@4048458._propagateToListeners@4048458.handleValueCallback+0x8e
  pc 0x0000003306a6c354 fp 0x0000003310e7d328 [Optimized] _Future@4048458._propagateToListeners@4048458+0x244
  pc 0x0000003306a72de0 fp 0x0000003310e7d370 [Optimized] _Future@4048458._completeWithValue@4048458+0x130
  pc 0x0000003307331870 fp 0x0000003310e7d3e8 [Unoptimized] Future.wait.<anonymous closure>+0x3f0
  pc 0x00000032ece8ce82 fp 0x0000003310e7d480 [Optimized] _rootRunUnary@4048458+0xa2
  pc 0x00000032ece8a29a fp 0x0000003310e7d4d8 [Optimized] _rootRunUnary@4048458+0x6a
  pc 0x0000003306a74590 fp 0x0000003310e7d568 [Optimized] _FutureListener@4048458.handleValue+0x170
  pc 0x00000032ece8ccce fp 0x0000003310e7d5e8 [Optimized] _Future@4048458._propagateToListeners@4048458.handleValueCallback+0x8e
  pc 0x0000003306a6c354 fp 0x0000003310e7d650 [Optimized] _Future@4048458._propagateToListeners@4048458+0x244
  pc 0x00000032ece8b0f0 fp 0x0000003310e7d690 [Optimized] _SuspendState@4048458._returnAsync@4048458+0x170
  pc 0x0000003319d08cba fp 0x0000003310e7d6c0 [Stub] ReturnAsync+0x4a
  pc 0x00000032ece9480c fp 0x0000003310e7d708 [Optimized] _SuspendState@4048458._createAsyncCallbacks@4048458.thenCallback+0x3c
  pc 0x00000032ece8ce82 fp 0x0000003310e7d7a0 [Optimized] _rootRunUnary@4048458+0xa2
  pc 0x00000032ece8a29a fp 0x0000003310e7d7f8 [Optimized] _rootRunUnary@4048458+0x6a
  pc 0x0000003306a74590 fp 0x0000003310e7d888 [Optimized] _FutureListener@4048458.handleValue+0x170
  pc 0x00000032ece8ccce fp 0x0000003310e7d908 [Optimized] _Future@4048458._propagateToListeners@4048458.handleValueCallback+0x8e
  pc 0x0000003306a6c354 fp 0x0000003310e7d970 [Optimized] _Future@4048458._propagateToListeners@4048458+0x244
  pc 0x00000032ece8b0f0 fp 0x0000003310e7d9b0 [Optimized] _SuspendState@4048458._returnAsync@4048458+0x170
  pc 0x0000003319d08cba fp 0x0000003310e7d9e0 [Stub] ReturnAsync+0x4a
  pc 0x00000032ece9480c fp 0x0000003310e7da28 [Optimized] _SuspendState@4048458._createAsyncCallbacks@4048458.thenCallback+0x3c
  pc 0x00000032ece8ce82 fp 0x0000003310e7dac0 [Optimized] _rootRunUnary@4048458+0xa2
  pc 0x00000032ece8a29a fp 0x0000003310e7db18 [Optimized] _rootRunUnary@4048458+0x6a
  pc 0x0000003307d58066 fp 0x0000003310e7dbb0 [Unoptimized] _CustomZone@4048458.runUnary+0x1a6
  pc 0x0000003307330886 fp 0x0000003310e7dc00 [Unoptimized] _SuspendState@4048458._awaitCompletedFuture@4048458.run+0xc6
  pc 0x00000032ece8b320 fp 0x0000003310e7dc90 [Optimized] _rootRun@4048458+0xc0
  pc 0x00000032ece93dd4 fp 0x0000003310e7dce0 [Optimized] _rootRun@4048458+0x64
  pc 0x00000032ece91114 fp 0x0000003310e7dd90 [Optimized] _CustomZone@4048458.runGuarded+0xf4
  pc 0x000000330733060c fp 0x0000003310e7ddd0 [Unoptimized] _CustomZone@4048458.bindCallbackGuarded.<anonymous closure>+0x8c
  pc 0x00000033073302ce fp 0x0000003310e7de18 [Unoptimized] _microtaskLoop@4048458+0x1ce
  pc 0x000000330732ff54 fp 0x0000003310e7de58 [Unoptimized] _startMicrotaskLoop@4048458+0x94
  pc 0x000000330732fe8a fp 0x0000003310e7de80 [Unoptimized] _startMicrotaskLoop@4048458+0x6a
  pc 0x000000330732fdac fp 0x0000003310e7dec0 [Unoptimized] _runPendingImmediateCallback@1026248+0xec
  pc 0x0000003318aa1626 fp 0x0000003310e7df00 [Unoptimized] _RawReceivePort@1026248._handleMessage@1026248+0x176
  pc 0x0000003319d030ac fp 0x0000003310e7e000 [Stub] InvokeDartCode+0xac
  pc 0x000000355d9160f4 fp 0x0000003310e7e070 dart::DartEntry::InvokeFunction+0x13e
  pc 0x000000355d917572 fp 0x0000003310e7e0b0 dart::DartLibraryCalls::HandleMessage+0xd8
  pc 0x000000355d92fe2e fp 0x0000003310e7e650 dart::IsolateMessageHandler::HandleMessage+0x1da
  pc 0x000000355d94d99e fp 0x0000003310e7e6c0 dart::MessageHandler::HandleMessages+0xd6
  pc 0x000000355d94dcda fp 0x0000003310e7e710 dart::MessageHandler::TaskCallback+0x17e
  pc 0x000000355da23090 fp 0x0000003310e7e7b0 dart::ThreadPool::WorkerLoop+0x106
  pc 0x000000355da2329e fp 0x0000003310e7e7e0 dart::ThreadPool::Worker::Main+0x5a
  pc 0x000000355d9bf082 fp 0x0000003310e7e8a0 dart::ThreadStart+0xcc
  pc 0x000000331a5650f4 fp 0x0000003310e7ea30 /lib/riscv64-linux-gnu/libc.so.6+0x710f4
-- End of DumpStackTrace
Aborted (core dumped)

Following a similar process with gdb:

gdb --args dart pub get --enforce-lockfile
...
(gdb) run
Starting program: /usr/lib/dart/bin/dart pub get --enforce-lockfile
warning: Error disabling address space randomization: Operation not permitted
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/riscv64-linux-gnu/libthread_db.so.1".
[New Thread 0x38b9413180 (LWP 605)]
[New Thread 0x38b8d6f180 (LWP 606)]
[New Thread 0x38b8c6e180 (LWP 607)]
[New Thread 0x38b197f180 (LWP 608)]
[New Thread 0x38b177f180 (LWP 609)]
[New Thread 0x38b13ff180 (LWP 610)]
[New Thread 0x38abdff180 (LWP 611)]
Resolving dependencies... [Detaching after fork from child process 612]
[New Thread 0x38aa37f180 (LWP 613)]
[Detaching after fork from child process 614]
[Detaching after fork from child process 615]
[Detaching after fork from child process 616]
[Detaching after fork from child process 617]
[Detaching after fork from child process 618]
[Detaching after fork from child process 619]

Thread 8 "DartWorker" received signal SIGILL, Illegal instruction.
[Switching to Thread 0x38abdff180 (LWP 611)]
0x00000038aa1ae6a4 in ?? ()

(gdb) disassemble 0x00000038aa1ae6a4,+100:

Dump of assembler code from 0x38aa1ae6a4 to 0x38aa1ae708:
=> 0x00000038aa1ae6a4:  beqz    a4,0x38aa1ae6ba
   0x00000038aa1ae6a8:  lwu     s3,-1(a0)
   0x00000038aa1ae6ac:  srli    s3,s3,0xc
   0x00000038aa1ae6b0:  li      a4,75
   0x00000038aa1ae6b4:  bne     s3,a4,0x38aa1ae6ba
   0x00000038aa1ae6b8:  ret
   0x00000038aa1ae6ba:  ld      a4,624(s1)
   0x00000038aa1ae6be:  jr      a4
   0x00000038aa1ae6c0:  fld     fa3,64(s0)
   0x00000038aa1ae6c2:  unimp
   0x00000038aa1ae6c4:  unimp
   0x00000038aa1ae6c6:  unimp
   0x00000038aa1ae6c8:  unimp
   0x00000038aa1ae6ca:  unimp
   0x00000038aa1ae6cc:  unimp
   0x00000038aa1ae6ce:  unimp
   0x00000038aa1ae6d0:  addi    s0,sp,180
   0x00000038aa1ae6d2:  c.nop   1
   0x00000038aa1ae6d4:  unimp
   0x00000038aa1ae6d6:  unimp
   0x00000038aa1ae6d8:  unimp
   0x00000038aa1ae6da:  unimp
   0x00000038aa1ae6dc:  unimp
   0x00000038aa1ae6de:  unimp
   0x00000038aa1ae6e0:  unimp
   0x00000038aa1ae6e2:  unimp
   0x00000038aa1ae6e4:  unimp
   0x00000038aa1ae6e6:  unimp
--Type <RET> for more, q to quit, c to continue without paging--c
   0x00000038aa1ae6e8:  unimp
   0x00000038aa1ae6ea:  unimp
   0x00000038aa1ae6ec:  unimp
   0x00000038aa1ae6ee:  unimp
   0x00000038aa1ae6f0:  unimp
   0x00000038aa1ae6f2:  unimp
   0x00000038aa1ae6f4:  unimp
   0x00000038aa1ae6f6:  unimp
   0x00000038aa1ae6f8:  unimp
   0x00000038aa1ae6fa:  unimp
   0x00000038aa1ae6fc:  unimp
   0x00000038aa1ae6fe:  unimp
   0x00000038aa1ae700:  unimp
   0x00000038aa1ae702:  unimp
   0x00000038aa1ae704:  unimp
   0x00000038aa1ae706:  unimp
End of assembler dump.

I'd note that the same sequence (and more) runs inside of Docker buildx (hence using QEMU) every time we release binaries, and whilst it hangs far too frequently it doesn't crash in this manner. Given the recent differential fuzzing that targeted both QEMU and the JH7110 SoC in the VisionFive 2 (amongst others) I'm surprised by the differing behaviours I'm seeing here.

@cpswan
Copy link
Contributor Author

cpswan commented Sep 10, 2024

and for further completeness I ran the sequence without Docker (just Ubuntu 24.04.1 on the StarFive VisionFive 2) and no crash. So maybe Docker is the underlying cause?

dart run build_runner build --delete-conflicting-outputs

Building package executable... (35.6s)
Built build_runner:build_runner.
[INFO] Generating build script completed, took 3.0s
[INFO] Precompiling build script... completed, took 34.8s
[INFO] Building new asset graph completed, took 7.4s
[INFO] Checking for unexpected pre-existing outputs. completed, took 19ms
[INFO] Running build completed, took 237ms
[INFO] Caching finalized dependency graph completed, took 788ms
[INFO] Succeeded after 1.1s with 1 outputs (1 actions)

@rmacnak-google
Copy link
Contributor

Hm, the instructions seems reasonable. I wonder if this is something like a previous issue seen with Docker with instruction mapping.

Can you try running with the background compiler disabled? If this succeeds, it could be something related to instruction synchronization.

dart --no-background-compilation run build_runner build --delete-conflicting-outputs

@cpswan
Copy link
Contributor Author

cpswan commented Sep 11, 2024

Good call @rmacnak-google dart --no-background-compilation run build_runner build --delete-conflicting-outputs does indeed succeed (this is on the original setup using dart-musl):

Building package executable... (37.6s)
Built build_runner:build_runner.
[INFO] Generating build script completed, took 3.5s
[INFO] Precompiling build script... completed, took 34.9s
[INFO] Building new asset graph completed, took 9.4s
[INFO] Checking for unexpected pre-existing outputs. completed, took 15ms
[INFO] Running build completed, took 286ms
[INFO] Caching finalized dependency graph completed, took 1.0s
[INFO] Succeeded after 1.4s with 1 outputs (1 actions)

I recall that previous issue (and especially @mraleph gripes about not being able to reproduce it due to not being allowed Docker Desktop) as my colleague @cconstab hit a similar issue with arm that features later in the thread.

The docker --version in use here is:

Docker version 24.0.7, build 24.0.7-0ubuntu4.1

@a-siva a-siva added P3 A lower priority bug or feature request triaged Issue has been triaged by sub team labels Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. P3 A lower priority bug or feature request triaged Issue has been triaged by sub team type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

5 participants