Skip to content

[pigeon] 0.1.9 crashes on Windows #67227

Description

Bug

When executing flutter pub run pigeon (tested on Windows) with version 0.1.8 or 0.1.9, the command crashes immediately with the following error message:

Crash when compiling pigeon_temp_.dart (click to expand)
Unhandled exception:
IsolateSpawnException: Unable to spawn isolate: Crash when compiling 18715c42%5C_pigeon_temp_.dart,
at character offset null:
Unsupported operation: Illegal character in path: 18715c42\_pigeon_temp_.dart
#0      _Uri._checkWindowsPathReservedCharacters (dart:core/uri.dart:1734:11)
#1      _Uri._toWindowsFilePath (dart:core/uri.dart:2748:7)
#2      _Uri.toFilePath (dart:core/uri.dart:2720:38)
#3      new File.fromUri (dart:io/file.dart:260:49)
#4      _IoFileSystemEntity.readAsBytes (package:front_end/src/api_prototype/standard_file_system.dart:66:18)
#5      HybridFileSystemEntity.readAsBytes (package:front_end/src/fasta/hybrid_file_system.dart:54:61)
<asynchronous suspension>
#6      SourceLoader.tokenize (package:front_end/src/fasta/source/source_loader.dart:242:55)
#7      SourceLoader.buildOutline (package:front_end/src/fasta/source/source_loader.dart:412:26)
#8      Loader.buildOutlines (package:front_end/src/fasta/loader.dart:254:13)
#9      SourceLoader.buildOutlines (package:front_end/src/fasta/source/source_loader.dart:336:17)
#10     KernelTarget.buildOutlines.<anonymous closure> (package:front_end/src/fasta/kernel/kernel_target.dart:327:20)
#11     withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
#12     KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:326:12)
#13     generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:119:28)
<asynchronous suspension>
#14     generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart)
#15     withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
#16     generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:73:10)
#17     generateKernel.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:53:18)
#18     CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:135:20)
<asynchronous suspension>
#19     CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart)
#20     CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:46)
#21     new Future.sync (dart:async/future.dart:223:31)
#22     CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:19)
#23     _rootRun (dart:async/zone.dart:1190:13)
#24     _CustomZone.run (dart:async/zone.dart:1093:19)
#25     _runZoned (dart:async/zone.dart:1630:10)
#26     runZoned (dart:async/zone.dart:1550:10)
#27     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:122:12)
#28     CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:133:10)
#29     generateKernel (package:front_end/src/kernel_generator_impl.dart:52:32)
#30     kernelForModule (package:front_end/src/api_prototype/kernel_generator.dart:99:17)
#31     SingleShotCompilerWrapper.compileInternal (file:///C:/b/s/w/ir/cache/builder/src/third_party/dart/pkg/vm/bin/kernel_service.dart:441:17)
#32     Compiler.compile.<anonymous closure> (file:///C:/b/s/w/ir/cache/builder/src/third_party/dart/pkg/vm/bin/kernel_service.dart:208:45)
#33     new Future.<anonymous closure> (dart:async/future.dart:175:37)
#34     _rootRun (dart:async/zone.dart:1182:47)
#35     _CustomZone.run (dart:async/zone.dart:1093:19)
#36     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#37     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#38     _rootRun (dart:async/zone.dart:1190:13)
#39     _CustomZone.run (dart:async/zone.dart:1093:19)
#40     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1021:23)
#41     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
#42     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:397:19)
#43     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:428:5)
#44     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

Flutter versions

Flutter 1.22.0 • channel beta • https://github.com/flutter/flutter.git
Framework • revision d408d302e2 (4 days ago) • 2020-09-29 11:49:17 -0700
Engine • revision 5babba6c4d
Tools • Dart 2.10.0

Notes

@gaaclarke You noted in the changelog for version 0.1.9 that this crash should be fixed:

https://github.com/flutter/packages/blame/4b576c0da9814b71db4decc6bbea14b5bb4e63fb/packages/pigeon/CHANGELOG.md#L3

However, it still appears for me.

Activity

  1. changed the title [-][pigeon] 0.1.9 crashes on execution[/-] [+][pigeon] 0.1.9 crashes without arguments[/+] on Oct 3, 2020
  2. changed the title [-][pigeon] 0.1.9 crashes without arguments[/-] [+][pigeon] 0.1.9 crashes on Windows[/+] on Oct 3, 2020
  3. creativecreatorormaybenot commented on Oct 3, 2020

    @creativecreatorormaybenot
    ContributorAuthor

    @gaaclarke 0.1.9 crashes for me with this exception all the time actually, even when I specify the --input argument. 0.1.7 always works fine.

  4. gaaclarke commented on Oct 5, 2020

    @gaaclarke
    Member

    Thanks the crash is here somewhere in bin/pigeon.dart:

      final String tempFilename = path.join(tempDir.path, '_pigeon_temp_.dart');
      await File(tempFilename).writeAsString(code);
      final ReceivePort receivePort = ReceivePort();
      Isolate.spawnUri(Uri.parse(tempFilename), args, receivePort.sendPort);

    I'm guessing Uri.parse might work on *nix computers but not windows computers. It will take me a minute to get a windows environment setup if you want to play with it in the meantime.

  5. creativecreatorormaybenot commented on Oct 5, 2020

    @creativecreatorormaybenot
    ContributorAuthor

    @gaaclarke I will try to use https://api.dart.dev/stable/2.10.0/dart-io/File/path.html instead.

    Will try to run that later today (currently not on a Windows machine 😅 😂).

  6. creativecreatorormaybenot commented on Oct 5, 2020

    @creativecreatorormaybenot
    ContributorAuthor

    @gaaclarke I was able to fix it 🙌 It turns out, there is Uri.file for file paths on Windows :)

    Here is the fix: flutter/packages#216

  7. pcariel commented on Oct 18, 2020

    @pcariel

    @gaaclarke

    Hi,
    System: Windows

    0.1.07 - Working

    Change to version 0.1.12
    Error

    flutter pub run pigeon --input pigeons/messages.dart
    Unhandled exception:
    IsolateSpawnException: Unable to spawn isolate: ../../../ManuelP1/AppData/Local/Temp/bb5cb0d1/pigeon_temp.dart:1:8: Error: Error when reading '../../../MANUELP1/AppData/Local/Temp/bb5cb0d1/........
    ..Manuel;%20PerezDocumentssdkpigeonsmessages.dart': The system cannot find the file specified.

    import '..........\Manuel Perez\Documents\sdk\pigeons\messages.dart';

  8. github-actions commented on Aug 11, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  9. locked as resolved and limited conversation to collaborators on Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crashStack traces logged to the consolep: pigeonrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.platform-windowsBuilding on or for Windows specifically

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions