From dev-return-25593-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Wed Nov 6 19:14:19 2013 Return-Path: X-Original-To: apmail-apr-dev-archive@www.apache.org Delivered-To: apmail-apr-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 18CF310498 for ; Wed, 6 Nov 2013 19:14:19 +0000 (UTC) Received: (qmail 42175 invoked by uid 500); 6 Nov 2013 19:14:18 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 42085 invoked by uid 500); 6 Nov 2013 19:14:18 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 42047 invoked by uid 99); 6 Nov 2013 19:14:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Nov 2013 19:14:18 +0000 X-ASF-Spam-Status: No, hits=2.7 required=5.0 tests=HTML_MESSAGE,MISSING_HEADERS,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of trawick@gmail.com designates 209.85.215.42 as permitted sender) Received: from [209.85.215.42] (HELO mail-la0-f42.google.com) (209.85.215.42) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Nov 2013 19:14:12 +0000 Received: by mail-la0-f42.google.com with SMTP id ep20so3551989lab.29 for ; Wed, 06 Nov 2013 11:13:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=BwoxfrAVgYOAi1g5/FVwIR+ThlKLZoMT9PnsUtcGA+c=; b=UeIz3fmxxNdh2qEn10UaZadiVGLpMizpSN2SMX44gMXl9cJyiLwmnCbn4cOK7Pr0GF efn1dpItAuvEQWWdvpAwhdEY1R5vH3GgfKigGpLHdYZ07JMmtMVWsFfuR7vsBj2qpUdE Ob7wezm33feBnFg79GFcgZxKdlY3KQPAfWZQYqon0IFIKXT5T5M1DSSJMl1Xn4IkcYa+ ROUx8qyGxEUXp2N+ryeYlNPJsmr2HFO/xabPzkMjgJKjlsedVYJGG9qnqNu/jBihYY2L 00eXkBxnTwvks/M1SDLyfGftNO0oZsuGs34b7a5LpH8z2q5MsQP2oB2c2xhUSRi9z51O gduw== MIME-Version: 1.0 X-Received: by 10.112.198.39 with SMTP id iz7mr3778876lbc.24.1383765231828; Wed, 06 Nov 2013 11:13:51 -0800 (PST) Received: by 10.114.187.71 with HTTP; Wed, 6 Nov 2013 11:13:51 -0800 (PST) In-Reply-To: <527A931D.9000900@oracle.com> References: <527A931D.9000900@oracle.com> Date: Wed, 6 Nov 2013 14:13:51 -0500 Message-ID: Subject: Re: testdup test fails when compiled in debug mode on Windows From: Jeff Trawick Cc: APR Developer List Content-Type: multipart/alternative; boundary=001a11c233ea1884f804ea86f315 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c233ea1884f804ea86f315 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Nov 6, 2013 at 2:06 PM, Mike Rumph wrote: > The apr_file_dup2() function in apr/file_io/win32/filedup.c calls > _commit() for standard file handles 0, 1 and 2. > The _commit() function will assert with the message "Invalid file > descriptor. File possibly closed by a different thread" or return a value > of -1 if the file handle refers to a device. > The assert will appear if APR is compiled in debug mode. > > This can be seen by running "testall.exe testdup". > But if file redirection is used (such as "testall.exe testdup > outfile > 2>&1"), then the test completes successfully. > > I have attached a patch that corrects this problem by checking _isatty(). > > Credit goes to Jeff Trawick for catching this problem in the first place. > Well, there's a lot of unhappiness when you have to answer the abort/retry/ignore dialog when you run httpd with a debug flavor of apr ;) > Thanks, > > Mike Rumph > The existing flush-stdin path sure looks funny now that it is highlighted by the format of the patch, but that's not related to this bug and google seems to think that it is acceptable on Windows. I hope to commit shortly. Thanks! -- Born in Roswell... married an alien... http://emptyhammock.com/ --001a11c233ea1884f804ea86f315 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Wed, Nov 6, 2013 at 2:06 PM, Mike Rumph <mike.rump= h@oracle.com> wrote:
The apr_file_dup2() function in apr/file_io/= win32/filedup.c calls _commit() for standard file handles 0, 1 and 2.
The _commit() function will assert with the message "Invalid file desc= riptor. File possibly closed by a different thread" or return a value = of -1 if the file handle refers to a device.
The assert will appear if APR is compiled in debug mode.

This can be seen by running "testall.exe testdup".
But if file redirection is used (such as "testall.exe testdup > out= file 2>&1"), then the test completes successfully.

I have attached a patch that corrects this problem by checking _isatty().
Credit goes to Jeff Trawick for catching this problem in the first place.

Well, there's a lot of unhappiness w= hen you have to answer the abort/retry/ignore dialog when you run httpd wit= h a debug flavor of apr ;)


Thanks,

Mike Rumph

The existing flush-stdin path sure looks funny now t= hat it is highlighted by the format of the patch, but that's not relate= d to this bug and google seems to think that it is acceptable on Windows.

I hope to commit shortly.= =A0Thanks!

--
Born in Roswell... married an alien.= ..
http://emptyha= mmock.com/
--001a11c233ea1884f804ea86f315--