POV-Ray : Newsgroups : povray.bugreports : Animations. malloc(): unsorted double linked list corrupted Server Time
8 Apr 2025 16:48:44 EDT (-0400)
  Animations. malloc(): unsorted double linked list corrupted (Message 1 to 5 of 5)  
From: William F Pokorny
Subject: Animations. malloc(): unsorted double linked list corrupted
Date: 6 Apr 2025 03:09:38
Message: <67f228b2$1@news.povray.org>
Posting as a hook so others who might see this failure can find it and 
provide information.

If you have seen this issues or have just hit it, please post here - 
along with environment, running conditions, frequency, etc.

---

In the last six months or so I've been using the animation facilities in 
POV-Ray (yuqk) more than ever. Sometimes to create actual animations, 
but more often as a way to explore feature options. Or, as with the 
text{} object recently, to run down some crash already, infrequently, 
seen in non-animation (single frame/image) renders.

Today, for the second time in the last month, I had a long running 
animation core dump with a "malloc(): unsorted double linked list 
corrupted" error(*). Both times the animation frames, rendering was 
working in the background while I was doing other interactive work. Both 
times the animation completed without issue once resumed.

I'm kicking off some intentionally long running (many frame) dummy 
animations trying to trip this error while running my debug compile. I'm 
hoping to capture an annotated core dump file. Maybe I'll get lucky, but 
I doubt it. I guess something like valgrind an option - if I find myself 
really motivated.

---

Linux. x86-64. My yuqk, v3.8 based fork releases R19 and working state, 
R20 code. Both times the scenes were small - with memory requirements 
<100MB.

lsb_release -a :
     No LSB modules are available.
     Distributor ID: Ubuntu
     Description:    Ubuntu 24.04.2 LTS
     Release:        24.04
     Codename:       noble
g++ --version : g++ (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
ldd --version : ldd (Ubuntu GLIBC 2.39-0ubuntu8.4) 2.39
uname -r      : 6.8.0-57-generic

Bill P.

(*) - The error message comes from glibc prior to things crashing.


Post a reply to this message

From: Thorsten
Subject: Re: Animations. malloc(): unsorted double linked list corrupted
Date: 6 Apr 2025 08:44:23
Message: <67f27727$1@news.povray.org>
Hi,

If it is indeed a bug, you should be able to reproduce it if you enable 
memory debugging by defining the various macros in pov_mem.cpp (in 
particular MEM_GUARD) when compiling POV-Ray.

The other, and more likely, option - if this only occurs during long 
renders - may very well be memory corruption due to overheating 
problems. Nowadays this also tends to be a problem for memory due to 
overall heat being generated.

Thorsten

On 06.04.2025 09:09, William F Pokorny wrote:
> Posting as a hook so others who might see this failure can find it and 
> provide information.
> 
> If you have seen this issues or have just hit it, please post here - 
> along with environment, running conditions, frequency, etc.
> 
> ---
> 
> In the last six months or so I've been using the animation facilities in 
> POV-Ray (yuqk) more than ever. Sometimes to create actual animations, 
> but more often as a way to explore feature options. Or, as with the 
> text{} object recently, to run down some crash already, infrequently, 
> seen in non-animation (single frame/image) renders.
> 
> Today, for the second time in the last month, I had a long running 
> animation core dump with a "malloc(): unsorted double linked list 
> corrupted" error(*). Both times the animation frames, rendering was 
> working in the background while I was doing other interactive work. Both 
> times the animation completed without issue once resumed.
> 
> I'm kicking off some intentionally long running (many frame) dummy 
> animations trying to trip this error while running my debug compile. I'm 
> hoping to capture an annotated core dump file. Maybe I'll get lucky, but 
> I doubt it. I guess something like valgrind an option - if I find myself 
> really motivated.
> 
> ---
> 
> Linux. x86-64. My yuqk, v3.8 based fork releases R19 and working state, 
> R20 code. Both times the scenes were small - with memory requirements 
> <100MB.
> 
> lsb_release -a :
>      No LSB modules are available.
>      Distributor ID: Ubuntu
>      Description:    Ubuntu 24.04.2 LTS
>      Release:        24.04
>      Codename:       noble
> g++ --version : g++ (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
> ldd --version : ldd (Ubuntu GLIBC 2.39-0ubuntu8.4) 2.39
> uname -r      : 6.8.0-57-generic
> 
> Bill P.
> 
> (*) - The error message comes from glibc prior to things crashing.


Post a reply to this message

From: William F Pokorny
Subject: Re: Animations. malloc(): unsorted double linked list corrupted
Date: 7 Apr 2025 08:15:44
Message: <67f3c1f0$1@news.povray.org>
On 4/6/25 08:44, Thorsten wrote:
> If it is indeed a bug, you should be able to reproduce it if you enable 
> memory debugging by defining the various macros in pov_mem.cpp (in 
> particular MEM_GUARD) when compiling POV-Ray.
> 
> The other, and more likely, option - if this only occurs during long 
> renders - may very well be memory corruption due to overheating 
> problems. Nowadays this also tends to be a problem for memory due to 
> overall heat being generated.

Thank you for the information. I'd not considered overheating as a 
potential cause.

I spent some time earlier this morning looking at the C style memory 
handling I could find in the source code - as well as what in particular 
was using code from pov_mem.cpp.

Other than functions, which were common to both animations which 
crashed, I wasn't using much beyond the povms code(*). There are still 
too some allocations and frees to set up for possible blobs around the 
rendering of each frame, for example.

My dummy long animation renders have all finished clean. I'll try to get 
a MEM_GUARD build going today and run more of those.

Bill P.

(*) - I found that the messaging code doesn't use the pov_mem versions, 
but rather raw C malloc(), realloc() and free().


Post a reply to this message

From: William F Pokorny
Subject: Re: Animations. malloc(): unsorted double linked list corrupted
Date: 7 Apr 2025 15:25:12
Message: <67f42698$1@news.povray.org>
On 4/7/25 08:15, William F Pokorny wrote:
> I'll try to get a MEM_GUARD build going today and run more of those.

Update.

A build with MEM_GUARD and MEM_TAG defined just finished a second long 
set of animation frames. No warnings or errors. I tried a handful of 
still frame scenes and they too ran clean.

I'll run a few more animation sequences overnight and then, unless 
something goes boom, I'll likely pause the chase. It's not failing often 
enough at present for me to give it a high priority.

Bill P.


Post a reply to this message

From: Thorsten
Subject: Re: Animations. malloc(): unsorted double linked list corrupted
Date: 8 Apr 2025 08:30:09
Message: <67f516d1$1@news.povray.org>
On 07.04.2025 14:15, William F Pokorny wrote:
> (*) - I found that the messaging code doesn't use the pov_mem versions, 
> but rather raw C malloc(), realloc() and free().

Yes, it needs memory allocation outside the main code because it must be 
able to handle low and out of memory conditions.

On Linux it may also be that the C++ library calls malloc for handling 
new. There used to be overrides for new/delete somewhere that could use 
the POV-Ray internal memory allocation functions, but they may since 
have been removed. If so, you can always use Memcheck from Valgrind.

Thorsten


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.