Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Program crashes hard with error messages
#1
I'm making an animated Christmas card to post next month, having serious crash-outs with it, so I guess I'll have to post it early to get help so I can continue working on the card.   It compiles ok, but when the program finishes running, or when you press a key to quit, it hangs up.  I have to use task manager to kill it, and it gives the following 2 Alert error messages boxes:

"Alert"
"list_add: failed to allocate new buffer, structure size:"

...and after closing that one, the next box pops up....

"Alert"
"116"

Here's the BAS code so you can try it.  Merry Christmas early...

- Dav


.bas   DavXmas2022.bas (Size: 189.1 KB / Downloads: 126)

Find my programs here in Dav's QB64 Corner
Reply
#2
Umm....   My apologies, @Dav.   I don't think I'll be able to help debug this one for you!   Sad

Not that I don't want to help, but the problem is:  It's running just fine and closing without a single glitch on my PC!  O_o!

How the heck can I debug what's running and playing perfectly???
Reply
#3
You guys might want to open task manager and compare memory usage. Sometimes an over use of memory on a lower memory system can cause these types of problems. Just a guess.

Pete
Reply
#4
(11-18-2022, 09:54 PM)Pete Wrote: You guys might want to open task manager and compare memory usage. Sometimes an over use of memory on a lower memory system can cause these types of problems. Just a guess.

Pete

Doubt it's that.  Dav's program here has one of the nicest QB64 footprints that I've seen for a while.  The hardware images help keep mem usage down.


[Image: image.png]
Reply
#5
Dav did mention in another post "Windows 7 is still my main OS on my Laptop..." There are Win 7 32-bit OS's, so if Dav is running it on a 32-bit system, maybe that's the difference. If he has a 64-bit Win 7, I would doubt there would be any difference.

Pete
Reply
#6
Thanks for testing it.  I went away on a gig, came back home, turned the PC back on, it ran fine.  Thought it must have been just some Windows gremlins.  So I started playing with it again and the error came back after I added below - I wanted the snow to keep falling after exiting the main DO/LOOP.  I noticed the error messages will go away if you add a _DISPLAY in that loop, like there should be, but without it the program cannot terminate regularly.

- Dav

EDIT: Pete, that's correct - I'm running Win7 32-bit.

Try adding this on line#148 before the SYSTEM call and see what happens when you try to exit:

Code: (Select All)
DO
    'update the flakes
    FOR f = 1 TO flakes
        _PUTIMAGE (flake.x(f), flake.y(f))-STEP(30 * flake.s(f), 30 * flake.s(f)), snows(flake.a(f))
        flake.y(f) = flake.y(f) + flake.ys(f) 'lower y position
        'if flake goes off screen below , make a new flake above
        IF flake.y(f) > _HEIGHT + (flake.s(f) * 8) THEN flake.y(f) = RND * _HEIGHT - _HEIGHT - (flake.s(f) * 8)
        'move all flakes left
        flake.x(f) = flake.x(f) - 1.5
        'if it goes off screen, make a new flake on right
        IF flake.x(f) < -(flake.s(f) * 8) THEN flake.x(f) = RND * _WIDTH + _HEIGHT + (flake.s(f) * 8)
        'drift flakes a little left or right sometimes...
        IF INT(RND * 3) = 1 THEN flake.x(f) = flake.x(f) - (flake.s(f) / 1.4)
        IF INT(RND * 3) = 2 THEN flake.x(f) = flake.x(f) + (flake.s(f) / 1.4)
    NEXT
    IF INKEY$ <> "" THEN END
LOOP

Find my programs here in Dav's QB64 Corner
Reply
#7
Seems to me that the glitch would be right here:

Code: (Select All)
        _PutImage (flake.x(f), flake.y(f))-Step(30 * flake.s(f), 30 * flake.s(f)), snows(flake.a(f))

Code: (Select All)
    snows(I) = _CopyImage(flake&, 33)

Snows are hardware images.  Hardware images need _DISPLAY before they can be rendered and cleared out of the GPU.  The FOR loop that you have there at the end is pumping the GPU buffers full of images, and it never empties out those buffers.  After a zillion images are stacked in that buffer, something just glitches out somewhere and the program locks up waiting for those to be cleared before exiting completely.

Seems to me that QB64 should do some clean up here (if it possibly can), before attempting to close and freezing up.

Fix, for now, is to make certain that you have a nice _DISPLAY in place before that SYSTEM statement.  Smile
Reply
#8
That must be it, Steve.  Thanks.  I'll be careful with that in the future. 

- Dav

Find my programs here in Dav's QB64 Corner
Reply




Users browsing this thread: 2 Guest(s)