Skip to content

Fix segfault when re-loading an EP library - #24539

Merged
Adrian Lizarraga (adrianlizarraga) merged 2 commits into
mainfrom
adrianl/fix-crash-unload-eps
Apr 25, 2025
Merged

Fix segfault when re-loading an EP library#24539
Adrian Lizarraga (adrianlizarraga) merged 2 commits into
mainfrom
adrianl/fix-crash-unload-eps

Conversation

@adrianlizarraga

@adrianlizarraga Adrian Lizarraga (adrianlizarraga) commented Apr 24, 2025

Copy link
Copy Markdown
Contributor

Description

Fixes a segfault that occurs when an EP library is re-loaded in the same process.

Motivation and Context

A recent PR updated the Environment to unload all EP libraries on destruction of OrtEnv. We forgot to properly update the state to mark the EP library as unloaded. Therefore, this caused a segfault when the EP library was re-loaded.

@adrianlizarraga

Copy link
Copy Markdown
Contributor Author

Hi vraspar FYI, to be cherry-picked for ORT 1.22.0

@adrianlizarraga
Adrian Lizarraga (adrianlizarraga) deleted the adrianl/fix-crash-unload-eps branch April 25, 2025 04:15
@Djdefrag

Copy link
Copy Markdown

Hi, sorry to bother, could this commit solve this problem on Directml with Python? #20713

vraspar pushed a commit that referenced this pull request Apr 28, 2025
### Description
Fixes a segfault that occurs when an EP library is re-loaded in the same
process.


### Motivation and Context
A recent [PR ](#24430)
updated the Environment to unload all EP libraries on destruction of
`OrtEnv`. We forgot to properly update the state to mark the EP library
as unloaded. Therefore, this caused a segfault when the EP library was
re-loaded.
George Wu (jywu-mysoft) pushed a commit that referenced this pull request Apr 30, 2025
### Description

Cherry pick the following into
[rel-1.22.0](https://github.com/microsoft/onnxruntime/tree/rel-1.22.0)


- (#24487)
- (#24466)
- (#24493)
- (#24484)
- (#24494)
- (#24489)
- (#24504)
- (#24510)
- (#24456)
- (#24537)
- (#24501)
- (#24519)
- (#24513)
- (#24539)
- (#24514)
- (#24542)
- (#24585)

Not added:

Planning to cherry pick Cuda Matmulnbits PRs once the fix for failing
cuda pipeline is ready
- (#24491)
- (#24509)
- (#24564)

---------

Co-authored-by: Adrian Lizarraga <adlizarraga@microsoft.com>
Co-authored-by: minfhong-quic <quic_minfhong@quicinc.com>
Co-authored-by: minfhong-quic <minfhong-quic@quicinc.com>
Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com>
Co-authored-by: Prathik Rao <prathik.rao@gmail.com>
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
Co-authored-by: Ankan Banerjee <ankan.ban@gmail.com>
Co-authored-by: Maximilian Müller <maximilianm@nvidia.com>
Co-authored-by: Gaurav Garg <gaugarg@nvidia.com>
Co-authored-by: iraut <iraut@nvidia.com>
Co-authored-by: Hrishikesh Manohar <hrishikeshm@nvidia.com>
Co-authored-by: Maximilian Müller <44298237+gedoensmax@users.noreply.github.com>
Co-authored-by: Scott McKay <skottmckay@gmail.com>
Co-authored-by: Jiajia Qin <jiajiaqin@microsoft.com>
Co-authored-by: kunal-vaishnavi <115581922+kunal-vaishnavi@users.noreply.github.com>
Co-authored-by: xhcao <xinghua.cao@intel.com>
Jatin Wadhwa (jatinwadhwa921) pushed a commit to intel/onnxruntime that referenced this pull request Apr 30, 2025
### Description

Cherry pick the following into
[rel-1.22.0](https://github.com/microsoft/onnxruntime/tree/rel-1.22.0)


- (microsoft#24487)
- (microsoft#24466)
- (microsoft#24493)
- (microsoft#24484)
- (microsoft#24494)
- (microsoft#24489)
- (microsoft#24504)
- (microsoft#24510)
- (microsoft#24456)
- (microsoft#24537)
- (microsoft#24501)
- (microsoft#24519)
- (microsoft#24513)
- (microsoft#24539)
- (microsoft#24514)
- (microsoft#24542)
- (microsoft#24585)

Not added:

Planning to cherry pick Cuda Matmulnbits PRs once the fix for failing
cuda pipeline is ready
- (microsoft#24491)
- (microsoft#24509)
- (microsoft#24564)

---------

Co-authored-by: vraspar <vrajang@outlook.com>
Co-authored-by: Adrian Lizarraga <adlizarraga@microsoft.com>
Co-authored-by: minfhong-quic <quic_minfhong@quicinc.com>
Co-authored-by: minfhong-quic <minfhong-quic@quicinc.com>
Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com>
Co-authored-by: Prathik Rao <prathik.rao@gmail.com>
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
Co-authored-by: Ankan Banerjee <ankan.ban@gmail.com>
Co-authored-by: Maximilian Müller <maximilianm@nvidia.com>
Co-authored-by: Gaurav Garg <gaugarg@nvidia.com>
Co-authored-by: iraut <iraut@nvidia.com>
Co-authored-by: Hrishikesh Manohar <hrishikeshm@nvidia.com>
Co-authored-by: Maximilian Müller <44298237+gedoensmax@users.noreply.github.com>
Co-authored-by: Scott McKay <skottmckay@gmail.com>
Co-authored-by: Jiajia Qin <jiajiaqin@microsoft.com>
Co-authored-by: kunal-vaishnavi <115581922+kunal-vaishnavi@users.noreply.github.com>
Co-authored-by: xhcao <xinghua.cao@intel.com>
Ankit Maheshkar (ankitm3k) pushed a commit to intel/onnxruntime that referenced this pull request May 12, 2025
### Description
Fixes a segfault that occurs when an EP library is re-loaded in the same
process.


### Motivation and Context
A recent [PR ](microsoft#24430)
updated the Environment to unload all EP libraries on destruction of
`OrtEnv`. We forgot to properly update the state to mark the EP library
as unloaded. Therefore, this caused a segfault when the EP library was
re-loaded.
@snnn

Copy link
Copy Markdown
Contributor

This PR has been included in the rel-1.22.0 branch. Removing the release:1.22.0 label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants