aws-sdk-cpp: Aws::Crt::Io::ClientBootstrap destructor may launch thread at process exit, and crash

Confirm by changing [ ] to [x] below to ensure that it’s a bug:

Describe the bug We’re getting a user report of a crash, seemingly at process shutdown, on Windows: https://github.com/conda-forge/arrow-cpp-feedstock/issues/567

Apparently the ClientBootstrap destructor can indirectly trigger the launch of a new thread using aws_thread_launch. The thread launch fails at process shutdown, at least on Windows, triggering an assertion error and therefore a process crash.

SDK version number 1.9.120

Platform/OS/Hardware/Device Windows/10.0.17763 (also reported on CentOS 8 and Ubuntu: https://issues.apache.org/jira/browse/ARROW-15141)

To Reproduce (observed behavior) Basically https://github.com/conda-forge/arrow-cpp-feedstock/issues/567#issue-1047929850, but I’m not sure what the exact steps are (I’m not the original reporter).

Expected behavior Failing to launch a thread at process shutdown should probably not crash the process.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 6
  • Comments: 18 (2 by maintainers)

Commits related to this issue

Most upvoted comments

pyarrow 10.0.1 was just released in conda-forge, which is the first release where we’re building against aws-sdk-cpp 1.9.* again after more than a year. Since we cannot test the failure reported here on our infra, I’d be very grateful if someone could verify that the problem does or doesn’t reappear. 🙃

conda install -c conda-forge pyarrow=10

Edit: if things are fine, I’m happy to backport this to arrow 6.x-9.x.

Was this resolved by awslabs/aws-c-io#515?

I don’t know this repo, but from looking around, it seems that:

  • the referenced PR is part of aws-c-io 0.13.5
  • latest aws-sdk-cpp release seems to use aws-c-io 0.10.20

The last update of the aws-c-io version used in this repo was in June (NB: at which point 5 newer releases of aws-c-io would have been already available). Perhaps @sdavtaker (author of last update) can illuminate the process of what’s necessary to update the respective dependencies.

This issue is biting us quite hard in conda-forge, made worse by the fact that aws-sdk-cpp 1.8 does not seem compatible anymore with current versions of the rest of the aws-c-* stack (which we need to unbundle for several reasons).

I also noticed still regular discussions about this problem in other repos, e.g. https://github.com/huggingface/datasets/issues/3310

Furthermore: This bug also happens outside pyarrow, I incorporate AWS in a standalone Windows C-program and that crashes during exit.

So it would be really good if we could upgrade aws-c-io here and then determine if that actually fixes things…

Update: this error has been reported on Ubuntu and CentOS as well: https://issues.apache.org/jira/browse/ARROW-15141