Blender exit with code -6 with message Attempt to free NULL pointer. #70315

Closed
opened 2019-09-28 07:38:43 +02:00 by Hai Vu · 9 comments

System Information
Tested operating system:
* Ubuntu 16.04.6, GNU/Linux 4.4.0-161-generic x86_64
* macOS 10.14.6 Darwin 18.7.0
Tested graphics card and CPU:
* NVIDIA GTX 1080Ti, AMD Radeon RX580
* Any CPU

Blender Version
Broken: 2.79b and 2.80 downloaded from the Blender website.

Short description of error

Quit the Blender will produce exit code -6 with message Attempt to free NULL pointer.
This is the file which cause the error.

Exact steps for others to reproduce the error

* Open Blender in terminal (for logging purpose).
* Load [this file](https://1drv.ms/u/s!Au3cARgGkempgQFVBocpytFVWO0i?e=gQnheO).
* Open the the Image Viewer (which list all the images in the file) or just render the file (the render is normal).
* This line of log appear in the terminal: `IMB_ibImageFromMemory: NULL pointer`.
* Quit the blender, the program quits with exit code `-6` with this line of log (in terminal): `Attempt to free NULL pointer`.

If you render the file above on headless mode, no image is saved to the directory. This will make the flamenco render job failed if you are using Blender Cloud.

The bug may come the library called BGERTPS which is made for Blender Game Engine. [This function] (https:*github.com/martijnberger/blender/blob/master/source/blender/imbuf/intern/readimage.c#L104) produce the error above.

**System Information** Tested operating system: * Ubuntu 16.04.6, GNU/Linux 4.4.0-161-generic x86_64 * macOS 10.14.6 Darwin 18.7.0 Tested graphics card and CPU: * NVIDIA GTX 1080Ti, AMD Radeon RX580 * Any CPU **Blender Version** Broken: 2.79b and 2.80 downloaded from the Blender website. **Short description of error** Quit the Blender will produce exit code `-6` with message `Attempt to free NULL pointer`. This is [the file](https://1drv.ms/u/s!Au3cARgGkempgQFVBocpytFVWO0i?e=gQnheO) which cause the error. **Exact steps for others to reproduce the error** * Open Blender in terminal (for logging purpose). * Load [this file](https://1drv.ms/u/s!Au3cARgGkempgQFVBocpytFVWO0i?e=gQnheO). * Open the the Image Viewer (which list all the images in the file) or just render the file (the render is normal). * This line of log appear in the terminal: `IMB_ibImageFromMemory: NULL pointer`. * Quit the blender, the program quits with exit code `-6` with this line of log (in terminal): `Attempt to free NULL pointer`. If you render the file above on headless mode, no image is saved to the directory. This will make the flamenco render job failed if you are using Blender Cloud. The bug may come the library called [BGERTPS](https:*github.com/enjalot/BGERTPS) which is made for Blender Game Engine. [This function] (https:*github.com/martijnberger/blender/blob/master/source/blender/imbuf/intern/readimage.c#L104) produce the error above.
Author

Added subscriber: @aperture147

Added subscriber: @aperture147
Author
Another bug reference: https://blenderartists.org/t/e-cycles-faster-rendering-for-blender-2-79-to-2-81/1139717/2478?u=aperture147

Added subscriber: @mano-wii

Added subscriber: @mano-wii
Bastien Montagne was assigned by Germano Cavalcante 2019-09-30 21:10:20 +02:00

I can reproduce the problem.
Simply open and close the attached file.
I'm not sure what is causing this problem, but I suppose it involves data block management.

I can reproduce the problem. Simply open and close the attached file. I'm not sure what is causing this problem, but I suppose it involves data block management.

@mano-wii please investigate a minimum before assigning, that has again nothing to do with data management, that’s a mere corrupted .blend file.

@aperture147 we require a small and simple .blend file, not a 600MB one, and a way to reproduce the issue. Here your monster .blend is corrupted somehow, one of the packedfile struct gets a NULL data pointer when reading it, which is not supposed to happen ever. So unless you can provide us with a way to recreate such corruption, we won't be able to do anything to the root of the issue.

In the mean time, I’ll add some sanity checks in reading code to detect/cleanup such cases...

@mano-wii please investigate a minimum before assigning, that has again nothing to do with data management, that’s a mere corrupted .blend file. @aperture147 we require a **small** and **simple** .blend file, not a 600MB one, and a way to reproduce the issue. Here your monster .blend is corrupted somehow, one of the packedfile struct gets a NULL data pointer when reading it, which is not supposed to happen ever. So unless you can provide us with a way to recreate such corruption, we won't be able to do anything to the root of the issue. In the mean time, I’ll add some sanity checks in reading code to detect/cleanup such cases...

This issue was referenced by b1b4e00076

This issue was referenced by b1b4e0007663f3430754d522e888b8dedfc850f9

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author

Thanks for your quick fix! I'm trying to figure how the packedfile be NULL and I will send the result for you as soon as I can

Thanks for your quick fix! I'm trying to figure how the packedfile be NULL and I will send the result for you as soon as I can
Author

Hi guys, it's been a year and I've finally found the reason why. This blender file was generated by our system, grab all the files in the model library and pack them to a single file then render it. Lately we just figured out that there're a few of corrupted image (which is used as texture) with normal file header but have no data in it (a JPEG with only 1KB in size). I'm trying to find some sample files for you because another engineer in my team just cleaned up those files without my permission. Hope this description can help you to find some better way to fix this problem.

Hi guys, it's been a year and I've finally found the reason why. This blender file was generated by our system, grab all the files in the model library and pack them to a single file then render it. Lately we just figured out that there're a few of corrupted image (which is used as texture) with normal file header but have no data in it (a JPEG with only 1KB in size). I'm trying to find some sample files for you because another engineer in my team just cleaned up those files without my permission. Hope this description can help you to find some better way to fix this problem.
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
4 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#70315
No description provided.