summaryrefslogtreecommitdiff
path: root/dev-libs/apache-arrow/files/apache-arrow-15.0.1-32bit.patch
diff options
context:
space:
mode:
Diffstat (limited to 'dev-libs/apache-arrow/files/apache-arrow-15.0.1-32bit.patch')
-rw-r--r--dev-libs/apache-arrow/files/apache-arrow-15.0.1-32bit.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/dev-libs/apache-arrow/files/apache-arrow-15.0.1-32bit.patch b/dev-libs/apache-arrow/files/apache-arrow-15.0.1-32bit.patch
new file mode 100644
index 000000000000..d268e565ab76
--- /dev/null
+++ b/dev-libs/apache-arrow/files/apache-arrow-15.0.1-32bit.patch
@@ -0,0 +1,57 @@
+diff --git a/gdb_arrow.py b/gdb_arrow.py
+index 6c3af1680..ad40ec499 100644
+--- a/gdb_arrow.py
++++ b/gdb_arrow.py
+@@ -304,7 +304,8 @@ def format_timestamp(val, unit):
+ seconds, subseconds = divmod(val, traits.multiplier)
+ try:
+ dt = datetime.datetime.utcfromtimestamp(seconds)
+- except (ValueError, OSError): # value out of range for datetime.datetime
++ except (ValueError, OSError, OverflowError):
++ # value out of range for datetime.datetime
+ pretty = "too large to represent"
+ else:
+ pretty = dt.isoformat().replace('T', ' ')
+diff --git a/src/arrow/io/file.cc b/src/arrow/io/file.cc
+index 543fa90a8..3b18bb7b0 100644
+--- a/src/arrow/io/file.cc
++++ b/src/arrow/io/file.cc
+@@ -36,6 +36,7 @@
+ #include <cerrno>
+ #include <cstdint>
+ #include <cstring>
++#include <limits>
+ #include <memory>
+ #include <mutex>
+ #include <sstream>
+@@ -560,17 +561,22 @@ class MemoryMappedFile::MemoryMap
+ RETURN_NOT_OK(::arrow::internal::FileTruncate(file_->fd(), initial_size));
+ }
+
+- size_t mmap_length = static_cast<size_t>(initial_size);
+- if (length > initial_size) {
+- return Status::Invalid("mapping length is beyond file size");
+- }
+- if (length >= 0 && length < initial_size) {
++ int64_t mmap_length = initial_size;
++ if (length >= 0) {
+ // memory mapping a file region
+- mmap_length = static_cast<size_t>(length);
++ if (length > initial_size) {
++ return Status::Invalid("mapping length is beyond file size");
++ }
++ mmap_length = length;
++ }
++ if (static_cast<int64_t>(static_cast<size_t>(mmap_length)) != mmap_length) {
++ return Status::CapacityError("Requested memory map length ", mmap_length,
++ " does not fit in a C size_t "
++ "(are you using a 32-bit build of Arrow?");
+ }
+
+- void* result = mmap(nullptr, mmap_length, prot_flags_, map_mode_, file_->fd(),
+- static_cast<off_t>(offset));
++ void* result = mmap(nullptr, static_cast<size_t>(mmap_length), prot_flags_, map_mode_,
++ file_->fd(), static_cast<off_t>(offset));
+ if (result == MAP_FAILED) {
+ return Status::IOError("Memory mapping file failed: ",
+ ::arrow::internal::ErrnoMessage(errno));