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:from:to:subject:date:message-id:references :in-reply-to:content-type:content-transfer-encoding :mime-version; q=dns; s=default; b=vqsoCjmpNMCotp01Dfp4BwW7TE3EL NA9M1OlLcs44I7DVWFQt83ECD4CpKqSRvqnGPsYEQnY5QCXIeF94bwb7kArXaUh3 IoRciwYkO6Qi0aUODJVoA93TPh4TCiH0s+ZbFJ+8eYUVzoExXQeKYNXKZMnaNaDk upVsys7/ACEokQ= 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:from:to:subject:date:message-id:references :in-reply-to:content-type:content-transfer-encoding :mime-version; s=default; bh=0WiTv5z5Zg796hBRYcWO10d4zDM=; b=pz2 G+dvLOUqi5hDPfOKAfwp9MNVtM7gGycczsYbPNXnAarmkxr++YUuwKL6S12QpiIG NROrdRk9wvW0xU9CPhOq1TZYU3/SX4O/ZX6rLbkVPHHM7BnCQFiwKYhDBU1wFBF3 dyXKoYwVCSSNm6iJvRsqj62FkfOy3NKBXS0HPvxg= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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.2 required=5.0 tests=AWL,BAYES_50,CYGWIN_OWNER_BODY,KAM_ASCII_DIVIDERS,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 spammy=Conditions, UD:o.o, poland, key_t X-HELO: emea01-db3-obe.outbound.protection.outlook.com From: =?utf-8?B?U3RhbmlzxYJhdyBXYXdzemN6YWs=?= To: "cygwin AT cygwin DOT com" Subject: RE: Cygwin IPC - ftok() returns negative values - Bug Report Date: Wed, 29 Jun 2016 16:06:30 +0000 Message-ID: References: <20160629151446 DOT GO981 AT calimero DOT vinschen DOT de> In-Reply-To: <20160629151446.GO981@calimero.vinschen.de> authentication-results: spf=none (sender IP is ) smtp.mailfrom=stanislaw DOT wawszczak AT iscg DOT pl; x-ms-office365-filtering-correlation-id: adb9679b-88e3-4832-c44b-08d3a0375548 x-microsoft-exchange-diagnostics: 1;DB3PR05MB348;6:xi5I9w6LLfx9UL7iI1VjNCsEbvl4vT3cSFK/cJm+awMexDueD3qu3q9feLmqq4VqPKzXxZjDwxk6HdVFoUqg1l3bCM0dfL/WG9VaxuGVACF86LnV0bMFqQvMryb/Bq1DFOwrfGccfvxFo7BaA4pJ4pEFMXXXXeGml/NJ/qOox2TJdk+Rm2TkTO0Hb639oZyzG8s8ro5ezskgB6XFFXPdgEASJBY0qHDz6WvHAdu2O6/HzTKNisfQpXqn0wQaanP83oEHNbuoA/uffy1BTBzh6ow6OiVOrVM20ou7RKWzieOml3VplJMq1qdlr/S8jnkP;5:sDFVxarX3i1E2LR1wyqNjw8yvW4O+yf5Cf9Gu0xizLFtf2saJb28+/3bnwPx5vpmoFCiiTBWxcSnboSr/OcUxX7HSO8jztiRQiwfqiAFcPiyBSBeThg+sMqI8mBJblJVluWqfq6H1wBwXZJsXZejNA==;24:u6yA6vneHg6uwUhk+OETHExgNPL84kpwizumIvotYa4RAkc55g51W0DHB2JrGoYhNm26qnnyQZ++jIKrzTWr0g3xijVEGZRwtk2AS5VomlM=;7:d20MxFJxRnC1/ARxBTrf81CCmqGDjn8bTcsqFre4cq5DLVSdqavnvBnpoCLeqcYX/WA1bYdMIu1rfDkAPIlmBVFOeMILRcVhpJaxbeCa/LU4+T0QEAdC2B4gmcciolFxnCsaBIJKYtxgQDt+8EKb8idjbFgvKyCYuL/L+CIMn32PrZisdbOGna5DyPBtElnVuK8ewWIET/fN7yuHd71Qf0lfudjtO0YKKKE44ngEQkeQptx7VkVv3LukSiTQUbMS x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB3PR05MB348; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040130)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041072)(6043046);SRVR:DB3PR05MB348;BCL:0;PCL:0;RULEID:;SRVR:DB3PR05MB348; x-forefront-prvs: 09888BC01D x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(189002)(377454003)(199003)(13464003)(24454002)(86362001)(575784001)(110136002)(7846002)(8936002)(7736002)(89622001)(74316001)(81166006)(7696003)(189998001)(5003600100003)(305945005)(2906002)(107886002)(3660700001)(77096005)(8676002)(122556002)(19580405001)(3280700002)(5640700001)(5890100001)(92566002)(11100500001)(66066001)(2950100001)(1730700003)(81156014)(2900100001)(2501003)(9686002)(97736004)(74482002)(450100001)(105586002)(101416001)(85202003)(106356001)(50986999)(586003)(76176999)(3846002)(102836003)(6116002)(5002640100001)(19580395003)(54356999)(87936001)(10400500002)(85182001)(33656002)(76576001)(68736007)(2351001)(2004002)(460985005)(2480315003);DIR:OUT;SFP:1102;SCL:1;SRVR:DB3PR05MB348;H:DB3PR05MB348.eurprd05.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: iscg.pl does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: iscg.pl X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jun 2016 16:06:30.1827 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5d91e211-393e-4cc2-bc59-c077247cadc0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR05MB348 X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id u5TG6vcl005938 Dear Corinna, I am sorry about confusing you. Simply: ----------------------------- Issue ------------------------------------ Call to ftok() returns negative value ----------------------------- Conditions ----------------------------- Windows 2012 R2 with latest patches Cygwin x64 installed from exe installer got two weeks ago $ cygcheck -V cygcheck (cygwin) 2.5.2 System Checker for Cygwin Copyright (C) 1998 - 2016 Cygwin Authors This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ----------------------------- Test case ------------------------------- #include #include int main(int argc, char**argv) { key_t semHandle = ftok("/etc/fstab", 'A'); printf("started\n"); if(semHandle <= 0) { printf("semHandle <= 0 ; (semHandle = %lld)\n", semHandle); } else { printf("semHandle > 0 ; (semHandle = %lld)\n", semHandle); } printf("finished\n"); return 0; } --------------------------- Result ----------------------------------- $ ./test.exe started semHandle <= 0 ; (semHandle = -5833568887996598975) finished Pozdrawiam/Best Regards, Stanisław Wawszczak Architekt Systemowy ISCG Sp. z o.o. Poland -----Original Message----- From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] On Behalf Of Corinna Vinschen Sent: Wednesday, June 29, 2016 5:15 PM To: cygwin AT cygwin DOT com Subject: Re: Cygwin IPC - ftok() returns negative values - Bug Report On Jun 29 13:14, Stanisław Wawszczak wrote: > Dear All, >   > I have had to compile sblim-sfcbd-1.4.10 on Cygwin. It is using IPC semaphores. > Unfortunately it is returning wrong value as the result of complicated bit-wise logical operations. > I have tried to “hack the system” and make multiplication of returned > value by -1, but it triggers error in semget() > Environment: > Windows 2012 R2 with latest patches > I have installed Cygwin from official installer couple days ago. >   > I have attached the gdb session from such invocation. You can see the path and id in arguments are correct and stat() function returns correct values. > Finally result in %rax is negative: > rax            0xaf0b000701cc1d53       -5833568862233420461 Ok, but what's the exact problem? Following a GDB session is kind of a lot of work. Simple, very short, self-contained testcase, perhaps? Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat