ponyc icon indicating copy to clipboard operation
ponyc copied to clipboard

Segmentation fault on array copy

Open EEVV opened this issue 6 years ago • 4 comments
trafficstars

class Double
  let _a: Array[U8 val] = []
  let _b: Array[U8 val] = []

  new create(a: Array[U8 val] val, b: Array[U8 val] val) =>
    for byte in a.values() do
      _a.push(byte)
    end

    for byte in b.values() do
      _b.push(byte)
    end

actor Main
  var _d: (Double | None) = None

  new create(env: Env) =>
    let a: Array[U8 val] val = []

    _d = Double(a, a)

Linux (x86_64 Linux 4.19.15_1)

$ ponyc --version:

0.25.0 [release]
compiled with: llvm 6.0.1 -- cc (GCC) 7.3.0
Defaults: pic=true ssl=openssl_0.9.0

$ ponyc:

Building builtin -> /usr/lib/pony/0.25.0/packages/builtin
Building . -> /home/eevv/projects/pony/bug
Generating
 Reachability
 Selector painting
 Data prototypes
 Data types
 Function prototypes
 Functions
 Descriptors
Optimising
Stack dump:
0.	Running pass 'Function Pass Manager' on module 'bug'.
1.	Running pass 'Move heap allocations to the stack' on function '@Main_Dispatch'
Segmentation fault

EEVV avatar Jan 19 '19 18:01 EEVV

I can confirm this causes the same error for me using Ponyc 0.25.0 with LLVM 3.9.1 on MacOS 10.11.6

SeanTAllen avatar Jan 19 '19 18:01 SeanTAllen

Since this is a failure in the heap to stack area that I'm currently looking at these past few days, I can take responsibility for next triaging steps on this one.

jemc avatar Jan 22 '19 17:01 jemc

This is still an issue as of 0.37.0

SeanTAllen avatar Sep 05 '20 13:09 SeanTAllen

Still an issue as of 0.46.0

SeanTAllen avatar Jan 27 '22 06:01 SeanTAllen