“Compiler crashed with code 1” on Mono'" />

2x1=10

because numbers are people, too
Persönliches
Fotografie
Programmierung
    • “Compiler crashed with code 1” on Mono

      Update:
      I opened a bug tick­et for the described issue and it got fixed with­in the week.

      Orig­i­nal post:
      At work we recent­ly stum­bled across an inter­est­ing prob­lem: While com­pi­la­tion of our C# 6 code base would work fine on Win­dows, a guy that works on OSX using Xam­arin Stu­dio sud­den­ly was unable to com­pile the code, because “Error: Com­pil­er crashed with code 1”. No line num­ber, no noth­ing, only that.

      After a run through git bisect we even­tu­al­ly were able to track down the com­mit where I found the error to lie with­in an await hap­pen­ing in a string inter­po­la­tion. Sad­ly, this prob­lem was intro­duced by sim­ply (and auto­mat­i­cal­ly) refac­tor­ing all occur­rences of String.Format() in the file.

      I was able to repro­duce the prob­lem with the fol­low­ing sim­ple code:

      private async Task<int> Foo() 
      {
          await Task.Delay(1);
          return 42;
      }
      
      private async Task Bar()
      {
          Console.WriteLine($"Something {await Foo()}");
      }
      

      Appar­ent­ly, the mono com­pil­er doesn’t like that too much. The solu­tion to this is sim­ple: Don’t await with­in the inter­po­lat­ed string.
      Instead, do it out­side:

      private async Task Bar()
      {
          var foo = await Foo();
          Console.WriteLine($"Something {foo}");
      }
      

      And that’s that.

      Dezember 4th, 2015 GMT +1 von
      Markus
      2015-12-4T13:29:31+01:00 2015-12-10T21:34:40+01:00 · 0 Kommentare
      Bug Mono async/await
      .NET

      Hinterlasse einen Kommentar

      Hier klicken, um das Antworten abzubrechen.

    1. « newer
    2. 1
    3. …
    4. 6
    5. 7
    6. 8
    7. 9
    8. 10
    9. 11
    10. 12
    11. …
    12. 43
    13. older »
    • Kategorien

      • .NET
        • ASP.NET
        • Core
        • DNX
      • Allgemein
      • Android
      • Data Science
      • Embedded
      • FPGA
      • Humor
      • Image Processing
      • Kalman Filter
      • Machine Learning
        • Caffe
        • Hidden Markov Models
        • ML Summarized
        • Neural Networks
        • TensorFlow
      • Mapping
      • MATLAB
      • Robotik
      • Rust
      • Signal Processing
      • Tutorial
      • Version Control
    • Neueste Beiträge

      • Summarized: The E-Dimension — Why Machine Learning Doesn’t Work Well for Some Problems?
      • Use your conda environment in Jupyter Notebooks
      • Building OpenCV for Anaconda Python 3
      • Using TensorFlow’s Supervisor with TensorBoard summary groups
      • Getting an image into and out of TensorFlow
    • Kategorien

      .NET Allgemein Android ASP.NET Caffe Core Data Science DNX Embedded FPGA Hidden Markov Models Humor Image Processing Kalman Filter Machine Learning Mapping MATLAB ML Summarized Neural Networks Robotik Rust Signal Processing TensorFlow Tutorial Version Control
    • Tags

      .NET Accelerometer Anaconda Bitmap Bug Canvas CLR docker FPGA FRDM-KL25Z FRDM-KL26Z Freescale git Gyroscope Integration Drift Intent J-Link Linear Programming Linux Magnetometer Matlab Mono Naismith OpenCV Open Intents OpenSDA Optimization Pipistrello Player/Stage PWM Python Sensor Fusion Simulink Spartan 6 svn tensorflow Tilt Compensation TRIAD ubuntu Windows Xilinx Xilinx SDK ZedBoard ZYBO Zynq
    • Letzte Kommetare

      • Lecke Mio bei Frequency-variable PWM generator in Simulink
      • Vaibhav bei Use your conda environment in Jupyter Notebooks
      • newbee bei Frequency-variable PWM generator in Simulink
      • Markus bei Using TensorFlow’s Supervisor with TensorBoard summary groups
      • Toke bei Using TensorFlow’s Supervisor with TensorBoard summary groups
    • Blog durchsuchen

    • Dezember 2015
      M D M D F S S
      « Sep   Sep »
       123456
      78910111213
      14151617181920
      21222324252627
      28293031  
    • Self

      • Find me on GitHub
      • Google+
      • Me on Stack­Ex­change
      • Ye olde blog
    • Meta

      • Anmelden
      • Beitrags-Feed (RSS)
      • Kommentare als RSS
      • WordPress.org
    (Generiert in 0,456 Sekunden)

    Zurück nach oben.