[stunnel-users] Fix unexpected stunnel-4.10 exits on FreeBSD

Vasil Dimov vd at datamax.bg
Mon Jun 13 19:53:13 CEST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The problem has been reported in the stunnel-users mailing list:

http://stunnel.mirt.net/pipermail/stunnel-users/2005-May/000482.html
http://stunnel.mirt.net/pipermail/stunnel-users/2005-May/000484.html
http://stunnel.mirt.net/pipermail/stunnel-users/2005-May/000490.html

on freebsd-ports mailing list:

http://lists.FreeBSD.org/pipermail/freebsd-ports/2005-May/023344.html

and has several FreeBSD problem reports submitted:

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=81001
http://www.FreeBSD.org/cgi/query-pr.cgi?pr=81162
http://www.FreeBSD.org/cgi/query-pr.cgi?pr=81289

Patch that fixes this problem can be found here:

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=82202

It does not break anything if applied with Linux stunnel, so it can be
considered "universal". It will be good if we see this (or similar) fix
in the next version of stunnel.

The problem is that we cannot (at least on FreeBSD):

1. create context A (cleanup context)
2. create context B and set B's uc_link to point to A
3. swapcontext(3) to B
  What happens is that B's function returns, A's function passes
  control to the main thread of execution
4. create context C and set C's uc_link to point to A
  What happens is that A is exhausted and this will not work as expected
5. swapcontext(3) to C
  We expect A's function to be executed after C's function returns, but
  instead exit(3) is called when A's function returns and the whole
  program terminates normally after serving its second request.
-----BEGIN PGP SIGNATURE-----

iD8DBQFCrcgJFw6SP/bBpCARAll9AKCPTyMK23v28h8eGKW0LQw7RjrWFgCfWHjR
BQEEDOOx/mGG7S38QhqLIW8=
=yB1z
-----END PGP SIGNATURE-----



More information about the stunnel-users mailing list