Crash and file corruption after calc_normals_split, calc_tessface execution. #44461

Closed
opened 2015-04-20 17:30:53 +02:00 by Alexander Romanov · 21 comments

System Information
Ubuntu 12.04 and Debian Squeeze

Blender Version
Broken: 2.74 official release build

Short description of error
UVMap disappears; sometime Blender crashes

Exact steps for others to reproduce the error
I did not succeed to reproduce the full algorithm of the blend file creation, but attached a prepared one. It has been created and edited in previous Blender versions, but strange behavior appeared in 2.74, when I tried to use python API for split normals.
The file attached here has script for reproducing this behavior.
Tested official blender-2.74-linux-glibc211-x86_64 on Ubuntu 14.04.2 LTS and Debian squeeze

  1. If I call calc_normals_split on active object, something happens with UVMap_0: it dissapears from "UV Maps" panel when mouse cursor drag over it. Sometimes Blender crashes.
  2. If I call calc_tessface, blender crashes.

If after point 1) you save the file and reopen it, the names of UVMaps will change.

Alexander (Blend4Web Team)
crash.blend

**System Information** Ubuntu 12.04 and Debian Squeeze **Blender Version** Broken: 2.74 official release build **Short description of error** UVMap disappears; sometime Blender crashes **Exact steps for others to reproduce the error** I did not succeed to reproduce the full algorithm of the blend file creation, but attached a prepared one. It has been created and edited in previous Blender versions, but strange behavior appeared in 2.74, when I tried to use python API for split normals. The file attached here has script for reproducing this behavior. Tested official blender-2.74-linux-glibc211-x86_64 on Ubuntu 14.04.2 LTS and Debian squeeze 1) If I call calc_normals_split on active object, something happens with UVMap_0: it dissapears from "UV Maps" panel when mouse cursor drag over it. Sometimes Blender crashes. 2) If I call calc_tessface, blender crashes. If after point 1) you save the file and reopen it, the names of UVMaps will change. Alexander (Blend4Web Team) [crash.blend](https://archive.blender.org/developer/F164635/crash.blend)
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Bastien Montagne was assigned by Alexander Romanov 2015-04-20 17:30:53 +02:00
Author
Member

Added subscriber: @AlexanderRomanov

Added subscriber: @AlexanderRomanov

Hrrrrrm… With this file and a release build, I have no issue at all, cannot reproduce your crash. However, when trying to open it in a debug build with asan enabled, it crashes on reading. This means that the file itself is corrupted. And we cannot do much with a corrupted file, what we need in those cases is a way to reproduce such corruption - bug is here, not in a later crash.

So I need steps to reproduce that file.

Hrrrrrm… With this file and a release build, I have no issue at all, cannot reproduce your crash. However, when trying to open it in a debug build with asan enabled, it crashes on reading. This means that the file itself is corrupted. And we cannot do much with a corrupted file, what we need in those cases is a way to reproduce such corruption - bug is here, not in a later crash. So I need steps to reproduce that file.

Added subscriber: @EvgenyRodygin

Added subscriber: @EvgenyRodygin

This bug is reproduced only on Linux. It was tested on Ubuntu, Debian, Arch. The interesting thing is that if we build Blender by our own, crash disappears. Probably, some issues with Linux libraries?

This bug is reproduced only on Linux. It was tested on Ubuntu, Debian, Arch. The interesting thing is that if we build Blender by our own, crash disappears. Probably, some issues with Linux libraries?

I’m on linux too… But again, the issue is not in the crash itself - a corrupted file is likely to crash sooner or later. I need to know how to generate such a corrupted file, otherwise there’s nothing we can do.

I’m on linux too… But again, the issue is not in the crash itself - a corrupted file is likely to crash sooner or later. I need to know how to **generate** such a corrupted file, otherwise there’s nothing we can do.

Added subscriber: @AlexKowel

Added subscriber: @AlexKowel

Thanks for your answer. Unfortunately the problem is not just with the single corrupted file. Some of Blend4Web demos are affected too. In Blend4Web SDK we have hundreds of files, so it would be very helpful to have some method to know if the file is corrupted or not, and another method to fix the issue. Our guys will look at this in details, but I fear some really bad things just have happened.

Thanks for your answer. Unfortunately the problem is not just with the single corrupted file. Some of Blend4Web demos are affected too. In Blend4Web SDK we have hundreds of files, so it would be very helpful to have some method to know if the file is corrupted or not, and another method to fix the issue. Our guys will look at this in details, but I fear some really bad things just have happened.

Knowing if the file is corrupted is pretty simple (assuming it has similar corruption to the one you posted here): just build a debug version of Blender with asan enabled (on linux or OSX, using gcc or clang, see http://wiki.blender.org/index.php/Dev:Doc/Tools/Debugging/GCC_Address_Sanitizer), it will crash on loading the file (complaining about reading past allocated memory or so iirc).

Knowing if the file is corrupted is pretty simple (assuming it has similar corruption to the one you posted here): just build a debug version of Blender with asan enabled (on linux or OSX, using gcc or clang, see http://wiki.blender.org/index.php/Dev:Doc/Tools/Debugging/GCC_Address_Sanitizer), it will crash on loading the file (complaining about reading past allocated memory or so iirc).

Thank you for your help. By using custom Blender build and simple script we have discovered approx. 10 corrupted scenes. Now we are looking for solution to fix them. Anyway, is it possible to perform (implement) an automatic validation for loaded/saved data in the future?

Thank you for your help. By using custom Blender build and simple script we have discovered approx. 10 corrupted scenes. Now we are looking for solution to fix them. Anyway, is it possible to perform (implement) an automatic validation for loaded/saved data in the future?

The thing is, such corruption should never happens, we cannot check for validity (as in, length of data arrays etc.) of data chunks in .blend file when loading, would be heavy and not much helpful.

The bug here is the generation of such corrupted file - if you cannot give us a way to reproduce that, afraid we can’t do anything… :/

The thing is, such corruption should *never* happens, we cannot check for validity (as in, length of data arrays etc.) of data chunks in .blend file when loading, would be heavy and not much helpful. The bug here is the generation of such corrupted file - if you cannot give us a way to reproduce that, afraid we can’t do anything… :/
Author
Member

The new attached file has no asan messages when opened. After the steps bellow, asan shows heap-buffer-overflow.

  1. open .blend
  2. run the script
  3. save the file
  4. reopen the file
  5. run the script again
  6. save the file again
  7. Try to reopen. I have heap-buffer-overflow

script:

import bpy

d = bpy.data.objects['sunglasses'].data
d.calc_normals_split()

sunglasses_asan.blend

The new attached file has no asan messages when opened. After the steps bellow, asan shows heap-buffer-overflow. 1) open .blend 2) run the script 3) save the file 4) reopen the file 5) run the script again 6) save the file again 7) Try to reopen. I have heap-buffer-overflow script: ``` import bpy d = bpy.data.objects['sunglasses'].data d.calc_normals_split() ``` [sunglasses_asan.blend](https://archive.blender.org/developer/F165737/sunglasses_asan.blend)

Thanks, will check later.

Thanks, will check later.

Has been hard, but found the issue. It’s not really related to lnors actually, it was a bug hidden deep in how cd layers are saved (written) - basically, when temp/nofree layers were removed for saving, mesh would still write org number of layers, instead of updated (reduced) new one…

Note that fix will solve corruption of data itself, but cannot do anything for files already broken. :|

Anyway, thanks a bunch for the report!

Has been hard, but found the issue. It’s not really related to lnors actually, it was a bug hidden deep in how cd layers are saved (written) - basically, when temp/nofree layers were removed for saving, mesh would still write org number of layers, instead of updated (reduced) new one… Note that fix will solve corruption of data itself, but cannot do anything for files already broken. :| Anyway, thanks a bunch for the report!

This issue was referenced by f75c89b3f4

This issue was referenced by f75c89b3f42ffac51603e6e53459f9d94a8782cc

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit f75c89b3f4.

Closed by commit f75c89b3f4.
Author
Member

It works! Thank you!

It works! Thank you!

Added subscriber: @AngusHollands-4

Added subscriber: @AngusHollands-4

In the interests of partial recovery of corrupted files, is it possible to abort loading of corrupted data blocks, such that only unmodified assets are loaded?

In the interests of partial recovery of corrupted files, is it possible to abort loading of corrupted data blocks, such that only unmodified assets are loaded?
Author
Member

As I understand, aborting of any block loading is impossible because you can't know the offset of the next block without reading of previous block. And even if it is possible, generally, there is a non trivial issue to avoid broken links.

As I understand, aborting of any block loading is impossible because you can't know the offset of the next block without reading of previous block. And even if it is possible, generally, there is a non trivial issue to avoid broken links.
Sign in to join this conversation.
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
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#44461
No description provided.