{"record":{"id":"c404e050e94c7f88","repo":"pola-rs/polars","slug":"polars-memory-prefetch-madvise-sequential-is-not-s","errorCode":null,"errorMessage":"POLARS_MEMORY_PREFETCH=madvise_sequential is not supported by this system","messagePattern":"POLARS_MEMORY_PREFETCH=madvise_sequential is not supported by this system","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-utils/src/mem.rs","lineNumber":126,"sourceCode":"                #[cfg(target_family = \"unix\")]\n                {\n                    madvise_willneed\n                }\n                #[cfg(not(target_family = \"unix\"))]\n                {\n                    no_prefetch\n                }\n            },\n            Some(\"no_prefetch\") => no_prefetch,\n            Some(\"prefetch_l2\") => prefetch_l2,\n            Some(\"madvise_sequential\") => {\n                #[cfg(target_family = \"unix\")]\n                {\n                    madvise_sequential\n                }\n                #[cfg(not(target_family = \"unix\"))]\n                {\n                    panic!(\n                        \"POLARS_MEMORY_PREFETCH=madvise_sequential is not supported by this system\"\n                    );\n                }\n            },\n            Some(\"madvise_willneed\") => {\n                #[cfg(target_family = \"unix\")]\n                {\n                    madvise_willneed\n                }\n                #[cfg(not(target_family = \"unix\"))]\n                {\n                    panic!(\n                        \"POLARS_MEMORY_PREFETCH=madvise_willneed is not supported by this system\"\n                    );\n                }\n            },\n            Some(\"madvise_populate_read\") => {\n                #[cfg(target_os = \"linux\")]","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/crates/polars-utils/src/mem.rs#L108-L144","documentation":"Polars panics when POLARS_MEMORY_PREFETCH=madvise_sequential is requested on a non-Unix platform. The madvise(2)-based sequential read-ahead prefetch strategy only exists on Unix (Linux/macOS); on Windows or other non-Unix targets the get_memory_prefetch_func path has no implementation and fails fast with this panic.","triggerScenarios":"Setting POLARS_MEMORY_PREFETCH=madvise_sequential (or madvise_willneed) and then starting a memory-prefetch-enabled scan (e.g. Parquet/NDJSON source with memory prefetch) on Windows or another non-Unix OS.","commonSituations":"Copying tuning environment variables from a Linux guide onto a Windows machine; CI matrices reusing the same env config across OSes; containers on Windows hosts.","solutions":["Remove POLARS_MEMORY_PREFETCH or set it to a platform-neutral value (e.g. 'none') on non-Unix systems","Only set madvise_* prefetch values conditionally when cfg/unix (or the OS is Linux/macOS)","Use OS-agnostic prefetch settings in shared CI configuration"],"exampleFix":"// before\nexport POLARS_MEMORY_PREFETCH=madvise_sequential  # set on Windows\n// after\n# only set on unix\nif [ \"$(uname)\" != \"MINGW\" ]; then export POLARS_MEMORY_PREFETCH=madvise_sequential; fi","handlingStrategy":"validation","validationCode":"// Rust: only set madvise prefetch on unix\nif cfg!(target_family = \"unix\") {\n    std::env::set_var(\"POLARS_MEMORY_PREFETCH\", \"madvise_sequential\");\n}","typeGuard":"fn madvise_supported() -> bool { cfg!(target_family = \"unix\") }","tryCatchPattern":null,"preventionTips":["Gate madvise_* env values behind OS checks in scripts and CI matrices","Use POLARS_MEMORY_PREFETCH=none (or unset) as the portable default","Avoid copying Linux tuning env blocks verbatim to Windows hosts"],"tags":["rust","environment-variable","platform","memory-prefetch"],"backgroundTag":"unsupported-platform","analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}