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

Compiler seg faults in exhaustive match code gen #1975

Closed
cquinn opened this issue Jun 21, 2017 · 4 comments
Closed

Compiler seg faults in exhaustive match code gen #1975

cquinn opened this issue Jun 21, 2017 · 4 comments
Assignees
Labels
triggers release Major issue that when fixed, results in an "emergency" release

Comments

@cquinn
Copy link
Contributor

cquinn commented Jun 21, 2017

Latest master on MacOS 10.12.5.
Ponyc 0.14.0-a5ed8aa0 [release]
compiled with: llvm 3.9.1 -- Apple LLVM version 8.1.0 (clang-802.0.42)

The code demonstrating the problem is in the cli package in PR #1897 , source command_spec.pony lines 158-160 and 272-274

Building either of these 3-line workaround sections removed causes a segmentation fault during the Generating phase of ponyc.

The output I see is:

ponyc -V=4
Building builtin -> /Users/carl/ws/pony/cquinn/ponyc/packages/builtin
Building . -> /Users/carl/ws/pony/cquinn/ponyc/packages/cli
Building collections -> /Users/carl/ws/pony/cquinn/ponyc/packages/collections
Building ponytest -> /Users/carl/ws/pony/cquinn/ponyc/packages/ponytest
Building time -> /Users/carl/ws/pony/cquinn/ponyc/packages/time
Building buffered -> /Users/carl/ws/pony/cquinn/ponyc/packages/buffered
Generating
 Reachability
 Selector painting
 Data prototypes
 Data types
 Function prototypes
 Functions
Segmentation fault: 11

I will try to put together a smaller repro case, but in the meantime, I wanted to get an Issue in place to track it.

@jemc jemc added bug: 1 - needs investigation triggers release Major issue that when fixed, results in an "emergency" release labels Jun 21, 2017
@cquinn
Copy link
Contributor Author

cquinn commented Jun 21, 2017

Here is a smaller repro case:

type Union is (Bool | String)

class val X
  new val bool(default': (Bool | None) = None) =>
    let u =
      match default'
      | None => None
      | let d: Union => d
      //else
        // Ponyc issue: else can't happen, but segfaults without it
        //None
      end

actor Main
  new create(env: Env) =>
    X.bool()

@Perelandric
Copy link
Contributor

This (at least the reduced example) appears to be fixed as of pull #2049

@jemc
Copy link
Member

jemc commented Jul 18, 2017

@cquinn can you confirm?

@cquinn
Copy link
Contributor Author

cquinn commented Jul 18, 2017

Yes, this fixes the problem found in cli/command_spec.pony.

@cquinn cquinn changed the title Ponyc seg faults in exhaustive match code gen Compiler seg faults in exhaustive match code gen Jul 18, 2017
@jemc jemc closed this as completed Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triggers release Major issue that when fixed, results in an "emergency" release
Projects
None yet
Development

No branches or pull requests

3 participants