This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: program exit code, "at exit" handler and explicit close of shared objects


As non-regular user I did tests when I have access to environment.

Ken Brown wrote:

On 10/29/2019 10:53 AM, Ken Brown wrote:
On 10/26/2019 11:07 AM, Roumen Petrov wrote:
First test is as is:

I ran this second version of test-dlclose (with DLCLOSE_ATEXIT defined) under
strace and got the following:

$ strace -o trace.out ./test-dlclose.exe
exit with code 33
Segmentation fault

The strace output ends with

      30   30143 [main] test-dlclose 847 write: 18 = write(1, 0x600061E20, 18)
--- Process 33456 (pid: 847) unloaded DLL at 00000003e7930000
--- Process 33456 (pid: 847), exception c0000005 at 00000003e7931080
--- Process 33456 (pid: 847) thread 26088 exited with status 0xc0000005
--- Process 33456 (pid: 847) thread 33544 exited with status 0xc0000005
--- Process 33456 (pid: 847) thread 36020 exited with status 0xc0000005
--- Process 33456 exited with status 0xc0000005

The address 00000003e7930000 seems to be in /usr/bin/cygz.dll, which is the DLL
Sorry, I meant to say 00000003e7931080; 00000003e7930000 is the start of cygz.dll.

that got unloaded.  After installing zlib-debuginfo, I ran addr2line to see
where the crash occurred, and this too crashed:

$ addr2line -C -f -i -p -e /usr/bin/cygz.dll 0x3e7931080
Segmentation fault (core dumped)

The test was with compression library because this is default OpenSSL configuration - dynamic loading of compression library.

It seems to me issue could be reproduced with other libraries as well.
For instance I get the same with ssh ("") or bz2 ("").

That's as far as I've gotten.


Roumen Petrov

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]