delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/04/22/14:08:51

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding; q=dns; s=
default; b=GBLH/bx3eWoQu79C3u0svefyjIMW8Opc0fW21xBbcV01Q0yZfUDgm
miqlGq8L6imfZLEmrhp8M/n9xCkdvBBytNgHLf+DTJin5jIrndaSZr2jFm6DWf+A
SZvJdNqFtYLAvHD3fp6FDLtcH51ai6G8w7azhiUjD4xDDM0UH4PaiE=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding; s=default;
bh=6dZygWDjF+b0yX3KUDESDQGeJDc=; b=w1KS4crVHR71xAYZDEd7GIqH20H4
zA5pKMOLowpYoNvFnd8XxQtDkPCpbPOUOMmFbe54fZhaseiozGFB72xrVH2KdunK
SpDR9XiE5D8+vzu2UuQ0XoaJ8GacdK9lka3wFnGGStzB7Wg3/vWxpV+8nr0CQP/7
Et/Q//6LrAbyQMM=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:uqmkhb9
X-HELO: plane.gmane.org
To: cygwin AT cygwin DOT com
From: Andrew Schulman <schulman DOT andrew AT epa DOT gov>
Subject: Re: ld randomly assigns wrong user and group IDs to executable
Date: Fri, 22 Apr 2016 14:08:23 -0400
Lines: 38
Message-ID: <0ppkhbp6p8od6tgn3gll4cksvfn530c0e1@4ax.com>
References: <uqmkhb9kmv244kd755urqpunns6qk6gbe2 AT 4ax DOT com>
Mime-Version: 1.0
X-Archive: encrypt
X-IsSubscribed: yes

> During configure, a particular c++ program compiles fine, but the generated
> executable has the wrong user and group IDs and permissions, so the
> configure test fails and my build fails.
> 
> Here are the source files and generated executable:
> 
> $ ls -l conftest*
> -rw-r--r--  1 ASchulma     Domain Users   1911 Apr 22 13:11 conftest.cpp
> -rw-r--r--  1 ASchulma     Domain Users    466 Apr 22 13:11 conftest.err
> -rwxr-x---  1 Unknown+User Unknown+Group 62152 Apr 22 13:11 conftest.exe
> 
> $ ls -ln conftest.exe
> -rwxr-x--- 1 4294967295 4294967295 62152 Apr 22 13:11 conftest.exe
> 
> Note the strange, apparently random user and group ID numbers for
> conftest.exe.
> 
> * This happens about half the time. The other half of the time, the user
> and group IDs are mine and so the build succeeds.  I haven't been able to
> figure out when it will fail.
> 
> * The user and group IDs are always the same, 4294967295, when the problem
> happens.
> 
> * It only happens with this one program - other tests in configure work
> fine.
> 
> * When I compile the program on my own, outside of configure, it builds
> fine, two compiler warnings aside.

A few more notes:

* As Sergio Gomez points out, the ID 4294967295 isn't random but is 2^32-1.

* Configure is now starting to fail on other tests, in exactly the same
way: by generating an executable with those IDs that I then can't read,
causing the test to fail.  Again it seems to be random which test fails and
when.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019