• Kevin Puetz's avatar
    winecrt0: Remove free_delay_imports. · b5d3759f
    Kevin Puetz authored
    MSVC's delayimp.lib does not actually free delayload dependencies.
    winecrt0's attempt to do so from ELF __attribute__((destructor))
    is unnecessary and potentially harmful:
    
    - When triggered naturally via LdrUnloadDll, this leads to recursive calls
      to FreeLibrary, violating free_lib_count and missing DLL_PROCESS_DETACH
    - when triggered by glibc's _dl_fini (at process exit), it leads to
      use-after-free of the TEB (GetCurrentThreadID after the main thread is no longer Win32)
      via  FreeLibrary -> LdrLdrUnloadDll -> RtlEnterCriticalSection( &loader_section )
    - double-free of the library itself, since the DLL_PROCESS_DETACH has
      already been handled by LdrShutdownProcess
    - Race against wineserver sending a SIGKILL from process_killed,
      since all Win32 threads of the process have exited
    
    Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53032
    b5d3759f
Name
Last commit
Last update
dlls Loading commit data...
documentation Loading commit data...
fonts Loading commit data...
include Loading commit data...
libs Loading commit data...
loader Loading commit data...
nls Loading commit data...
po Loading commit data...
programs Loading commit data...
server Loading commit data...
tools Loading commit data...
.editorconfig Loading commit data...
.gitlab-ci.yml Loading commit data...
.mailmap Loading commit data...
ANNOUNCE Loading commit data...
AUTHORS Loading commit data...
COPYING.LIB Loading commit data...
LICENSE Loading commit data...
LICENSE.OLD Loading commit data...
MAINTAINERS Loading commit data...
README Loading commit data...
VERSION Loading commit data...
aclocal.m4 Loading commit data...
configure Loading commit data...
configure.ac Loading commit data...