CRASH: Memory Error

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
User avatar
TomDowd
Newbie
Posts: 21
Joined: Sun Oct 15, 2017 1:21 pm
Completed: Historically, lead designer on MechAssault (Xbox), Duel Masters (PS2), and others. Co-creator of Shadowrun TTRPG and contributor to BattleTech, Earthdawn, Vampire: The Masquerade, and others.
Projects: Currently working on VN Crush Depth
Location: Chicago, IL
Contact:

CRASH: Memory Error

#1 Post by TomDowd »

I'm suddenly getting a memory crash on my project in the Windows x86 build. Nothing major has changed in the project itself since the crashes have started, and nothing significant has changed on my dev machine either. Only the distribution build crashes and it's generally in the same area each time. The only thing that's changed is I modified from notify() code, but I didn't add anything, in that general area. The crash seems to have something to do with a movie texture.

Here's the traceback:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/actone_introduction.rpy", line 333, in script
    NIXON_Vest happy "Sir, I'd suggest you just high-dive down, but you don't seem to have any swim gear... "
  File "game/actone_introduction.rpy", line 333, in script
    NIXON_Vest happy "Sir, I'd suggest you just high-dive down, but you don't seem to have any swim gear... "
MemoryError: 

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\bootstrap.py", line 316, in bootstrap
    renpy.main.main()
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\main.py", line 578, in main
    run(restart)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\main.py", line 143, in run
    renpy.execution.run_context(True)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\execution.py", line 908, in run_context
    context.run()
  File "game/actone_introduction.rpy", line 333, in script
    NIXON_Vest happy "Sir, I'd suggest you just high-dive down, but you don't seem to have any swim gear... "
  File "game/actone_introduction.rpy", line 333, in script
    NIXON_Vest happy "Sir, I'd suggest you just high-dive down, but you don't seem to have any swim gear... "
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\ast.py", line 708, in execute
    renpy.exports.say(who, what, *args, **kwargs)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\exports.py", line 1345, in say
    who(what, *args, **kwargs)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\character.py", line 1142, in __call__
    self.do_display(who, what, cb_args=self.cb_args, **display_args)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\character.py", line 842, in do_display
    **display_args)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\character.py", line 591, in display_say
    rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\ui.py", line 297, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\display\core.py", line 2702, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\display\core.py", line 3194, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\display\core.py", line 2094, in draw_screen
    renpy.config.screen_height,
  File "renpy/display/render.pyx", line 490, in renpy.display.render.render_screen (gen\renpy.display.render.c:6805)
    rv = render(root, width, height, st, st)
  File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen\renpy.display.render.c:3520)
    rv = d.render(widtho, heighto, st, at)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:4075)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen\renpy.display.render.c:3520)
    rv = d.render(widtho, heighto, st, at)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:4075)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen\renpy.display.render.c:3520)
    rv = d.render(widtho, heighto, st, at)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:4075)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen\renpy.display.render.c:3520)
    rv = d.render(widtho, heighto, st, at)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\display\screen.py", line 675, in render
    child = renpy.display.render.render(self.child, w, h, st, at)
  File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:4075)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen\renpy.display.render.c:3520)
    rv = d.render(widtho, heighto, st, at)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:4075)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen\renpy.display.render.c:3520)
    rv = d.render(widtho, heighto, st, at)
  File "accelerator.pyx", line 110, in renpy.display.accelerator.transform_render
  File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen\renpy.display.render.c:3520)
    rv = d.render(widtho, heighto, st, at)
  File "accelerator.pyx", line 110, in renpy.display.accelerator.transform_render
  File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen\renpy.display.render.c:3520)
    rv = d.render(widtho, heighto, st, at)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\display\transition.py", line 360, in render
    bottom = render(self.old_widget, width, height, st, at)
  File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:4075)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen\renpy.display.render.c:3520)
    rv = d.render(widtho, heighto, st, at)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\display\image.py", line 500, in render
    return wrap_render(self.target, width, height, st, at)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\display\image.py", line 306, in wrap_render
    rend = render(child, w, h, st, at)
  File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:4075)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen\renpy.display.render.c:3520)
    rv = d.render(widtho, heighto, st, at)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\display\video.py", line 405, in render
    tex, _ = get_movie_texture(self.channel, self.mask_channel, self.side_mask)
  File "I:\OneDrive\InDevelopment\CrushDepth-b0.1.01-dists\CrushDepth-b0.1.01-win\renpy\display\video.py", line 177, in get_movie_texture
    tex = renpy.display.draw.load_texture(surf, True)
  File "gldraw.pyx", line 738, in renpy.gl.gldraw.GLDraw.load_texture
  File "gltexture.pyx", line 883, in renpy.gl.gltexture.texture_grid_from_surface
  File "gltexture.pyx", line 319, in renpy.gl.gltexture.TextureCore.load_surface
  File "gltexture.pyx", line 1174, in renpy.gl.gltexture.premultiply
MemoryError: 

Windows-8-6.2.9200
Ren'Py 7.3.5.606
Crush Depth b0.1.01
Mon Nov 16 21:01:44 2020
I'm not running out of system or video memory, and it is never the same movie. (Nearly all my scenes/backgrounds are animated movies.)
config.image_cache_size_mb is set to 128, but it has been that way forever and I've not had this problem. I've been able to build x86 and MacOS in the past without crashes, until now. I've not tested a new MacOS to see if its displaying the same behavior.

EDIT: Windows applied update 2020-11 Cumulative Update for Windows 10 Version 2004 for x64 based Systems (KB4586781) on 11/11, but I made a non-crashing build after that. (And I don't see anything in the update notes that would be relevant, but...)

EDIT2: Probably unrelated, but... Malwarebytes has started quarantining my build .exe following a recent update. I've had to set the distributions folder as an exception to stop it. Flags it as RTP (Real-Time Protection) MachineLearning/Anomalous.96% The timing lines up, but...

Any ideas on how to track this down? Thanks!

TomD

User avatar
TomDowd
Newbie
Posts: 21
Joined: Sun Oct 15, 2017 1:21 pm
Completed: Historically, lead designer on MechAssault (Xbox), Duel Masters (PS2), and others. Co-creator of Shadowrun TTRPG and contributor to BattleTech, Earthdawn, Vampire: The Masquerade, and others.
Projects: Currently working on VN Crush Depth
Location: Chicago, IL
Contact:

Re: CRASH: Memory Error

#2 Post by TomDowd »

UPDATE:
It is consistently crashing at the same point, but only in the Windows build. Traceback is identical. MacOS build does not crash.

Does not crash from a saved game about twenty scenes from the crash point, so something is leaking or overflowing. Will boost the cache_size in case that is actually don't anything. (Is the same cache used for movies?)

Thanks!

TomD

User avatar
TomDowd
Newbie
Posts: 21
Joined: Sun Oct 15, 2017 1:21 pm
Completed: Historically, lead designer on MechAssault (Xbox), Duel Masters (PS2), and others. Co-creator of Shadowrun TTRPG and contributor to BattleTech, Earthdawn, Vampire: The Masquerade, and others.
Projects: Currently working on VN Crush Depth
Location: Chicago, IL
Contact:

Re: CRASH: Memory Error

#3 Post by TomDowd »

UPDATE:
Re-encoding the video in the crashing scene and the one immediately following did not solve the problem.

Skipping ahead, making menu choices, and reaching the problematic point does not cause a crash. Ugh.

EDIT: Changing the cache_size_MB did not change the result.

TomD

User avatar
TomDowd
Newbie
Posts: 21
Joined: Sun Oct 15, 2017 1:21 pm
Completed: Historically, lead designer on MechAssault (Xbox), Duel Masters (PS2), and others. Co-creator of Shadowrun TTRPG and contributor to BattleTech, Earthdawn, Vampire: The Masquerade, and others.
Projects: Currently working on VN Crush Depth
Location: Chicago, IL
Contact:

Re: CRASH: Memory Error

#4 Post by TomDowd »

UPDATE:
Putting some 1-second pauses in around the original crash point pushes the crash out about ten or fifteen scenes. Crash messages the same.

Monitoring the information in the Developer menu for Textures and Image Cache... Textures climbs intermittently through the game but never goes down... Is this a count or a cache? Image cache fluctuates like a proper cache.

Windows build in 3.4.0.939 for x86_64 does not crash.

Any ideas, anyone?

TomD

User avatar
TomDowd
Newbie
Posts: 21
Joined: Sun Oct 15, 2017 1:21 pm
Completed: Historically, lead designer on MechAssault (Xbox), Duel Masters (PS2), and others. Co-creator of Shadowrun TTRPG and contributor to BattleTech, Earthdawn, Vampire: The Masquerade, and others.
Projects: Currently working on VN Crush Depth
Location: Chicago, IL
Contact:

Re: CRASH: Memory Error

#5 Post by TomDowd »

No suggestions?

TD

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: CRASH: Memory Error

#6 Post by Imperf3kt »

It may help to temporarily disable auto predict.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
TomDowd
Newbie
Posts: 21
Joined: Sun Oct 15, 2017 1:21 pm
Completed: Historically, lead designer on MechAssault (Xbox), Duel Masters (PS2), and others. Co-creator of Shadowrun TTRPG and contributor to BattleTech, Earthdawn, Vampire: The Masquerade, and others.
Projects: Currently working on VN Crush Depth
Location: Chicago, IL
Contact:

Re: CRASH: Memory Error

#7 Post by TomDowd »

Imperf3kt wrote: Mon Nov 23, 2020 7:05 pm It may help to temporarily disable auto predict.
Thanks - I'll give that a shot.

TomD

User avatar
TomDowd
Newbie
Posts: 21
Joined: Sun Oct 15, 2017 1:21 pm
Completed: Historically, lead designer on MechAssault (Xbox), Duel Masters (PS2), and others. Co-creator of Shadowrun TTRPG and contributor to BattleTech, Earthdawn, Vampire: The Masquerade, and others.
Projects: Currently working on VN Crush Depth
Location: Chicago, IL
Contact:

Re: CRASH: Memory Error

#8 Post by TomDowd »

TomDowd wrote: Tue Nov 24, 2020 11:44 am
Imperf3kt wrote: Mon Nov 23, 2020 7:05 pm It may help to temporarily disable auto predict.
Thanks - I'll give that a shot.

TomD
Shot failed. And I may have been completely down the wrong track - debugging is the best! - using renpy.free.memory() keep the texture cache down, but it still crashes.

Not sure what to try next...

TD

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: CRASH: Memory Error

#9 Post by gas »

A: are side images the only sprites going? If so, probably you can find another implementation to obtain the same goal (like showing sprites on an upper layer).
B: have you added in your code some callback/function? Maybe some code is calling redundantly in the thread.

If nothing of this work, I'll consider the thing an hardware limit.

(Side note: WTF my desk is actually stuffed with things you contributed to O_O...)
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

User avatar
TomDowd
Newbie
Posts: 21
Joined: Sun Oct 15, 2017 1:21 pm
Completed: Historically, lead designer on MechAssault (Xbox), Duel Masters (PS2), and others. Co-creator of Shadowrun TTRPG and contributor to BattleTech, Earthdawn, Vampire: The Masquerade, and others.
Projects: Currently working on VN Crush Depth
Location: Chicago, IL
Contact:

Re: CRASH: Memory Error

#10 Post by TomDowd »

gas wrote: Fri Nov 27, 2020 7:05 am A: are side images the only sprites going? If so, probably you can find another implementation to obtain the same goal (like showing sprites on an upper layer).
B: have you added in your code some callback/function? Maybe some code is calling redundantly in the thread.

If nothing of this work, I'll consider the thing an hardware limit.

(Side note: WTF my desk is actually stuffed with things you contributed to O_O...)
Yea, I think my next approach is "same thing, different way". The side image is a movie-sprite, but it's big, taking up not only the traditional side image but a glint effect on the dialogue box. They were originally two movie-sprites but there were immediate performance issues, but I think it's time to re-examine that. And 99% of the time there's a full-screen, HD, 6-second looping animated background.

Thanks for the advice - and happy to have contributed to your desk clutter!

TomD

Post Reply

Who is online

Users browsing this forum: No registered users