You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A panic in a scriggo originated go routine stalls the program, the panic does not propagate up and terminate the program.
Minimal Program
package main
func main() {
count := 4
ch := make(chan string, count)
for i := 0; i < count; i++ {
go runner(ch, string([]byte{0x30 + byte(i)}))
}
for {
ch <- "stuff"
}
}
func runner(ch chan string, id string) {
if id == "3" {
panic("stuff")
}
for val := range ch {
println(id, val)
}
}
package main
import (
"fmt"
"github.com/open2b/scriggo"
)
func main() {
// Create a file system with the file of the program to run.
fsys := scriggo.Files{"main.go": []byte(src)}
opts := scriggo.BuildOptions{AllowGoStmt: true}
// Build the program.
program, err := scriggo.Build(fsys, &opts)
if err != nil {
panic(err)
}
// Run the program.
err = program.Run(nil)
if err != nil {
fmt.Println("RUN ERROR", err)
}
fmt.Println("DONE")
}
const src = `
package main
func main() {
count := 4
ch := make(chan string, count)
for i := 0; i < count; i++ {
go runner(ch, string([]byte{0x30+byte(i)}))
}
for {
ch<-"stuff"
}
}
func runner(ch chan string, id string) {
if id == "3" {
panic("stuff")
}
for val := range ch {
println(id, val)
}
}
`
The text was updated successfully, but these errors were encountered:
Suspected behavior
A panic in a scriggo originated go routine stalls the program, the panic does not propagate up and terminate the program.
Minimal Program
GC output
Scriggo output
Complete test program
The text was updated successfully, but these errors were encountered: