Skip to content

Instantly share code, notes, and snippets.

@yuntan
Created April 3, 2015 13:09
Show Gist options
  • Save yuntan/df45e29a00158f0076ef to your computer and use it in GitHub Desktop.
Save yuntan/df45e29a00158f0076ef to your computer and use it in GitHub Desktop.
go-qml os/exec.Cmd.Run SIGTRAP

environment

go 1.4 linux/amd64 Qt 5.4.1 Arch Linux

problem

Application is terminated due to core dump with signal trace/breakpoint trap, when the ls command is executed.

package main
import (
"fmt"
"os/exec"
"time"
"gopkg.in/qml.v1"
)
func main() {
go runCommand()
if err := qml.Run(run); err != nil {
fmt.Println(err)
}
}
func run() error {
engine := qml.NewEngine()
component, err := engine.LoadFile("main.qml")
if err != nil {
return err
}
win := component.CreateWindow(nil)
win.Show()
win.Wait()
return nil
}
func runCommand() {
time.Sleep(5 * time.Second)
cmd := exec.Command("ls")
if err := cmd.Run(); err != nil {
fmt.Println(err)
}
}
import QtQuick 2.2
Rectangle {
width: 300; height: 300
color: 'red'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment