Opened 2 months ago

Last modified 4 weeks ago

#15711 new defect

TWP: Twp::Shader::init() crash on OSX PPC and old GPUs

Reported by: dwatteau Owned by: scemino
Priority: normal Component: Engine: TWP
Version: Keywords:
Cc: Game: Thimbleweed Park

Description

ScummVM 2.9.0 on OSX PPC (big-endian), happens on the following devices:

  • jcGyo's eMac (with an ATI Radeon 7500, 32MB VRAM), as reported on Discord
  • my iBook G4 (ATI Radeon 9200, 32MB VRAM)
  • my PowerBook G4 (ATI Radeon 9600 XT)
  • my Quad G5 (NVIDIA GeForce 6600)

I can't say if the issue is the TWP engine, or in the OpenGL/shader stack.

Trying to run the game will print the following output:

GLSL Version 110 is not supported
could not find attribute a_position in shader

and then ScummVM will SIGABRT.

I'm attaching a crash report, a GDB backtrace (with -d6 OpenGL info) below.

If the engine is not meant to run on such old GPUs (the last PPC machines from Apple were released in 2005), I can disable the engine in the OSX PPC builds. But maybe we could detect that the game is going to be run on an incompatible GPU, if that's the case?

Attachments (4)

ibook-g4-gpu-information.txt (715 bytes ) - added by dwatteau 2 months ago.
GPU info, for the iBook G4 crash
gdb-twp-2.9.0-ppc-ibook-g4.txt (7.8 KB ) - added by dwatteau 2 months ago.
GDB backtrace on iBook G4 and ScummVM 2.9.0; also contains 'scummvm -d6' OpenGL info
twp-crash-report-scummvm290-osx-pcc-g5.txt (22.3 KB ) - added by dwatteau 2 months ago.
CrashReporter output for SIGBUS on the Quad G5 OSX PPC (the gdb backtrace attachment above is probably more useful)
twp-osx-ppc-leopard-bt-full-20250225.txt (24.6 KB ) - added by dwatteau 4 weeks ago.
GDB "bt full" output when running 2.10.0git on OSXPPC Leopard

Download all attachments as: .zip

Change History (9)

by dwatteau, 2 months ago

GPU info, for the iBook G4 crash

by dwatteau, 2 months ago

GDB backtrace on iBook G4 and ScummVM 2.9.0; also contains 'scummvm -d6' OpenGL info

by dwatteau, 2 months ago

CrashReporter output for SIGBUS on the Quad G5 OSX PPC (the gdb backtrace attachment above is probably more useful)

comment:1 by dwatteau, 2 months ago

@criezy's comment on Discord:

[...] And in any case it may be a good idea in the twp engine to check that shaders are supported by the backend before creating the renderer. That does not seem to be the case currently.

Other 3D engines do this by calling Renderer::getAvailableTypes(), but since the twp engine only has one renderer anyway it could directly check g_system->->hasFeature(OSystem::kFeatureShadersForGame).

comment:2 by larsamannen, 2 months ago

This can also be interesting. The OpenGL version support depends on both gfx card and OS X version.
https://web.archive.org/web/20120102170341/http://developer.apple.com/graphicsimaging/opengl/capabilities/GLInfo_1058.html

comment:3 by larsamannen, 2 months ago

So it might start on your computers depending on OS X version.
my PowerBook G4 (ATI Radeon 9600 XT)
my Quad G5 (NVIDIA GeForce 6600)

comment:4 by dwatteau, 2 months ago

Thanks.

Well, the iBook G4 with the GDB backtrace is only running Tiger indeed.

But the other G4 and G5 you mention are already running Leopard and they crash as well; see the G5 crash report. It looks like they may crash at a different place though, since the G5 crashes in twp::RenderTexture::RenderTexture() instead.

I won’t have more access to my Leopard machines before a few weeks though.

comment:5 by dwatteau, 4 weeks ago

Hi,

Back to my Quad G5 this week (Tiger/Leopard dual boot), with an up-to-date 2.10.0git build :)

Replying to larsamannen:

This can also be interesting. The OpenGL version support depends on both gfx card and OS X version.
https://web.archive.org/web/20120102170341/http://developer.apple.com/graphicsimaging/opengl/capabilities/GLInfo_1058.html

Yes, I can confirm that by using the same card on Tiger and Leopard:

--- twp-2.10.0git-d6-g5-tiger.txt	2025-02-25 12:20:26
+++ twp-2.10.0git-d6-g5-leopard.txt	2025-02-25 12:20:32
@@ -1,167 +1,241 @@
 Debuglevel (from command line): 6
 Using SDL Video Driver "Quartz"
 creating OpenGL graphics manager
 creating OpenGL graphics manager
 Using SDL Audio Driver "coreaudio"
 Output sample rate: 44100 Hz
 Output buffer size: 1024 samples
 Output channels: 2
 OpenGL: GL context initialized
-OpenGL version: 1.5 NVIDIA-1.4.18
+OpenGL version: 2.0 NVIDIA-1.5.48
 OpenGL vendor: NVIDIA Corporation
 OpenGL renderer: NVIDIA GeForce 6600 OpenGL Engine
-OpenGL: version 1.5
-OpenGL: GLSL version string: 1.10
-OpenGL: GLSL version: 0
+OpenGL: version 2.0
+OpenGL: GLSL version string: 1.20
+OpenGL: GLSL version: 120
 OpenGL: Max texture size: 4096
-OpenGL: NPOT texture support: 0
-OpenGL: Shader support: 0
-OpenGL: Shader support for engines: 0
+OpenGL: NPOT texture support: 1
+OpenGL: Shader support: 1
+OpenGL: Shader support for engines: 1
 OpenGL: Multitexture support: 1
 OpenGL: FBO support: 0
 OpenGL: Multisample FBO support: 0
 OpenGL: Multisample max number: -1
 OpenGL: Packed pixels support: 1
-OpenGL: Packed depth stencil support: 0
+OpenGL: Packed depth stencil support: 1
 OpenGL: Unpack subimage support: 1
 OpenGL: OpenGL ES depth 24 support: 0
 OpenGL: Texture edge clamping support: 1
 OpenGL: Texture border clamping support: 1
 OpenGL: Texture mirror repeat support: 1
 OpenGL: Texture max level support: 1
 WARNING: Libretro is not supported!

OK: On Tiger, the "Thimbleweed Park requires OpenGL with shader" is now displayed, as expected.

KO: On Leopard, shaders are properly detected, so the engine starts, but crashes. Here's the main part of the up-to-date 2.10.0git backtrace from there:

Running Thimbleweed Park (GOG/1.0.958)
ThimbleweedPark.ggpack1: 6180145221d18e9e9caac6459e840579, 502661439 bytes.
WARNING: slot for actor franklin not found!

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000

(gdb) bt
#0  0x00000000 in ?? ()
Cannot access memory at address 0x0
#1  0x000bd96c in Twp::RenderTexture::RenderTexture (this=Cannot access memory at address 0x0
0xbfffb888, size=Cannot access memory at address 0x0
@0xbfffb880) at engines/twp/gfx.cpp:110
Cannot access memory at address 0x0
#2  0x00134148 in Twp::TwpEngine::draw (this=Cannot access memory at address 0x0
0x1ae0800, outTexture=0x0) at engines/twp/twp.cpp:731
Cannot access memory at address 0x0
#3  0x00137d6c in Twp::TwpEngine::run (this=0x1ae0800) at engines/twp/twp.cpp:1324
#4  0x00077278 in runGame (enginePlugin=0x1683060, system=@0x1646de8, game=@0xbfffd260, meDescriptor=0x17092700) at base/main.cpp:311
[...]

Attaching the fuller bt full below. (The Git tree was built at commit c19577d10da5ebcba14cd0bd8899b8ffd77734ef)

by dwatteau, 4 weeks ago

GDB "bt full" output when running 2.10.0git on OSXPPC Leopard

Note: See TracTickets for help on using tickets.