You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "shbhmrzd (via GitHub)" <gi...@apache.org> on 2024/04/22 09:42:35 UTC

[I] Handling Large Offsets on 32-bit Systems May Exceed usize Capacity [opendal]

shbhmrzd opened a new issue, #4506:
URL: https://github.com/apache/opendal/issues/4506

   A potential issue in the system where i64 is used for file offsets. On 32-bit architectures, `usize` is limited to `2^31-1`, which means that offsets near the upper limit of i64 could exceed `usize` capacities. This can lead to runtime errors or panics if not properly handled.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Handling Large Offsets for read on 32-bit Systems May Exceed usize Capacity [opendal]

Posted by "shbhmrzd (via GitHub)" <gi...@apache.org>.
shbhmrzd commented on issue #4506:
URL: https://github.com/apache/opendal/issues/4506#issuecomment-2068979922

   @Xuanwo 
   Just changing `u64` in `api.rs` for all offset to `usize` followed by changes in all implementations should be fine, right?
   Can I take it up?
   Thank you!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Handling Large Offsets for read on 32-bit Systems May Exceed usize Capacity [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #4506:
URL: https://github.com/apache/opendal/issues/4506#issuecomment-2069178810

   > I think if the underlying client uses `usize` then it could be an issue if the offset provided is pretty large.
   
   Your understanding is correct. However, the proper solution is to have the underlying client accept `u64` instead. Changing `u64` to `usize` is incorrect.
   
   That said, there's no immediate need to address this. We can revisit the issue if we encounter it with users on 32-bit systems.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Handling Large Offsets for read on 32-bit Systems May Exceed usize Capacity [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo closed issue #4506: Handling Large Offsets for read on 32-bit Systems May Exceed usize Capacity
URL: https://github.com/apache/opendal/issues/4506


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Handling Large Offsets for read on 32-bit Systems May Exceed usize Capacity [opendal]

Posted by "shbhmrzd (via GitHub)" <gi...@apache.org>.
shbhmrzd commented on issue #4506:
URL: https://github.com/apache/opendal/issues/4506#issuecomment-2069167964

   > > Just changing `u64` in `api.rs` for all offset to `usize` followed by changes in all implementations should be fine, right?
   > 
   > I don't have plan to change it yet. Please note that `u64` is fine on 32 bit systems is ok.
   
   I think if the underlying client uses `usize` then it could be an issue if the offset provided is pretty large. If the client itself has `u64` then it should not be an issue. Please let me know if this understanding is incorrect.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Handling Large Offsets for read on 32-bit Systems May Exceed usize Capacity [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #4506:
URL: https://github.com/apache/opendal/issues/4506#issuecomment-2069119094

   > Just changing `u64` in `api.rs` for all offset to `usize` followed by changes in all implementations should be fine, right?
   
   I don't have plan to change it yet. Please note that `u64` is fine on 32 bit systems is ok.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org