Skip to content

Application SEGV when sending a union of tuple #2741

@sgebbie

Description

@sgebbie

When using:

$ ponyc -v
0.22.3-aff82e4 [release]
compiled with: llvm 5.0.1 -- cc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
Defaults: pic=false ssl=openssl_0.9.0

The following short program consistent crashes.

$ cat crasher.pony

actor Crasher
  be go(value: TimeOp) => None

actor Main

  new create(env: Env) =>
    let w:Crasher = Crasher

    let ctc: TimeStamp = (5,7)
    let cto: TimeOp = (11, ctc)
    w.go(cto)

class val TimeChunk
type TimeStamp is (I64, I64)

type TimeOp is (
    (I32 , TimeChunk)
  | (I32 , TimeStamp)
)

The LLDB output shows that values in the tuple seem to be being used as addresses to dereferrence:

$ lldb ./crasher
(lldb) target create "./crasher"
Current executable set to './crasher' (x86_64).
(lldb) run
Process 11224 launched: './crasher' (x86_64)
Process 11224 stopped
* thread #2: tid = 11228, 0x0000000000402e73 crasher`Main_tag_create_oo(this=0x00007ffff71c9800, env=0x00007ffff71c9000) + 451 at crasher.pony:11, name = 'crasher', stop reason = signal SIGSEGV: invalid address (fault address: 0x5)
    frame #0: 0x0000000000402e73 crasher`Main_tag_create_oo(this=0x00007ffff71c9800, env=0x00007ffff71c9000) + 451 at crasher.pony:11
   8   
   9        let ctc: TimeStamp = (5,7)
   10       let cto: TimeOp = (11, ctc)
-> 11       w.go(cto)
   12  
   13   class val TimeChunk
   14   type TimeStamp is (I64, I64)
(lldb) 

This might be related to: #2237 which is still an open issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs investigationThis needs to be looked into before its "ready for work"triggers releaseMajor issue that when fixed, results in an "emergency" release

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions