Skip to content

Commit 6656e93

Browse files
thawk105claude
andcommitted
Fix WAL log preallocation: 10 ^ 9 (XOR=3) -> 1000000000
`ftruncate(10 ^ 9)` is a bitwise XOR yielding 3 bytes, not the intended 1e9 (1 GB) log preallocation. It also fails gcc-13 -Werror=xor-used-as-pow. Affects silo (ycsb/sbomb/tpcc/bomb) and ss2pl (bomb) under `#if WAL`. Found via Izanagi parameter-space full enumeration: the WAL code path is not compiled in default WAL=0 builds, so this stayed latent until WAL=1 was exercised across the optimization-flag hypercube. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 977e194 commit 6656e93

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

cc/silo/bomb_silo.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ int main(int argc, char* argv[]) try {
4444
std::string logpath;
4545
genLogFile(logpath, thid);
4646
trans.logfile_.open(logpath, O_CREAT | O_TRUNC | O_WRONLY, 0644);
47-
trans.logfile_.ftruncate(10 ^ 9);
47+
trans.logfile_.ftruncate(1000000000);
4848
#else
4949
(void) trans;
5050
#endif

cc/silo/sbomb_silo.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ int main(int argc, char* argv[]) try {
4343
std::string logpath;
4444
genLogFile(logpath, thid);
4545
trans.logfile_.open(logpath, O_CREAT | O_TRUNC | O_WRONLY, 0644);
46-
trans.logfile_.ftruncate(10 ^ 9);
46+
trans.logfile_.ftruncate(1000000000);
4747
#else
4848
(void) trans;
4949
#endif

cc/silo/tpcc_silo.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ int main(int argc, char* argv[]) try {
4343
std::string logpath;
4444
genLogFile(logpath, thid);
4545
trans.logfile_.open(logpath, O_CREAT | O_TRUNC | O_WRONLY, 0644);
46-
trans.logfile_.ftruncate(10 ^ 9);
46+
trans.logfile_.ftruncate(1000000000);
4747
#else
4848
(void) trans;
4949
#endif

cc/silo/ycsb_silo.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ int main(int argc, char* argv[]) try {
4444
std::string logpath;
4545
genLogFile(logpath, thid);
4646
trans.logfile_.open(logpath, O_CREAT | O_TRUNC | O_WRONLY, 0644);
47-
trans.logfile_.ftruncate(10 ^ 9);
47+
trans.logfile_.ftruncate(1000000000);
4848
#else
4949
(void) trans;
5050
#endif

cc/ss2pl/bomb_ss2pl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ int main(int argc, char* argv[]) try {
4242
std::string logpath;
4343
genLogFile(logpath, thid);
4444
trans.logfile_.open(logpath, O_CREAT | O_TRUNC | O_WRONLY, 0644);
45-
trans.logfile_.ftruncate(10 ^ 9);
45+
trans.logfile_.ftruncate(1000000000);
4646
#else
4747
(void) trans;
4848
#endif

0 commit comments

Comments
 (0)