You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2026/07/17 07:32:06 UTC

[I] bug: auto-register-services eagerly initializes reqwest during macOS dyld startup [opendal]

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

   ### Describe the bug
   
   OpenDAL 0.58.0 can abort a macOS process before `main` when the default features are enabled.
   
   The `auto-register-services` constructor changed from calling only `init_default_registry()` in 0.57.0 to calling `install_default()` in 0.58.0. `install_default()` also constructs the default `ReqwestTransport`, which forces `DEFAULT_REQWEST_CLIENT` and `reqwest::Client::new()` from a Mach-O/dyld constructor.
   
   On macOS, reqwest's system proxy discovery enters `SystemConfiguration` and `Foundation` during that constructor. In Lance's test binary, this raises an uncaught Objective-C `NSInvalidArgumentException` and terminates with `SIGABRT` before the Rust test harness starts.
   
   ```text
   *** Terminating app due to uncaught exception 'NSInvalidArgumentException',
   reason: '-[__NSCFString stringByStandardizingPath]: unrecognized selector sent to instance ...'
   
   reqwest::Client::new
   opendal_http_transport_reqwest::ReqwestTransport::default
   opendal::install_default
   opendal::register_default_operator_registry
   dyld::Loader::runInitializers...
   ```
   
   Relevant source:
   
   - [0.57.0 constructor only initializes the registry](https://github.com/apache/opendal/blob/v0.57.0/core/src/lib.rs#L242-L246)
   - [0.58.0 constructor calls `install_default()`](https://github.com/apache/opendal/blob/v0.58.0/core/src/lib.rs#L254-L258)
   - [`install_default()` installs `ReqwestTransport::default()`](https://github.com/apache/opendal/blob/v0.58.0/core/src/lib.rs#L30-L40)
   - [`ReqwestTransport::default()` forces the default reqwest client](https://github.com/apache/opendal/blob/v0.58.0/core/http-transports/reqwest/src/lib.rs#L85-L102)
   
   ### Steps to Reproduce
   
   On macOS ARM64:
   
   ```shell
   git clone https://github.com/lance-format/lance.git
   cd lance
   git fetch origin pull/7823/head:opendal-0.58
   git checkout 47800f3cc2dcf3200faafd529cf407640291f3b6
   cargo test -p lance --lib
   ```
   
   The process aborts while dyld is running constructors, before the Lance test harness starts.
   
   This appears to be initialization-order sensitive, so a small standalone binary may not reproduce it. The following CI job is a confirmed reproduction:
   
   - Lance PR: https://github.com/lance-format/lance/pull/7823
   - Failing macOS job: https://github.com/lance-format/lance/actions/runs/29493261453/job/87661925895
   
   ### Expected Behavior
   
   Enabling `auto-register-services` and the default HTTP transport should not perform OS-dependent HTTP client initialization before `main`.
   
   Automatic service registration should continue to work, while HTTP client creation should happen lazily or when default transport installation is explicitly requested after process startup.
   
   ### Additional Context
   
   Environment:
   
   - OpenDAL 0.58.0
   - macOS ARM64
   - Xcode 15.4
   - Rust stable
   
   This is a regression from OpenDAL 0.57.0. Linux, Windows, Linux ARM64, MSRV, clippy, rustdoc, and dependency checks passed in the same Lance CI run.
   
   A possible fix would be to keep the constructor limited to `init_default_registry()`, as in 0.57.0, and decouple or defer installation of the default HTTP transport.
   


-- 
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] bug: auto-register-services eagerly initializes reqwest during macOS dyld startup [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo closed issue #7923: bug: auto-register-services eagerly initializes reqwest during macOS dyld startup
URL: https://github.com/apache/opendal/issues/7923


-- 
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] bug: auto-register-services eagerly initializes reqwest during macOS dyld startup [opendal]

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

   It's a severe issue. I have yanked 0.58.0. We should get this fixed in 0.58.1.


-- 
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] bug: auto-register-services eagerly initializes reqwest during macOS dyld startup [opendal]

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

   Nice fix.
   
   > On macOS, reqwest's system proxy discovery enters SystemConfiguration and Foundation during that constructor. In Lance's test binary, this raises an uncaught Objective-C NSInvalidArgumentException and terminates with SIGABRT before the Rust test harness starts.
   
   I found it peculiar reqwest crashed on macOS. Why would it work if client is initialized later? Wouldn't that become a Rust panic? I'm not going to guess but worthwhile validating in 0.58.1 release.


-- 
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