ponyc: Compiled binary triggers SIGSEGV
#1561 revolved around a snippet that triggered a compiler abort related to tuple handing and GC tracing.
As of #1591 the code snippet now compiles and runs successfully. Additionally, the original code that uncovered this bug also compiles.
Unfortunately, the compiled program now triggers a SIGSEGV. This may be related to the fix (3d4c5782750b32739c2cef5890ce57c8c7f9bae8) that enabled it to now compile, but it may also be related to a number of other changes that have been made since the last version that was able to compile the code (4dbf835289f76fc7737b19b0dc30a10e71ecec96).
Details
In short, the program compiled with ponyc
now core dumps on SIGSEGV
.
Pony Version
0 15:12 stewart@icecube:~/work/ecn/projects/model/binaries$ ~/opt/pony/bleed/build/debug/ponyc -v
0.10.0-3d4c578 [debug]
compiled with: llvm 3.9.1 -- cc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Compilation
139 14:59 stewart@icecube:~/work/ecn/projects/model/binaries$ time ~/opt/pony/bleed/build/debug/ponyc -d; ls -al binaries
Building builtin -> /home/stewart/opt/pony/bleed/packages/builtin
Building . -> /home/stewart/work/ecn/projects/model/binaries
Building ponytest -> /home/stewart/opt/pony/bleed/packages/ponytest
Building time -> /home/stewart/opt/pony/bleed/packages/time
Building collections -> /home/stewart/opt/pony/bleed/packages/collections
Building ../util -> /home/stewart/work/ecn/projects/model/util
Building format -> /home/stewart/opt/pony/bleed/packages/format
Generating
Reachability
Selector painting
Data prototypes
Data types
Function prototypes
Functions
Descriptors
Writing ./binaries.o
Linking ./binaries
Warning: environment variable $CC undefined, using cc as the linker
real 0m14.487s
user 0m14.252s
sys 0m0.136s
-rwxrwxr-x 1 stewart stewart 1930392 Feb 17 14:59 binaries
Debugging SIGSEGV
0 15:02 stewart@icecube:~/work/ecn/projects/model/binaries$ lldb -o run -- ./binaries
(lldb) target create "./binaries"
Current executable set to './binaries' (x86_64).
(lldb) run
1 test started, 0 complete: health:types started
2 tests started, 0 complete: networks started
3 tests started, 0 complete: singletons started
4 tests started, 0 complete: clusters started
5 tests started, 0 complete: governor:boot started
state: 0 message: start
state: 0 message: start
state: 0 message: start
B>>state: 0 message: start
state: 1 message: ?,singleton-manager = (Paused, _)
state: 2 message: ?,singleton-manager = (Running, _)
state: 1 message: ?,cluster-manager = (Paused, _)
P>>state: 0 message: start
state: 3 message: singleton?
5 tests started, 1 complete: health:types complete
state: 2 message: ?,cluster-manager = (Running, _)
state: 4 message: ?,singleton = (Running, _)
state: 1 message: ?,network-manager = (Paused, _)
state: 5 message: created
state: 3 message: cluster?
state: 4 message: ?,cluster = (Starting, _)
state: 4 message: ?,cluster = (Running, _)
Process 31659 stopped
* thread #2: tid = 31664, 0x0000000000407b5b binaries`_SingletonManagerDriver_Dispatch + 139, name = 'binaries', stop reason = signal SIGSEGV: invalid address (fault address: 0x19)
frame #0: 0x0000000000407b5b binaries`_SingletonManagerDriver_Dispatch + 139
binaries`_SingletonManagerDriver_Dispatch:
-> 0x407b5b <+139>: cmpq %rax, (%rcx)
0x407b5e <+142>: je 0x407b8c ; <+188>
0x407b60 <+144>: jmp 0x407bb5 ; <+229>
0x407b62 <+146>: movq 0xb8(%rsp), %rdi
Process 31659 launched: './binaries' (x86_64)
(lldb) bt
* thread #2: tid = 31664, 0x0000000000407b5b binaries`_SingletonManagerDriver_Dispatch + 139, name = 'binaries', stop reason = signal SIGSEGV: invalid address (fault address: 0x19)
* frame #0: 0x0000000000407b5b binaries`_SingletonManagerDriver_Dispatch + 139
frame #1: 0x00000000004a304e binaries`handle_message(ctx=0x00007ffff6fc3dc8, actor=0x00007fffe57aac00, msg=0x00007fffe57c2300) + 401 at actor.c:103
frame #2: 0x00000000004a3208 binaries`ponyint_actor_run(ctx=0x00007ffff6fc3dc8, actor=0x00007fffe57aac00, batch=100) + 308 at actor.c:158
frame #3: 0x00000000004a40eb binaries`run(sched=0x00007ffff6fc3d80) + 137 at scheduler.c:287
frame #4: 0x00000000004a41dd binaries`run_thread(arg=0x00007ffff6fc3d80) + 59 at scheduler.c:338
frame #5: 0x00007ffff79b96ba libpthread.so.0`start_thread + 202
frame #6: 0x00007ffff72d582d libc.so.6`__clone + 109 at clone.S:109
(lldb)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 21 (21 by maintainers)
Thanks for reporting back @sgebbie. I’m currently in the process of adding tests for trace generation so hopefully this kind of problem shouldn’t arise anymore.