[PR #3759] [MERGED] fix divide by zero #3700

Closed
opened 2026-02-27 22:04:40 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3759
Author: @oltolm
Created: 10/31/2025
Status: Merged
Merged: 10/31/2025
Merged by: @georgemoralis

Base: mainHead: dbz


📝 Commits (1)

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 src/core/libraries/kernel/time.cpp (+1 -1)

📄 Description

shadps4.exe caused an Integer division by zero at location 00007000002417D0 in module shadps4.exe.

AddrPC           Params
00007000002417D0 00000008056A20E0 00000008056A2168 0000000000000190  shadps4.exe!posix_clock_gettime+0xe0  [C:/src/shadPS4/src/core/libraries/kernel/time.cpp @ 176]
   174:             return -1;
   175:         }
>  176:         ts->tv_sec = pc.QuadPart / pf.QuadPart;
   177:         ts->tv_nsec = ((pc.QuadPart % pf.QuadPart) * 1000'000'000) / pf.QuadPart;
   178:         return 0;
0000700000244A69 00000002073FFFE0 0000000200064760 00000008056A20F0  shadps4.exe!wrap+0x9  [C:/src/shadPS4/src/core/libraries/kernel/time.cpp @ 289]
   287: 
   288: s32 PS4_SYSV_ABI sceKernelClockGettime(const u32 clock_id, OrbisKernelTimespec* ts) {
>  289:     if (const auto ret = posix_clock_gettime(clock_id, ts); ret < 0) {
   290:         return ErrnoToSceKernelError(*__Error());
   291:     }
0000000800D1A81A 0000000200064760 00000008056A20F0 DEADBEEF54321ABC
00000002073FFFE0 00000008056A20F0 DEADBEEF54321ABC 0000000040000000
0000000200064760 DEADBEEF54321ABC 0000000040000000 0000000000000000
00000008056A20F0 0000000040000000 0000000000000000 00000007EFABEC80
DEADBEEF54321ABC 0000000000000000 00000007EFABEC80 0000000800D1DB17
0000000040000000 00000007EFABEC80 0000000800D1DB17 00000007EFABF9E8

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/3759 **Author:** [@oltolm](https://github.com/oltolm) **Created:** 10/31/2025 **Status:** ✅ Merged **Merged:** 10/31/2025 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `dbz` --- ### 📝 Commits (1) - [`1c5d7da`](https://github.com/shadps4-emu/shadPS4/commit/1c5d7da07ac81973ba8d419919bd40942faf446e) fix divide by zero ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/kernel/time.cpp` (+1 -1) </details> ### 📄 Description ``` shadps4.exe caused an Integer division by zero at location 00007000002417D0 in module shadps4.exe. AddrPC Params 00007000002417D0 00000008056A20E0 00000008056A2168 0000000000000190 shadps4.exe!posix_clock_gettime+0xe0 [C:/src/shadPS4/src/core/libraries/kernel/time.cpp @ 176] 174: return -1; 175: } > 176: ts->tv_sec = pc.QuadPart / pf.QuadPart; 177: ts->tv_nsec = ((pc.QuadPart % pf.QuadPart) * 1000'000'000) / pf.QuadPart; 178: return 0; 0000700000244A69 00000002073FFFE0 0000000200064760 00000008056A20F0 shadps4.exe!wrap+0x9 [C:/src/shadPS4/src/core/libraries/kernel/time.cpp @ 289] 287: 288: s32 PS4_SYSV_ABI sceKernelClockGettime(const u32 clock_id, OrbisKernelTimespec* ts) { > 289: if (const auto ret = posix_clock_gettime(clock_id, ts); ret < 0) { 290: return ErrnoToSceKernelError(*__Error()); 291: } 0000000800D1A81A 0000000200064760 00000008056A20F0 DEADBEEF54321ABC 00000002073FFFE0 00000008056A20F0 DEADBEEF54321ABC 0000000040000000 0000000200064760 DEADBEEF54321ABC 0000000040000000 0000000000000000 00000008056A20F0 0000000040000000 0000000000000000 00000007EFABEC80 DEADBEEF54321ABC 0000000000000000 00000007EFABEC80 0000000800D1DB17 0000000040000000 00000007EFABEC80 0000000800D1DB17 00000007EFABF9E8 ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:04:40 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#3700
No description provided.