Skip to content

[v3] screen locks up when sleeping, and waking on external display at times. #5163

Description

@wayneforrest

Description

When sleeping on one display (laptop screen), and waking up on an external display, a data race condition occurs.
This does not always happen, and have to repeat this several times. Each time the UI got stuck with a beach ball. Inspecting the process, showed several go routines backed up. Eventually the go race found the cause.

go build -race -buildvcs=false -gcflags=all="-l" -o bin/my-app-name
  # my-app-name
  ld: warning: ignoring duplicate libraries: '-lobjc'
  ld: warning:
  '/private/var/folders/40/h2gz12596h37pwhss5_bsqdh0000gn/T/go-link-1873182515/000048.o' has
  malformed LC_DYSYMTAB, expected 98 undefined symbols to start at index 1626, found 95 undefined
  symbols starting at index 1626
  ld: warning: object file
  (/private/var/folders/40/h2gz12596h37pwhss5_bsqdh0000gn/T/go-link-1873182515/go.o) was built for
  newer 'macOS' version (26.0) than being linked (11.0)
  ld: warning: object file
  (/private/var/folders/40/h2gz12596h37pwhss5_bsqdh0000gn/T/go-link-1873182515/000000.o) was built
  for newer 'macOS' version (26.0) than being linked (11.0)
  ld: warning: object file
  (/private/var/folders/40/h2gz12596h37pwhss5_bsqdh0000gn/T/go-link-1873182515/000001.o) was built
  for newer 'macOS' version (26.0) than being linked (11.0)
  ld: warning: object file
  (/private/var/folders/40/h2gz12596h37pwhss5_bsqdh0000gn/T/go-link-1873182515/000002.o) was built
  for newer 'macOS' version (26.0) than being linked (11.0)
  ld: warning: object file
  (/private/var/folders/40/h2gz12596h37pwhss5_bsqdh0000gn/T/go-link-1873182515/000003.o) was built
  for newer 'macOS' version (26.0) than being linked (11.0)
  ld: warning: object file
  (/private/var/folders/40/h2gz12596h37pwhss5_bsqdh0000gn/T/go-link-1873182515/000004.o) was built
  for newer 'macOS' version (26.0) than being linked (11.0)
  ld: warning: object file
  (/private/var/folders/40/h2gz12596h37pwhss5_bsqdh0000gn/T/go-link-1873182515/000005.o) was built
  for newer 'macOS' version (26.0) than being linked (11.0)
  ld: warning: object file
  (/private/var/folders/40/h2gz12596h37pwhss5_bsqdh0000gn/T/go-link-1873182515/000006.o) was built
  for newer 'macOS' version (26.0) than being linked (11.0)
  ld: warning: object file
  (/private/var/folders/40/h2gz12596h37pwhss5_bsqdh0000gn/T/go-link-1873182515/000007.o) was built
  for newer 'macOS' version (26.0) than being linked (11.0)
  ld: warning: object file
  (/private/var/folders/40/h2gz12596h37pwhss5_bsqdh0000gn/T/go-link-1873182515/000008.o) was built
  for newer 'macOS' version (26.0) than being linked (11.0)
  ld: warning: object file
  (/private/var/folders/40/h2gz12596h37pwhss5_bsqdh0000gn/T/go-link-1873182515/000009.o) was built
  for newer 'macOS' version (26.0) than being linked
  … +540 lines …
  8
    github.com/wailsapp/wails/v3/pkg/application.(*ScreenManager).LayoutScreens()
        /Users/wayneforrest/Documents/Projects/wails/v3/pkg/application/screenmanager.go:383 +0xbc
    github.com/wailsapp/wails/v3/pkg/application.(*macosApp).processAndCacheScreens()
        /Users/wayneforrest/Documents/Projects/wails/v3/pkg/application/screen_darwin.go:176 +0x1bc
    github.com/wailsapp/wails/v3/pkg/application.(*macosApp).run.func3()
        /Users/wayneforrest/Documents/Projects/wails/v3/pkg/application/application_darwin.go:312
  +0x2c
    github.com/wailsapp/wails/v3/pkg/application.(*EventManager).handleApplicationEvent.func1()
        /Users/wayneforrest/Documents/Projects/wails/v3/pkg/application/event_manager.go:171 +0x68

  Previous write at 0x00c0002e1d60 by goroutine 4393:
    github.com/wailsapp/wails/v3/pkg/application.(*ScreenManager).calculateScreensDipCoordinates()
        /Users/wayneforrest/Documents/Projects/wails/v3/pkg/application/screenmanager.go:425 +0x48
    github.com/wailsapp/wails/v3/pkg/application.(*ScreenManager).LayoutScreens()
        /Users/wayneforrest/Documents/Projects/wails/v3/pkg/application/screenmanager.go:383 +0xbc
    github.com/wailsapp/wails/v3/pkg/application.(*macosApp).processAndCacheScreens()
        /Users/wayneforrest/Documents/Projects/wails/v3/pkg/application/screen_darwin.go:176 +0x1bc
    github.com/wailsapp/wails/v3/pkg/application.(*macosApp).run.func3()
        /Users/wayneforrest/Documents/Projects/wails/v3/pkg/application/application_darwin.go:312
  +0x2c
    github.com/wailsapp/wails/v3/pkg/application.(*EventManager).handleApplicationEvent.func1()
        /Users/wayneforrest/Documents/Projects/wails/v3/pkg/application/event_manager.go:171 +0x68

  Goroutine 4395 (running) created at:
    github.com/wailsapp/wails/v3/pkg/application.(*EventManager).handleApplicationEvent()
        /Users/wayneforrest/Documents/Projects/wails/v3/pkg/application/event_manager.go:166 +0x1d4
    github.com/wailsapp/wails/v3/pkg/application.(*App).Run.func1.gowrap1()
        /Users/wayneforrest/Documents/Projects/wails/v3/pkg/application/application.go:586 +0x3c

  Goroutine 4393 (finished) created at:
    github.com/wailsapp/wails/v3/pkg/application.(*EventManager).handleApplicationEvent()
        /Users/wayneforrest/Documents/Projects/wails/v3/pkg/application/event_manager.go:166 +0x1d4
    github.com/wailsapp/wails/v3/pkg/application.(*App).Run.func1.gowrap1()
        /Users/wayneforrest/Documents/Projects/wails/v3/pkg/application/application.go:586 +0x3c
  ==================

### To Reproduce

...

### Expected behaviour

...

### Screenshots

_No response_

### Attempted Fixes

_No response_

### System Details

```shell
...

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions