ModifyAnimFrames and SetAnimFrameDelay trouble

Report any Hollywood bugs here

ModifyAnimFrames and SetAnimFrameDelay trouble

Postby jPV » Thu Mar 30, 2017 5:49 pm

My program started to be quite crashy (real crashes, not just exits on errors), and I had to do some hunting what's going on.

It seems that if I add frames to animation with ModifyAnimFrames and then modify delays of the added frames with SetAnimFrameDelay, there happens some nasty things when freeing that animation (manually or at program exit). It can be catched with Wipeout too.

It doesn't happen if you change delays of loaded and non-edited animations, and it doesn't happen with the frames created with CreateAnim (or actually I haven't tried to create multiple frames with it, but at least doesn't happen with single frame animation).

Code: Select all
@BRUSH 1, "Hollywood:Examples/Hollywood/3DCube/01.jpg"

; Just checking different things first for comparison:
CreateAnim(1,1,GetAttribute(#BRUSH,1,#ATTRWIDTH),GetAttribute(#BRUSH,1,#ATTRHEIGHT),1,1)
SetAnimFrameDelay(1,1,40)
NPrint("Press lmb to free the single frame anim (with delay)")
WaitLeftMouse
FreeAnim(1)
NPrint("Done without problems.")
CreateAnim(1,1,GetAttribute(#BRUSH,1,#ATTRWIDTH),GetAttribute(#BRUSH,1,#ATTRHEIGHT),1,1)
ModifyAnimFrames(1,1)
NPrint("Press lmb to free the two frames anim (without delay)")
WaitLeftMouse
FreeAnim(1)
NPrint("Done without problems.")

; Then the problematic part:
CreateAnim(1,1,GetAttribute(#BRUSH,1,#ATTRWIDTH),GetAttribute(#BRUSH,1,#ATTRHEIGHT),1,1)
ModifyAnimFrames(1,1)
SetAnimFrameDelay(1,2,40) ; Adding delay to the added frames causes problems!
NPrint("Press lmb to free the two frames anim (with delay)")
WaitLeftMouse
FreeAnim(1)
NPrint("Done with a wipeout hit.")
WaitLeftMouse


Wipeout hit:
Code: Select all
--- 20170330 18:27:22 ---
Wipeout -- Traces and munges memory and detects memory trashing
Written by Olaf `Olsen' Barthel <olsen@sourcery.han.de>
Public Domain

MorphOS port by Ilkka Lehtoranta, Harry Sintonen and Ralph Schmidt

Munging memory... done (30-Mar-17 18:27:22).
--- 20170330 18:27:34 ---

WIPEOUT HIT
30-Mar-17 18:27:34
Back wall was stomped upon
Name: "Background CLI"  CLI: "hollywood"
CallerStack[0] 0x208e2ad8 at hollywood Hunk 1 Offset 0x00163a18
------------------------------------------------------------------------------
0x20b2974c = AllocVec(4,...)
Created on 30-Mar-17 18:27:32
        by task 0x1ef29ff8
CallerStack[0] 0x208e2a9c at hollywood Hunk 1 Offset 0x001639dc
CallerStack[1] 0x20816870 at hollywood Hunk 1 Offset 0x000977b0
CallerStack[2] 0x20817598 at hollywood Hunk 1 Offset 0x000984d8
CallerStack[3] 0x208679bc at hollywood Hunk 1 Offset 0x000e88fc
CallerStack[4] 0x2087ec50 at hollywood Hunk 1 Offset 0x000ffb90
CallerStack[5] 0x20867f24 at hollywood Hunk 1 Offset 0x000e8e64
CallerStack[6] 0x208630e0 at hollywood Hunk 1 Offset 0x000e4020
CallerStack[7] 0x208670b4 at hollywood Hunk 1 Offset 0x000e7ff4
CallerStack[8] 0x20867194 at hollywood Hunk 1 Offset 0x000e80d4
CallerStack[9] 0x20862de4 at hollywood Hunk 1 Offset 0x000e3d24
CallerStack[10] 0x2079dddc at hollywood Hunk 1 Offset 0x0001ed1c
CallerStack[11] 0x208e8694 at hollywood Hunk 1 Offset 0x001695d4
CallerStack[12] 0x207898f0 at hollywood Hunk 1 Offset 0x0000a830
CallerStack[13] 0x208e29a8 at hollywood Hunk 1 Offset 0x001638e8
CallerStack[14] 0x2077f590 at hollywood Hunk 1 Offset 0x000004d0
CallerStack[15] 0x2077f428 at hollywood Hunk 1 Offset 0x00000368
------------------------------------------------------------------------------
4 byte(s) stomped (0x20b29750..0x20b29753), allocation+1 byte(s), FillChar 0xc7
20b29750: 00000028........................         ...(............
User avatar
jPV
 
Posts: 85
Joined: Sat Mar 26, 2016 11:44 am
Location: RNO

Re: ModifyAnimFrames and SetAnimFrameDelay trouble

Postby airsoftsoftwair » Fri Mar 31, 2017 1:40 pm

Thanks for the report, I'll look into this soon.
User avatar
airsoftsoftwair
 
Posts: 2233
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: ModifyAnimFrames and SetAnimFrameDelay trouble

Postby airsoftsoftwair » Thu Apr 27, 2017 6:29 pm

Code: Select all
- Fix: ModifyAnimFrames() didn't adapt the internal delay table which could lead to memory faults
  when trying to modify or query delay values of newly added frames
User avatar
airsoftsoftwair
 
Posts: 2233
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany


Return to Hollywood bugs

Who is online

Users browsing this forum: No registered users and 1 guest