You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5184 Reporter: Vadim_Z Assigned to:@xavierleroy Status: closed (set by @xavierleroy on 2012-09-25T18:06:17Z) Resolution: fixed Priority: normal Severity: minor Version: 3.11.2 Category: ~DO NOT USE (was: OCaml general) Monitored by:@ygrek
Bug description
The function map_file from submodules of Bigarray module doesn't work as expected on Windows platform with some values of ~pos argument. Here's the example:
(* ======================================================= *)
open Bigarray ;;
open Unix ;;
let fd= openfile "z.out" [O_RDWR; O_CREAT; O_TRUNC] 0o666 in
begin
let arr = Array1.map_file fd ~pos:(Int64.of_int 4096)
int c_layout true 1 in
arr.{0} <- 10
end;
close fd
;;
(* ======================================================= *)
Instead of writing the number to file the program yields:
Fatal error: exception Sys_error("The base address or the file offset specified does not have the proper alignment.
")
There's no such problem on Unix environment.
Additional information
The problem is caused by the following: dwPageSize is used instead of dwAllocationGranularity as a unit when offset is determined for CreateFileMapping in file mmap_win32.c.
Replacing dwPageSize by dwAllocationGranularity everywhere in mmap_win32.c and recompilation of Bigarray library solved the problem for me.
The text was updated successfully, but these errors were encountered:
Original bug ID: 5184
Reporter: Vadim_Z
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2012-09-25T18:06:17Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.2
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @ygrek
Bug description
The function map_file from submodules of Bigarray module doesn't work as expected on Windows platform with some values of ~pos argument. Here's the example:
(* ======================================================= *)
open Bigarray ;;
open Unix ;;
let fd= openfile "z.out" [O_RDWR; O_CREAT; O_TRUNC] 0o666 in
begin
let arr = Array1.map_file fd ~pos:(Int64.of_int 4096)
int c_layout true 1 in
arr.{0} <- 10
end;
close fd
;;
(* ======================================================= *)
Instead of writing the number to file the program yields:
Fatal error: exception Sys_error("The base address or the file offset specified does not have the proper alignment.
")
There's no such problem on Unix environment.
Additional information
The problem is caused by the following: dwPageSize is used instead of dwAllocationGranularity as a unit when offset is determined for CreateFileMapping in file mmap_win32.c.
Replacing dwPageSize by dwAllocationGranularity everywhere in mmap_win32.c and recompilation of Bigarray library solved the problem for me.
The text was updated successfully, but these errors were encountered: