OldNewMap handling of pointers in blenloader does not work correctly with FD_FLAGS_SWITCH_ENDIAN #81226
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#81226
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Linux/ppc64
Graphics card: llvmpipe
Blender Version
Broken: 2.83.4, master
Worked: ?
Short description of error
The functions switch_endian_bh4 and switch_endian_bh8 in readfile.c do not byteswap the "old" pointer field. In theory this is fine, as it is just used as an opaque handle, which is mapped to an actual pointer via the OldNewMap. However, in practice this does not work because it seems that the reference pointers to the object are byteswapped, and so if the pointer used as key to create the entry in the OldNewMap is not byteswapped as well, the values will not match and the lookup will fail.
This can easily fixed by just swapping the "old" pointer in the bh swapping functions. That also removes the need for the workaround in bh4_from_bh8. Please see the following patch:
blender.patch
Exact steps for others to reproduce the error
Added subscriber: @zeldin
Added subscribers: @JacquesLucke, @mano-wii
Thanks for the report, unfortunately I don't have a big endian 64-bit system to test.
@JacquesLucke, if I'm not mistaken, you worked in this area recently.
Do you know what's going on here?
Just last week I found this issue as well. My fix (which is essentially the same) is part of D9089.
@zeldin, can you provide a .blend file that has been saved on a big endian 64 bit system? Can you also check if D9089 fixes it for you?
@JacquesLucke Sure. Here you go:
untitled.blend
I'll try your patch later, need to make a new git checkout since the patch does not apply cleanly to 2.83.4. :-)
Thanks!
Did any older version of Blender work on your hardware?
Yes. The "?" in "Worked" just means that I can't remember what the version number was. :-)
Well, I can't say for sure that it was possible to load little endian .blend files from disk, but running it in BE worked fine.
This issue was referenced by
ffb220590e
This issue was referenced by
724a4f4676
Changed status from 'Needs Triage' to: 'Resolved'