Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Returning b64 results in a segmentation fault #911

@abrown

Description

@abrown

As a part of #890 I added support for running CLIF directly as a filetest or through clif-util run; the current idea is that functions would return a boolean that indicates whether the function ran successfully or not. This works with the other boolean types, but a test like the following results in a segmentation fault:

test run
function %test_b64() -> b64 {
ebb0:
    v0 = bconst.b64 true
    return v0
}
; run
$ target/debug/clif-util run filetests/isa/x86/run-const.clif 
Segmentation fault (core dumped)
$ coredumpctl dump
           PID: 32159 (clif-util)
           UID: 1000 (abrown)
           GID: 1000 (abrown)
        Signal: 11 (SEGV)
     Timestamp: Tue 2019-08-20 09:15:19 PDT (1min 36s ago)
  Command Line: target/debug/clif-util run filetests/isa/x86/run-const.clif
    Executable: /home/abrown/Code/cranelift/target/debug/clif-util
 Control Group: /user.slice/user-1000.slice/session-c3.scope
          Unit: session-c3.scope
         Slice: user-1000.slice
       Session: c3
     Owner UID: 1000 (abrown)
       Boot ID: 118deca6420a48b69f1c2a455c2500f9
    Machine ID: e9d29f116e2f4d09baf478e99d04fbff
      Hostname: abrown-desk.amr.corp.intel.com
       Storage: /var/lib/systemd/coredump/core.clif-util.1000.118deca6420a48b69f1c2a455c2500f9.32159.1566317719000000.lz4
       Message: Process 32159 (clif-util) of user 1000 dumped core.
                
                Stack trace of thread 32159:
                #0  0x00007fec72edc00f n/a (ld-linux-x86-64.so.2)
                #1  0x00005642de402114 n/a (/home/abrown/Code/cranelift/target/debug/clif-util)

I am running a Linux kernel 5.1.18 on Fedora 30 and would expect the system_v calling convention to be the default here. I may need some help figuring out why b64 does not work here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA bug or panic in the compiler or generated code.metaEverything related to the meta-language.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions