Development discussion of WireGuard
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Brad Spencer <bspencer@blackberry.com>
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: Unexpected error re-initializing Wintun 0.9.2
Date: Thu, 17 Dec 2020 19:05:40 +0100	[thread overview]
Message-ID: <CAHmME9oRUm_D7QSA+zFB8cHW9OQZ-rq4pmDGY1G86VbcUBZaEA@mail.gmail.com> (raw)
In-Reply-To: <0c6e326e-139c-012b-fb47-95cc85560485@blackberry.com>

Hi Brad,

Thanks for the clear bug report and reproducer. I've never actually
seen anybody use the iso646.h operators before in real code... First
time for everything I guess!

It looks like the issue is that on each iteration of that loop, you're
calling LoadLibrary and FreeLibrary. Instead, only call LoadLibrary
once per process. Then you won't face this issue.

I've written a patch, however, to support the pathological library
reloading pattern in that example, though:
https://git.zx2c4.com/wintun/commit/?id=7710ff187b5079d9f2573608b6cb33b15262b2b8
This will be part of 0.10.1 or 0.11, whichever comes first. But, I'd
really recommend only calling LoadLibrary once per process, regardless
of that fix.

Thanks again for the report.

Jason

  reply	other threads:[~2020-12-17 18:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 14:07 Brad Spencer
2020-12-17 18:05 ` Jason A. Donenfeld [this message]
2020-12-17 18:30   ` Brad Spencer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHmME9oRUm_D7QSA+zFB8cHW9OQZ-rq4pmDGY1G86VbcUBZaEA@mail.gmail.com \
    --to=jason@zx2c4.com \
    --cc=bspencer@blackberry.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).