V
V
Vadim Ushakov2021-12-15 15:18:22
linux
Vadim Ushakov, 2021-12-15 15:18:22

Do library unload function calls fail?

The crux of the matter is in the title. When an application crashes, is the unloading function of libraries called?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
J
jcmvbkbc, 2021-12-15
@jcmvbkbc

When an application crashes, is the unloading function of libraries called?

If the application crashes from an unhandled exception, then according to the description of RaiseException , the default action is to call ExitProcess. When the application terminates via ExitProcess , DllMain will be called for loaded libraries with the code DLL_PROCESS_DETACH.

A
Alexey Cheremisin, 2021-12-15
@leahch

In Linux, nothing is called during a crash, and it cannot, because the data is corrupted!
But the system can do a post-mortem dump of the process's memory into a so-called core file if asked to do so. And it can be viewed in the debugger, which often helps.

V
Vasily Bannikov, 2021-12-15
@vabka

Depends on what kind of crash and how these libraries were loaded.
If any resources were created outside of the crashed process, a leak will occur.
But what was inside the process will be automatically cleaned by the system.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question