Solved Blender 4.1 memory fault on 14.1

I recently upgraded FreeBSD 13.2 to 14.1 and upgraded all the installed applications, including graphics/blender. So far everything works fine, except for blender:

> blender
Writing: /tmp/blender.crash.txt
Memory fault

> cat /tmp/blender.crash.txt
# Blender 4.1.1, Commit date: 1970-01-01 00:00, Hash unknown

# backtrace
0x203c709 <???> at /usr/local/bin/blender-bin
0x17ec777 <???> at /usr/local/bin/blender-bin
0x82cee9410 <pthread_sigmask+0x540> at /lib/libthr.so.3
0x82cee89cb <pthread_setschedparam+0x84b> at /lib/libthr.so.3
0x8260802d3 <???> at ???
0x20d1e19 <aligned_free+0x44129> at /usr/local/bin/blender-bin
0x20d1a0d <aligned_free+0x43d1d> at /usr/local/bin/blender-bin
0x20915c3 <aligned_free+0x38d3> at /usr/local/bin/blender-bin
0x20a8343 <aligned_free+0x1a653> at /usr/local/bin/blender-bin
0x20b4b27 <aligned_free+0x26e37> at /usr/local/bin/blender-bin
0x17e82a4 <???> at /usr/local/bin/blender-bin
0x82b11ca6a <__libc_start1+0x12a> at /lib/libc.so.7

I get the same result if built from ports or installed with pkg. Does anyone have any ideas about how to get past this? If more information is needed I can supply it.

Regards,

Denver
 
Yes, I should have mentioned that. I had a similar problem a long time ago that I got around by using MESA_GL_VERSION_OVERRIDE=4.1, but that doesn't fix this one.

I have some additional information:
> blender --debug-all
Switching to fully guarded memory allocator.
graph_id_tag_update: id=SCScene flags=BASE_FLAGS source=USER_EDIT
graph_id_tag_update: id=GRScene Collection flags=GEOMETRY, ID_RECALC_HIERARCHY source=USER_EDIT
DEG_relations_tag_update: Tagging relations for update.
graph_id_tag_update: id=GRScene Collection flags=GEOMETRY, ID_RECALC_HIERARCHY source=USER_EDIT
graph_id_tag_update: id=GRCollection flags=GEOMETRY, ID_RECALC_HIERARCHY source=USER_EDIT
graph_id_tag_update: id=GROVERRIDE_RESYNC_LEFTOVERS flags=GEOMETRY, ID_RECALC_HIERARCHY source=USER_EDIT
graph_id_tag_update: id=GRScene Collection flags=COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=SCScene flags=COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=GRCollection flags=COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=GROVERRIDE_RESYNC_LEFTOVERS flags=COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=GRScene Collection flags=GEOMETRY, ID_RECALC_HIERARCHY source=USER_EDIT
graph_id_tag_update: id=GRCollection flags=GEOMETRY, ID_RECALC_HIERARCHY source=USER_EDIT
graph_id_tag_update: id=GROVERRIDE_RESYNC_LEFTOVERS flags=GEOMETRY, ID_RECALC_HIERARCHY source=USER_EDIT
graph_id_tag_update: id=GRScene Collection flags=COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=SCScene flags=COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=GRCollection flags=COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=GROVERRIDE_RESYNC_LEFTOVERS flags=COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=GRScene Collection flags=GEOMETRY, ID_RECALC_HIERARCHY source=USER_EDIT
graph_id_tag_update: id=GRCollection flags=GEOMETRY, ID_RECALC_HIERARCHY source=USER_EDIT
graph_id_tag_update: id=GROVERRIDE_RESYNC_LEFTOVERS flags=GEOMETRY, ID_RECALC_HIERARCHY source=USER_EDIT
graph_id_tag_update: id=GRScene Collection flags=COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=SCScene flags=COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=GRCollection flags=COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=GROVERRIDE_RESYNC_LEFTOVERS flags=COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=GRScene Collection flags=TRANSFORM, GEOMETRY, COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=SCScene flags=TRANSFORM, GEOMETRY, COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=SCScene flags=TRANSFORM, GEOMETRY, COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=GRScene Collection flags=GEOMETRY, ID_RECALC_HIERARCHY source=USER_EDIT
graph_id_tag_update: id=GRCollection flags=GEOMETRY, ID_RECALC_HIERARCHY source=USER_EDIT
graph_id_tag_update: id=GROVERRIDE_RESYNC_LEFTOVERS flags=GEOMETRY, ID_RECALC_HIERARCHY source=USER_EDIT
graph_id_tag_update: id=GRScene Collection flags=COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=SCScene flags=COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=GRCollection flags=COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=GROVERRIDE_RESYNC_LEFTOVERS flags=COPY_ON_WRITE source=USER_EDIT
DEG_relations_tag_update: Tagging relations for update.
DEG_relations_tag_update: Tagging relations for update.
DEG_relations_tag_update: Tagging relations for update.
graph_id_tag_update: id=GRScene Collection flags=GEOMETRY, ID_RECALC_HIERARCHY source=USER_EDIT
graph_id_tag_update: id=GRCollection flags=GEOMETRY, ID_RECALC_HIERARCHY source=USER_EDIT
graph_id_tag_update: id=GRScene Collection flags=COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=SCScene flags=COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=GRCollection flags=COPY_ON_WRITE source=USER_EDIT
Received X11 Error:
error code: 170
request code: 152
minor code: 0
error text: GLXBadFBConfig
Received X11 Error:
error code: 170
request code: 152
minor code: 0
error text: GLXBadFBConfig
Received X11 Error:
error code: 170
request code: 152
minor code: 0
error text: GLXBadFBConfig
Received X11 Error:
error code: 170
request code: 152
minor code: 0
error text: GLXBadFBConfig
Writing: /tmp/blender.crash.txt
Memory fault

I'm not sure what GLXBadFBConfig means. glxgears from mesa-demos works fine. So does OpenSCAD, FreeCAD, Prusa Slicer, and mvp. Those are about all the graphics intensive applications I have installed. I haven't switched to a vt console and back to X.

Thanks,

Denver
 
Just wild guess: could this be related to W^X (sysctl kern.elf64.allow_wx)? IIRC, the default since FreeBSD 14 is 0 (disabled).
 
Apparently not, it's 1 on my system. I did try setting it to 0, but that didn't change anything.
 
One way to test if it is graphics related (and a potential solution if you don't mind a slow experience and a warm PC!):

$ LIBGL_ALWAYS_SOFTWARE=1 blender

This will run Blender with the LLVMpipe software renderer. Amazingly fast for a software renderer but still quite lacking compared to hardware acceleration. But the main thing is it bypasses a lot of the complex hardware stack so should help to isolate what part is at fault.
 
I had started looking into that GLXBadFBConfig error, but got distracted and never got back to it. Here's what I've figured out:
1. Blender 4.1 requires OpenGL version at least 4.3
2. My system reports 4.2
3. Another system I have, with Radeon graphics, where blender 4.1 works reports 4.5

Currently I'm in the process of building blender 3.6, which is going to take a while. I've had to turn off a couple options, but they aren't things I normally use. I also have a note in my rc.conf file about using the intel driver in /boot/modules instead of the one from ports. That note is pretty old, so when I get a chance I'll see if the driver from ports provides a newer OpenGL version. Otherwise I can retire this hardware, use kpedersen's suggestion with 4.1, or just keep using 3.6 for now. Blender 3.6 would be OK, at least for a while.

Thanks everyone for your help and suggestions.

Denver
 
Back
Top