{"record":{"id":"fc8245d187471a74","repo":"microsoft/FASTER","slug":"overflow-in-addressinfo-consider-running-the-program-in-x64","errorCode":null,"errorMessage":"Overflow in AddressInfo - consider running the program in x64 mode for larger address space support","messagePattern":"Overflow in AddressInfo - consider running the program in x64 mode for larger address space support","errorType":"exception","errorClass":"FasterException","httpStatus":null,"severity":"error","filePath":"cs/src/core/Index/Common/AddressInfo.cs","lineNumber":89,"sourceCode":"                word = (IntPtr)_word;\n            }\n        }\n\n        public long Address\n        {\n            readonly get\n            {\n                return (long)word & kAddressMask;\n            }\n            set\n            {\n                var _word = (long)word;\n                _word &= ~kAddressMask;\n                _word |= (value & kAddressMask);\n                word = (IntPtr)_word;\n                if (value != Address)\n                {\n                    throw new FasterException(\"Overflow in AddressInfo\" + ((kAddressBits < 64) ? \" - consider running the program in x64 mode for larger address space support\" : \"\"));\n                }\n            }\n        }\n    }\n}\n","sourceCodeStart":71,"sourceCodeEnd":95,"githubUrl":"https://github.com/microsoft/FASTER/blob/321d872eabda6a0345c8bd76419f89723ed864ae/cs/src/core/Index/Common/AddressInfo.cs#L71-L95","documentation":"AddressInfo stores its address in a bit field of kAddressBits width. When a value larger than the address mask is written, the high bits are silently truncated; the setter detects this (value != Address) and throws FasterException(\"Overflow in AddressInfo\" + ...) advising x64 mode on narrower builds. The address could not be represented, so proceeding would corrupt the record.","triggerScenarios":"Setting AddressInfo.Address (or a property that routes through it) to a value > (1 << kAddressBits) - 1, e.g. a device/log offset beyond the encodable range on a 32-bit (kAddressBits < 64) build.","commonSituations":"Logs growing past the 32-bit address ceiling (~4GB) when running x86; huge log devices addressed with narrow AddressInfo; long-running services whose offsets accumulate past the limit.","solutions":["Build/run the application as x64 so kAddressBits is 64 and full offsets are encodable.","Reduce device/log size below the 32-bit address ceiling, or use multiple smaller devices.","Switch to a storage layout / epoch mode that does not use compact AddressInfo encoding for huge offsets.","Monitor log tail address and checkpoint/compact before approaching the address-space limit."],"exampleFix":"// before (project -> Platform target: x86)\nnew FasterLog(new FasterLogSettings { LogDevice = device, LogFileSize = 1L << 40 }); // overflow at large offsets\n\n// after (project -> Platform target: x64)\nnew FasterLog(new FasterLogSettings { LogDevice = device, LogFileSize = 1L << 40 }); // 64-bit AddressInfo, no overflow","handlingStrategy":"validation","validationCode":"// ensure the address fits in AddressInfo before use\nbool AddressFits(long addr, int kAddressBits) => addr <= ((1L << kAddressBits) - 1);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build and deploy as x64 (Platform target x64 / AnyCPU without prefer-32bit).","Keep log device size under the 32-bit ceiling on x86 builds.","Monitor tail address growth and rotate/compact before overflow."],"tags":["addressing","overflow","x64","fasterlog"],"backgroundTag":"value-out-of-range","analyzedSha":"321d872eabda6a0345c8bd76419f89723ed864ae","analyzedAt":"2026-09-15T22:18:00.693Z","contentChangedAt":"2026-09-15T22:18:00.693Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}