[plt-scheme] dns-find-nameserver complains "input in flex scanner failed" (but works anyway)

From: Ben Goetter (goetter at mazama.net)
Date: Mon Mar 15 09:47:30 EDT 2010

On 3/15/2010 3:49 AM, Matthew Flatt wrote:
> At Sun, 14 Mar 2010 20:36:56 -0700, Ben Goetter wrote:
>> I built a fresh PLT on 64-bit Win7 (32-bit PLT image of course).
>> Version[3m], svnrev 18533.  Problem reproducible
>> per Greg's original report.  The error diagnostic in question appears to
>> come from src\wxxt\src\x\wbuild\src\scan.c.

Sorry, that was hasty of me.

> I don't think that's it. That source is for `wbuild', which is used
> only under X. Also, it's used only in the process of building MrEd, and
> it should only be used when explicitly enabled through `configure'.
> The error message is put in that file by `flex', though. Whatever is
> printing the message is apparently also implemented using `flex'.
You are correct.  And both the win32 and win64 images of win7's 
nslookup.exe are built using flex, if their embedded strings are any 

I can reproduce the error message with the expression
  (require scheme/system)
  (define-values (pout pin pid perr proc) (apply values (process/ports 
#f (open-input-file "NUL") (current-error-port) "nslookup.exe")))
on a Win7 x64 system.

If, however, I replace the (open-input-file "NUL") with a sequence that 
creates, then immediately closes the pipe,
  (define-values (pout pin pid perr proc) (apply values (process/ports 
#f (open-input-file "NUL") (current-error-port) "nslookup.exe")))
  (close-output-port pin)
then the error message does not appear.

Note also that nslookup.exe <NUL (cmd) and $nul | nslookup.exe and $nul 
| cmd.exe /c nslookup.exe (PowerShell) do not reproduce the error message.

Posted on the users mailing list.