Infinite loop at sceGsSyncVCallback (0x006E5380) & MSVC LTO Linker hang on large projects

Open
#421 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 5 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
cmake, cpp

Research direction

The hang is at PC 0x006E5380 (sceGsSyncVCallback), so start with how stubs in config.toml and ps2_game_overrides::bindAddressHandler in loi_override.cpp are consumed by the runtime, since both were tried and neither stopped the [run:tick] output. Separately, check whether INTERPROCEDURAL_OPTIMIZATION in CMakeLists.txt reaches the ps2EntryRunner target. Done means the tick loop stops at that address and the link finishes without /GL. This needs runtime and build-system knowledge, so it is not a good first task.

Written by the indexing model from the issue text.

Description

Hi! First of all, thank you for the incredible PS2Recomp framework.

I am trying to recompile Castlevania: Lament of Innocence (USA, SLUS-207.33). The recompilation itself was a massive success: ps2_recomp.exe generated 11,078 functions with 0 decode failures. The game successfully loads and initializes PS2 system modules (SDRDRV, LIBSD, SIO2MAN).

However, I am hitting two blockers. To save your time, I have prepared a clean repository with my configs, CMake, and the override file:
👉 https://github.com/Om3g4-Dev/Castlevania-LOI-Recomp

Here is a summary of the issues:

1. Infinite loop at 0x006E5380 (sceGsSyncVCallback)
The game gets stuck in an infinite loop at pc=0x006E5380. I tried two approaches:

  • Adding "ret0@0x006E5380" to stubs in config.toml.
  • Using ps2_game_overrides::bindAddressHandler(runtime, 0x006E5380, "sceGsSyncVCallback") in loi_override.cpp.
    Neither worked. The runtime continues to output [run:tick] pc=0x6e5380 indefinitely. Is this address a special callback that requires a different handling mechanism?

2. MSVC Linker Hang (LTO)
When building ps2EntryRunner with 11,000 generated .cpp files, link.exe consumes 4.4+ GB of RAM and hangs for hours due to the /GL (Whole Program Optimization) flag. I added INTERPROCEDURAL_OPTIMIZATION FALSE to CMakeLists.txt, but it didn't seem to take effect on the build time. Is there a recommended way to disable LTO for generated targets?

Any advice on these two issues would be greatly appreciated. Thank you!

Dominant language
C++
Stars
3.3k
Forks
149
Avg merge
8h 46m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ran-j/PS2Recomp

All issues in ran-j/PS2Recomp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.