(Again) makesdna crashes during the build with LTO on s390x architecture (Linux) : #93425
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
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, Assets & 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
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
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
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
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#93425
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
As the original bug https://developer.blender.org/T80639 is already closed, creating new bug - but this time detailed analysis is added.
System Information
Operating system: Linux (Fedora)
Graphics card: N/A
Blender Version
Broken: 2.90 and master
Worked: without link time optimization (LTO)
Short description of error
makesrna crashes during the build with enabled LTO. See https://bugzilla.redhat.com/show_bug.cgi?id=1874398#c6
Linux distribution like Fedora have enabled LTO by default (https://fedoraproject.org/wiki/LTOByDefault) exposing the failure.
Exact steps for others to reproduce the error
Yes, it does happen with blender 2.90 as well. I believe this is another case when enabled LTO reveals some real bug in the source code.
build output
running under gdb gives:
Added subscriber: @mtasaka
So the backtrace shows that:
Then I tried debugging where failure happened in init_structDNA(). Then:
*r_error_message = "TLEN error in SDNA file";
*r_error_message = "TYPE error in SDNA file";
line is executed. That means that at the line*data == MAKE_ID('T', 'L', 'E', 'N')
if (*data == MAKE_ID('T', 'Y', 'P', 'E'))
, the 'data' pointer didn't point to the expected address.'MAKE_ID('T', 'L', 'E', 'N')'MAKE_ID('T', 'Y', 'P', 'E')
address.cp = pad_up_4(cp);
, before this line is executed, cp points to the expected address (compared to x86_64 results), but after this line is executed, on x86_64 cp is moved to the expected address, but on s390x, the pointer "cp" does not move compared before this line is executed.So: finally, this means that pad_up_4() is not doing what is expected here. Looking at pad_up_4(), this is to round up the given address to 4-byte aligned address - so this means that the given sdna->data is at first expected to be 4-byte aligned. But actually on s390x, it is found that sdna->data is only 2 bytes aligned, but not 4 bytes aligned.
By the way,
So looking at makesdna.c: in main():
DNAstr is only defined as const unsigned char buffer. The alignment requirement for char buffer is only 1 byte on all architecture, so there is no guarantee that DNAstr is put as 4 bytes aligned - this is up to linker or so. On x86_64, it seems that DNAstr is always put on 4 bytes aligned address, but it seems on s390x + LTO (link time optimization), linker + something else seems to put DNAstr on only 2 bytes aligned address - and AFAIK we cannot complain about this.
So the correct way is perhaps force DNAstr to be put on 4 bytes-aligned address - this is toolchain-dependent method.
0001-Fix-#93425-makesdna-force-DNAstr-to-be-4-bytes-align.patch
Suggestion patch
Added subscriber: @PratikPB2123
Oops.. actually the executed line was
*r_error_message = "TYPE error in SDNA file";
, corrected.Added subscribers: @ideasman42, @iss
@mtasaka Sorry for late answer, not sure if this is still an issue, but I would suggest to send patch via https://developer.blender.org/differential/diff/create/ (or big submit code addon on main page on this site)
CC @ideasman42
This issue was referenced by
2d429bfdf8
(Again) makesrna crashes during the build with LTO on s390x architecture (Linux) :to (Again) makesdna crashes during the build with LTO on s390x architecture (Linux) :Changed status from 'Needs Triage' to: 'Resolved'