Skip to content

Deadlocks in Execute #31

@benlife5

Description

@benlife5

Hi,

We've occasionally been seeing deadlocks in the Execute function. Seems to block the timeout functionality from triggering too. Unfortunately, I don't have a way to reproduce, but I've added additional logging for when it happens and will update this issue if I get more details.

Our usage:

func (gen *SassCompiler) Compile(scss string) (string, error) {
	if len(scss) > 0 {
		res, err := transpiler.Execute(godartsass.Args{
			Source:         scss,
			OutputStyle:    godartsass.OutputStyleCompressed,
			ImportResolver: scssResolver{},
		})
		if err != nil {
			return "", yerrors.Wrap(err)
		}
		return strings.TrimPrefix(res.CSS, "\ufeff"), nil
	}

	return "", nil
}

Relevant part of the goroutine trace:

1367 @ ...
#   0x474724    sync.runtime_SemacquireMutex+0x24                                       GOROOT/src/runtime/sema.go:77
#   0x48421c    sync.(*Mutex).lockSlow+0x15c                                            GOROOT/src/sync/mutex.go:171
#   0x22da651   sync.(*Mutex).Lock+0x71                                             GOROOT/src/sync/mutex.go:90
#   0x22da626   github.com/bep/godartsass/v2.(*Transpiler).sendInboundMessage+0x46                      external/com_github_bep_godartsass_v2/transpiler.go:506
#   0x22da544   github.com/bep/godartsass/v2.(*Transpiler).newCall+0x2a4                            external/com_github_bep_godartsass_v2/transpiler.go:502
#   0x22d8904   github.com/bep/godartsass/v2.(*Transpiler).Execute+0xa4                             external/com_github_bep_godartsass_v2/transpiler.go:227
#   0x22e29f7   path/to/scsscompiler/lpsass.(*SassCompiler).Compile+0xd7             path/to/scsscompiler/lpsass/libsass.go:79

Occurred with version 2.0.0, I've just upgraded to 2.3.0 and will update if it happens again

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions