Segfault in eglTerminate when glFramebufferTexture2DMultisampleEXT is used (EGL/OpenGL ES)

Calling eglTerminate after creating a framebuffer and attaching a texture to it using glFramebufferTexture2DMultisampleEXT (GL_EXT_multisampled_render_to_texture) causes a segfault.
The framebuffer is not used or rendered to and the reproducer is incredibly simple.

display = eglGetDisplay(0)
config = eglChooseConfig()
surface = eglCreateWindowSurface(display,config,…)
context = eglCreateContext(display,config,…)
eglMakeCurrent(display, surface, surface, context)
glGenTextures(1, &texture)
glBindTexture(GL_TEXTURE_2D, texture)
glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, 256, 256)
glGenFramebuffers(1, &framebuffer)
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer)
glFramebufferTexture2DMultisampleEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0, 1)
// glDeleteFramebuffers(1, &framebuffer)

Uncommenting the glDeleteFramebuffers call above works around the segfault although this call shouldn’t be required.
Unattaching “texture” from the framebuffer with “glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0)” also works around the segfault.
Avoiding the use of GL_EXT_multisampled_render_to_texture also works around the segfault.

Attached reproducer can be built with cmake:
cd multisampling
mkdir build
cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug …
cmake --build .

run the binary:

Operating system and platform details:
Ubuntu 20.04
NVIDIA GeForce RTX 2060
Driver version: 510.54

Program received signal SIGSEGV, Segmentation fault.
[34m0x00007ffff5cefb03[m in [33m??[m () from [32m/lib/x86_64-linux-gnu/[m
[?2004h[?2004l[?2004h(gdb) bt
#0 [34m0x00007ffff5cefb03[m in [33m??[m () from [32m/lib/x86_64-linux-gnu/[m
#1 [34m0x00007ffff59f1c6d[m in [33m??[m () from [32m/lib/x86_64-linux-gnu/[m
#2 [34m0x00007ffff5a300c6[m in [33m??[m () from [32m/lib/x86_64-linux-gnu/[m
#3 [34m0x00007ffff5a3169d[m in [33m??[m () from [32m/lib/x86_64-linux-gnu/[m
#4 [34m0x00007ffff59f7d0b[m in [33m??[m () from [32m/lib/x86_64-linux-gnu/[m
#5 [34m0x00007ffff59e37e8[m in [33m??[m () from [32m/lib/x86_64-linux-gnu/[m
#6 [34m0x00007ffff5cd89d3[m in [33m??[m () from [32m/lib/x86_64-linux-gnu/[m
#7 [34m0x00007ffff5cb71fe[m in [33m??[m () from [32m/lib/x86_64-linux-gnu/[m
#8 [34m0x00007ffff74a4c41[m in [33m??[m () from [32m/lib/x86_64-linux-gnu/[m
#9 [34m0x00007ffff74a4c89[m in [33m??[m () from [32m/lib/x86_64-linux-gnu/[m
#10 [34m0x00007ffff74979fa[m in [33m??[m () from [32m/lib/x86_64-linux-gnu/[m
#11 [34m0x00007ffff74a7c0d[m in [33m??[m () from [32m/lib/x86_64-linux-gnu/[m
#12 [34m0x00007ffff74973bf[m in [33m??[m () from [32m/lib/x86_64-linux-gnu/[m
#13 [34m0x00007ffff7497615[m in [33m??[m () from [32m/lib/x86_64-linux-gnu/[m
#14 [34m0x00007ffff74abe4b[m in [33m??[m () from [32m/lib/x86_64-linux-gnu/[m
#15 [34m0x0000555555557e8b[m in [33meglTerminate[m ([36mdpy[m=0x5555556669c0) at [multisampling/src/egl/dynamic.cpp[m:254
#16 [34m0x000055555559d141[m in [33mrun_thread0[m () at [multisampling/src/threads/0/thread0.cpp[m:153
#17 [34m0x000055555559c93c[m in [33mrun[m () at [multisampling/src/threads/run.cpp[m:10
#18 [34m0x0000555555599eb3[m in [33mmain[m ([36margc[m=1, [36margv[m=0x7fffffffde68) at [multisampling/src/platform/main.cpp[m:14 (482.3 KB)