Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graphicsdriver/opengl: creating/modifying buffers causes OOM on Pinebook Pro #1040

Closed
lupine opened this issue Dec 30, 2019 · 10 comments
Closed

Comments

@lupine
Copy link

lupine commented Dec 30, 2019

Hi,

I converted https://code.ur.gs/lupine/ordoor/src/commit/5b4ad2495f8d25511ae78e784448b08078b2809a/cmd/view-map/main.go to ebiten this week. Still very early code, and not performant - but it did run against v1.10.2. In this code, I may draw images to the screen *ebiten.Image at coordinates like (4500,2500).

My hardware is a Pinebook Pro ( https://www.pine64.org/pinebook-pro/ ), using the Panfrost driver.

Attempting to upgrade ebiten to v1.11.0-alpha.2, and then master, I get the following failure:

DRM_IOCTL_PANFROST_CREATE_BO failed: Cannot allocate memory
DRM_IOCTL_PANFROST_MMAP_BO failed: No such file or directory
mmap failed: 0xffffffffffffffff Invalid argument
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0xffffffffffffffff pc=0xffff778aeef8]

runtime stack:
runtime.throw(0x76c746, 0x2a)
        /usr/lib/go-1.13/src/runtime/panic.go:774 +0x54
runtime.sigpanic()
        /usr/lib/go-1.13/src/runtime/signal_unix.go:378 +0x458

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x682388, 0x40078ada88, 0x4000722288)
        /usr/lib/go-1.13/src/runtime/cgocall.go:128 +0x50 fp=0x40078ada50 sp=0x40078ada10 pc=0x40fd88
github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl/gl._Cfunc_glowUnmapBuffer(0xffff81478280, 0x40000088ec, 0x40078adb00)
        _cgo_gotypes.go:1211 +0x44 fp=0x40078ada80 sp=0x40078ada50 pc=0x4e932c
github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl/gl.UnmapBuffer(...)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/graphicsdriver/opengl/gl/package_notwindows.go:679
github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl.(*context).unmapPixelBuffer.func1(0x40000791a0, 0x4007e63050)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/graphicsdriver/opengl/context_desktop.go:566 +0x4c fp=0x40078adad0 sp=0x40078ada80 pc=0x50dcf4
github.com/hajimehoshi/ebiten/internal/thread.(*Thread).Call.func1()
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/thread/thread.go:57 +0x38 fp=0x40078adb00 sp=0x40078adad0 pc=0x4e6680
github.com/hajimehoshi/ebiten/internal/thread.(*Thread).Loop(0x40000100d8, 0x7d9c60, 0x4007e63040)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/thread/thread.go:43 +0x2c fp=0x40078adba0 sp=0x40078adb00 pc=0x4e6474
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).Run(0x9fa3a0, 0x7d9060, 0xa35d20, 0x7dd260, 0xa36320, 0x54ce60, 0x9fbe78)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/uidriver/glfw/ui.go:530 +0x178 fp=0x40078adc20 sp=0x40078adba0 pc=0x53fc20
github.com/hajimehoshi/ebiten.runGame(0x7d6b20, 0x4007d23880, 0x3ff0000000000000, 0x10, 0x10)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/run.go:218 +0x9c fp=0x40078adc80 sp=0x40078adc20 pc=0x54cfa4
github.com/hajimehoshi/ebiten.Run(0x400004c420, 0x500, 0x400, 0x3ff0000000000000, 0x400001a2d0, 0x22, 0x9954302c01c23c01, 0x400004c410)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/run.go:170 +0x128 fp=0x40078adcf0 sp=0x40078adc80 pc=0x54ce80
ur.gs/ordoor/internal/ui.(*Window).Run(0x4007e62fc0, 0x400004c390, 0x400004c410, 0x40000f0a90, 0x0)
        /home/lupine/dev/code.ur.gs/lupine/ordoor/internal/ui/window.go:94 +0xc4 fp=0x40078add40 sp=0x40078adcf0 pc=0x67fb3c
main.main()
        /home/lupine/dev/code.ur.gs/lupine/ordoor/cmd/view-map/main.go:110 +0x864 fp=0x40078adf50 sp=0x40078add40 pc=0x68055c
runtime.main()
        /usr/lib/go-1.13/src/runtime/proc.go:203 +0x23c fp=0x40078adfd0 sp=0x40078adf50 pc=0x43a594
runtime.goexit()
        /usr/lib/go-1.13/src/runtime/asm_arm64.s:1128 +0x4 fp=0x40078adfd0 sp=0x40078adfd0 pc=0x46460c

goroutine 9 [chan receive]:
github.com/hajimehoshi/ebiten/internal/thread.(*Thread).Call(0x40000100d8, 0x4000018580, 0x40078b1b38, 0x509abc)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/thread/thread.go:60 +0xc4
github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl.(*context).unmapPixelBuffer(0xa363a8, 0x4, 0x1000, 0x1000)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/graphicsdriver/opengl/context_desktop.go:565 +0x60
github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl.(*pboState).unmapPBO(0xa35860)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/graphicsdriver/opengl/pbo_desktop.go:68 +0x50
github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl.(*Image).ReplacePixels(0x4006db1640, 0x4008c10000, 0xad6, 0xc00)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/graphicsdriver/opengl/image.go:119 +0xd8
github.com/hajimehoshi/ebiten/internal/graphicscommand.(*replacePixelsCommand).Exec(0x4006c72480, 0x24, 0x0, 0x0)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/graphicscommand/command.go:443 +0x50
github.com/hajimehoshi/ebiten/internal/graphicscommand.(*commandQueue).Flush(0xa36100)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/graphicscommand/command.go:265 +0x530
github.com/hajimehoshi/ebiten/internal/graphicscommand.FlushCommands(...)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/graphicscommand/command.go:294
github.com/hajimehoshi/ebiten/internal/restorable.ResolveStaleImages()
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/restorable/images.go:55 +0x30
github.com/hajimehoshi/ebiten/internal/shareable.EndFrame(0xa35d20, 0x4006f58a40)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/shareable/image.go:546 +0x4c
github.com/hajimehoshi/ebiten/internal/buffered.EndFrame(...)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/buffered/image.go:43
github.com/hajimehoshi/ebiten.(*uiContext).Update(0xa35d20, 0x4006f58a40, 0x0, 0x0)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/uicontext.go:240 +0x50
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).update(0x9fa3a0, 0x7d9060, 0xa35d20, 0x4e65dc, 0x4000049e48)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/uidriver/glfw/ui.go:738 +0x1b8
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).loop(0x9fa3a0, 0x7d9060, 0xa35d20, 0x0, 0x0)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/uidriver/glfw/ui.go:784 +0xb0
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).run(0x9fa3a0, 0x7d9060, 0xa35d20, 0x0, 0x0)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/uidriver/glfw/ui.go:656 +0x220
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).Run.func1(0x400004c440, 0x4000bfa720, 0x9fa3a0, 0x7d9060, 0xa35d20)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/uidriver/glfw/ui.go:524 +0x88
created by github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).Run
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20191230071449-e725c7ee7885/internal/uidriver/glfw/ui.go:521 +0x144

I presume the failure to allocate memory is unexpected and not checked for, leading to the sigsegv. At a minimum, we should panic instead; even better would be if the code kept working ;).

I appreciate panfrost is a marginal platform, and I'm doing very non-performant things on it right now, but I thought the SIGSEGV was interesting enough to report!

@hajimehoshi hajimehoshi added this to the v1.11.0 milestone Dec 30, 2019
@hajimehoshi
Copy link
Owner

Thank you for reporting! I'll take a look...

@hajimehoshi
Copy link
Owner

hajimehoshi commented Dec 30, 2019

	"ur.gs/ordoor/internal/conv"
	"ur.gs/ordoor/internal/data"
	"ur.gs/ordoor/internal/maps"
	"ur.gs/ordoor/internal/sets"
	"ur.gs/ordoor/internal/ui"

Could we take a look at the code of these packages?

EDIT: I found them https://code.ur.gs/lupine/ordoor

@hajimehoshi
Copy link
Owner

I feel like this is an issue in the OpenGL driver of your machine, so this might be hard to investigate...

@hajimehoshi
Copy link
Owner

hajimehoshi commented Dec 30, 2019

As this happened on glUnmapPixelBuffer, this might be related to #993

@hajimehoshi hajimehoshi changed the title Regression from v1.10.2 to master: DRM memory allocation failure -> SIGSEGV graphicsdriver/opengl: glUnmapBuffer causes SEGV (memory allocation failed) on Pinebook Pro Dec 30, 2019
@lupine
Copy link
Author

lupine commented Dec 30, 2019

Thanks for looking @hajimehoshi . Happy to try things out if that's of any use, although I'm hardly an opengl expert

@hajimehoshi
Copy link
Owner

Now I replaced glMapBuffer / glUnmapBuffer with glBufferSubData, then this should not be problematic more.

@lupine
Copy link
Author

lupine commented Jan 1, 2020

Thanks! I gave latest master a try, but unfortunately the problem seems to persist. New stacktrace, though:

DRM_IOCTL_PANFROST_CREATE_BO failed: Cannot allocate memory
DRM_IOCTL_PANFROST_MMAP_BO failed: No such file or directory
mmap failed: 0xffffffffffffffff Invalid argument
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8781fff pc=0xffff798aaef8]

runtime stack:
runtime.throw(0x76c2ec, 0x2a)
        /usr/lib/go-1.13/src/runtime/panic.go:774 +0x54
runtime.sigpanic()
        /usr/lib/go-1.13/src/runtime/signal_unix.go:378 +0x458

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x681820, 0x40040319d8, 0x4004031a38)
        /usr/lib/go-1.13/src/runtime/cgocall.go:128 +0x50 fp=0x40040319a0 sp=0x4004031960 pc=0x40fd88
github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl/gl._Cfunc_glowBufferSubData(0xffff83138400, 0x40000088ec, 0x878200, 0x200, 0x4004a70000)
        _cgo_gotypes.go:381 +0x40 fp=0x40040319d0 sp=0x40040319a0 pc=0x4e72a8
github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl/gl.BufferSubData.func1(0x88ec, 0x878200, 0x200, 0x4004a70000)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/graphicsdriver/opengl/gl/package_notwindows.go:466 +0x78 fp=0x4004031a10 sp=0x40040319d0 pc=0x4ec480
github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl/gl.BufferSubData(0x88ec, 0x878200, 0x200, 0x4004a70000)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/graphicsdriver/opengl/gl/package_notwindows.go:466 +0x40 fp=0x4004031a40 sp=0x4004031a10 pc=0x4e9c68
github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl.(*context).replacePixelsWithPBO.func1(0x4003d77380, 0x4003d1b190)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/graphicsdriver/opengl/context_desktop.go:560 +0xf8 fp=0x4004031ad0 sp=0x4004031a40 pc=0x50d820
github.com/hajimehoshi/ebiten/internal/thread.(*Thread).Call.func1()
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/thread/thread.go:57 +0x38 fp=0x4004031b00 sp=0x4004031ad0 pc=0x4e6680
github.com/hajimehoshi/ebiten/internal/thread.(*Thread).Loop(0x4000010040, 0x7d9740, 0x4003d1b180)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/thread/thread.go:43 +0x2c fp=0x4004031ba0 sp=0x4004031b00 pc=0x4e6474
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).Run(0x9fa380, 0x7d8b40, 0xa35cc0, 0x7dcd40, 0xa362c0, 0x54ca30, 0x9fbe58)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/uidriver/glfw/ui.go:530 +0x178 fp=0x4004031c20 sp=0x4004031ba0 pc=0x53f7f0
github.com/hajimehoshi/ebiten.runGame(0x7d66c0, 0x40024d9c00, 0x3ff0000000000000, 0x10, 0x10)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/run.go:218 +0x9c fp=0x4004031c80 sp=0x4004031c20 pc=0x54cb74
github.com/hajimehoshi/ebiten.Run(0x4000080420, 0x500, 0x400, 0x3ff0000000000000, 0x400001a270, 0x22, 0x809eb59c4e89ac01, 0x4000080410)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/run.go:170 +0x128 fp=0x4004031cf0 sp=0x4004031c80 pc=0x54ca50
code.ur.gs/lupine/ordoor/internal/ui.(*Window).Run(0x4003d1b100, 0x4000080400, 0x4000080410, 0x4000104b10, 0x0)
        /home/lupine/dev/code.ur.gs/lupine/ordoor/internal/ui/window.go:94 +0xc4 fp=0x4004031d40 sp=0x4004031cf0 pc=0x67f70c
main.main()
        /home/lupine/dev/code.ur.gs/lupine/ordoor/cmd/view-map/main.go:110 +0x864 fp=0x4004031f50 sp=0x4004031d40 pc=0x68012c
runtime.main()
        /usr/lib/go-1.13/src/runtime/proc.go:203 +0x23c fp=0x4004031fd0 sp=0x4004031f50 pc=0x43a594
runtime.goexit()
        /usr/lib/go-1.13/src/runtime/asm_arm64.s:1128 +0x4 fp=0x4004031fd0 sp=0x4004031fd0 pc=0x46460c

goroutine 67 [chan receive]:
github.com/hajimehoshi/ebiten/internal/thread.(*Thread).Call(0x4000010040, 0x4001d18080, 0x400402db38, 0x4003e3803c)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/thread/thread.go:60 +0xc4
github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl.(*context).replacePixelsWithPBO(0xa36348, 0x500000004, 0x1000, 0x1000, 0x40097c0000, 0xad6, 0xc00)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/graphicsdriver/opengl/context_desktop.go:553 +0xa4
github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl.drawPixelsWithPBO(0x4001d18040, 0x40097c0000, 0xad6, 0xc00)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/graphicsdriver/opengl/pbo_desktop.go:37 +0x78
github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl.(*Image).ReplacePixels(0x4001d18040, 0x40097c0000, 0xad6, 0xc00)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/graphicsdriver/opengl/image.go:115 +0x60
github.com/hajimehoshi/ebiten/internal/graphicscommand.(*replacePixelsCommand).Exec(0x4006cedd40, 0x24, 0x0, 0x0)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/graphicscommand/command.go:443 +0x50
github.com/hajimehoshi/ebiten/internal/graphicscommand.(*commandQueue).Flush(0xa360a0)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/graphicscommand/command.go:265 +0x530
github.com/hajimehoshi/ebiten/internal/graphicscommand.FlushCommands(...)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/graphicscommand/command.go:294
github.com/hajimehoshi/ebiten/internal/restorable.ResolveStaleImages()
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/restorable/images.go:55 +0x30
github.com/hajimehoshi/ebiten/internal/shareable.EndFrame(0xa35cc0, 0x4003596240)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/shareable/image.go:546 +0x4c
github.com/hajimehoshi/ebiten/internal/buffered.EndFrame(...)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/buffered/image.go:43
github.com/hajimehoshi/ebiten.(*uiContext).Update(0xa35cc0, 0x4003596240, 0x0, 0x0)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/uicontext.go:240 +0x50
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).update(0x9fa380, 0x7d8b40, 0xa35cc0, 0x4e65dc, 0x400004be48)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/uidriver/glfw/ui.go:738 +0x1b8
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).loop(0x9fa380, 0x7d8b40, 0xa35cc0, 0x0, 0x0)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/uidriver/glfw/ui.go:784 +0xb0
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).run(0x9fa380, 0x7d8b40, 0xa35cc0, 0x0, 0x0)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/uidriver/glfw/ui.go:656 +0x220
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).Run.func1(0x4000080440, 0x40021187e0, 0x9fa380, 0x7d8b40, 0xa35cc0)
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/uidriver/glfw/ui.go:524 +0x88
created by github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).Run
        /home/lupine/go/pkg/mod/github.com/hajimehoshi/ebiten@v1.11.0-alpha.2.0.20200101150127-38815ba801a5/internal/uidriver/glfw/ui.go:521 +0x144

It's very much like creating one of the buffers fails, it doesn't notice, and then goes on to try to use it in glUnmapBuffer, now glBufferSubData, incorrectly.

It's feasible that the graphics driver isn't conforming to the error interface, I guess.

Master does seem to create more memory pressure generally - out of three runs of my test program, 2 gave the above stacktrace and one was killed by the linux oom-killer before it reached that stage.

@hajimehoshi hajimehoshi reopened this Jan 1, 2020
@hajimehoshi hajimehoshi changed the title graphicsdriver/opengl: glUnmapBuffer causes SEGV (memory allocation failed) on Pinebook Pro graphicsdriver/opengl: creating/modifying buffers causes OOM on Pinebook Pro Jan 1, 2020
@hajimehoshi
Copy link
Owner

Thanks. I agree master uses more memory than before due to buffers for pixels. The memory allocation happens on GPU side in general, but this depends on drivers and systems.

Let me think what to do...

@hajimehoshi
Copy link
Owner

It looks like a Pinebook is now out of stock :-/

@hajimehoshi hajimehoshi removed this from the v1.11.0 milestone Feb 9, 2020
@lupine
Copy link
Author

lupine commented Mar 18, 2020

I came back to this today and it looks like some combination of newer mesa/panfrost and/or ebiten has fixed it - I'm running successfully again on:

github.com/hajimehoshi/ebiten v1.11.0-alpha.2.0.20200101150127-38815ba801a5

So I'll close this :)

@lupine lupine closed this as completed Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants