Read only miror of the eden emulator
Find a file
crueter c7b23f4a1a
[time] fix: guard timezone out buffer logging (#3668)
Original text, per the emailed patch:

---------------

Hello,

I am submitting a small fix to prevent an unintended abort when _GLIBCXX_ASSERTIONS is enabled, caused by out-of-bounds access in debug logging.
Background / Issue

In the server-side implementations of ITimeZoneService::ToPosixTime and ToPosixTimeWithMyRule, the SCOPE_EXIT debug logging previously accessed out_times[0] and out_times[1] unconditionally.

However, out_times is an IPC-provided output buffer (OutArray, which inherits from std::span). Its length depends on the caller-provided buffer capacity. During debugging, I encountered a case where out_times.size() == 1.

Under _GLIBCXX_ASSERTIONS, accessing out_times[1] triggers a std::span::operator[] assertion failure (std::__glibcxx_assert_fail) and aborts the process, causing the service thread to crash. This results in an unintended crash caused solely by debug logging.
Change Description

In the SCOPE_EXIT logging blocks of both ToPosixTime and ToPosixTimeWithMyRule, I added bounds checks before accessing out_times[0] and out_times[1]:

    Access out_times[0] only if out_times.size() > 0

    Access out_times[1] only if out_times.size() > 1

    Print 0 when the corresponding element is unavailable

This change only affects debug log output. It does not modify IPC semantics or the time conversion logic itself.
Reproduction Context (for reference)

I encountered this issue while running 13 Sentinels: Aegis Rim (title ID: 01008D7016438000). During the “Load Game” flow, ToPosixTimeWithMyRule is invoked with an out_times buffer of length 1, which previously led to the out-of-bounds access in the logging code.

Thank you for your time and review.

Best regards,
darkpaper

Environment: Arch Linux / KDE / X11

This email and the accompanying patch were prepared with assistance from
an LLM.

Authored-by: darkpaper <lirunzhou2021@gamil.com>
Signed-off-by: crueter <crueter@eden-emu.dev>

Co-authored-by: darkpaper <lirunzhou2021@gamil.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3668
2026-03-08 20:53:37 +01:00
.ci [cmake, ci/scripts] update missed YUZU_ENABLE_LTO -> ENABLE_LTO (#3503) 2026-02-10 21:33:22 +01:00
.github [ci] fix unused strings workflow (#3248) 2026-01-01 00:06:29 +01:00
.patch [crypto] Atomize all traces of MbedTLS, and require OpenSSL 3+ (#3606) 2026-02-23 02:50:13 +01:00
.reuse [docs] troubleshoot section, release policies, gpu documentation (#3078) 2025-12-12 18:36:19 +01:00
.tx [cmake] feat: FFmpeg CI, allow 16kb android builds, update translations for transifex (#2543) 2025-09-23 19:38:11 +02:00
CMakeModules [cmake, frontend] Fix update checker and move to self-hosted Git (#3558) 2026-02-15 20:51:05 +01:00
dist [dist] New 2026 Saint Patrick's icon; drop named variants (#3617) 2026-02-23 19:54:48 +01:00
docs [ports] build fixes for *BSD make (#3496) 2026-03-08 19:32:24 +01:00
externals [cmake] Start requiring SDL2 (#3632) 2026-02-25 02:49:47 +01:00
hooks chore: make yuzu REUSE compliant 2022-07-27 12:53:49 +02:00
LICENSES general: fix trailing whitespace 2024-01-08 09:34:32 -05:00
src [time] fix: guard timezone out buffer logging (#3668) 2026-03-08 20:53:37 +01:00
tools [dist] New 2026 Saint Patrick's icon; drop named variants (#3617) 2026-02-23 19:54:48 +01:00
.codespellrc core: refactor emulated cpu core activation 2023-12-04 10:37:16 -05:00
.git-blame-ignore-revs Skip git blame 2023-11-04 18:26:49 +00:00
.gitattributes chore: make yuzu REUSE compliant 2022-07-27 12:53:49 +02:00
.gitignore [gitignore] add *.tar.zst (#3663) 2026-03-02 05:28:26 +01:00
.shellcheckrc [tools, cmake] refactor: update/hash check scripts, use tags for some more deps, proper CPMUtil separation (#2666) 2025-10-05 03:04:53 +02:00
CMakeLists.txt [desktop] port IR Camera to Qt6 & fix camera saving on windows (#3630) 2026-02-28 01:06:59 +01:00
CONTRIBUTING.md [meta] remove stale/dead links in help/about (#3064) 2025-11-22 21:08:55 +01:00
cpmfile.json [crypto] Atomize all traces of MbedTLS, and require OpenSSL 3+ (#3606) 2026-02-23 02:50:13 +01:00
Doxyfile chore: make yuzu REUSE compliant 2022-07-27 12:53:49 +02:00
LICENSE.txt chore: make yuzu REUSE compliant 2022-07-27 12:53:49 +02:00
README.md [docs] Obtanium, installing mods, external ES-DE config, section about CFW and settings (#3678) 2026-03-07 18:16:05 +01:00
shell.nix [ports] Remove ENABLE_OPENSSL and mbedtls nixos remnants (#3638) 2026-03-01 01:53:04 +01:00


Eden
Eden

Eden is a free and opensource (FOSS) Switch 1 emulator, derived from Yuzu and Sudachi - started by developer Camille LaVey. It's written in C++ with portability in mind, with builds for Windows, Linux, macOS, Android, FreeBSD and more.

Discord Stoat

Compatibility | Development | Building | Download | Support | License

Compatibility

The emulator is capable of running most commercial games at full speed, provided you meet the necessary hardware requirements.

A list of supported games will be available in future. Please be patient.

Check out our website for the latest news on exciting features, monthly progress reports, and more!

Packaging status

Development

Most of the development happens on our Git server. It is also where our central repository is hosted. For development discussions, please join us on Discord or Stoat. You can also follow us on X (Twitter) for updates and announcements.

If you would like to contribute, we are open to new developers and pull requests. Please ensure that your work is of a high standard and properly documented. You can also contact any of the developers on Discord or Stoat to learn more about the current state of the emulator.

See the sign-up instructions for information on registration.

Alternatively, if you wish to add translations, go to the Eden project on Transifex and review the translations README.

Documentation

We have a user manual! See our User Handbook.

Building

See the General Build Guide

For information on provided development tooling, see the Tools directory

Download

You can download the latest releases from here.

Save us some bandwidth! We have mirrors available as well.

Support

If you enjoy the project and would like to support us financially, please check out our developers' donation pages!

Any donations received will go towards things such as:

  • Switch consoles to explore and reverse-engineer the hardware
  • Switch games for testing, reverse-engineering, and implementing new features
  • Web hosting and infrastructure setup
  • Additional hardware (e.g. GPUs as needed to improve rendering support, other peripherals to add support for, etc.)
  • CI Infrastructure

If you would prefer to support us in a different way, please join our Discord and talk to Camille or any of our other developers.

License

Eden is licensed under the GPLv3 (or any later version). Refer to the LICENSE.txt file.