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:mime-version:reply-to:from:date:message-id :subject:to:content-type; q=dns; s=default; b=bBecCJYvbHA27zQyMd Msj7Ubi2HjJHJTsmRSTMq/0Lq8BIcGM9+RQ7LqKXXS+4ntpg1ih7URWzOijILJR9 84nE7f7soSP00N038Oaz2L+Oonr5ztYkJ0F5usiYZ8DMXLuG7iZufOWcX1wFSa5/ fQ2NKdC1C/O9vB4j1oUO0ZAss= 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:mime-version:reply-to:from:date:message-id :subject:to:content-type; s=default; bh=J+UPwrea+LfXgKlEd5h7uZHy fxo=; b=UachWZq2ufZtHRKkluLbjqHK9dh8RYPJksUzIDVNjrlqsgjVl41d3GAK RBuVEye9sX7yrm51J4bT8NKZNMRnL6VUkZhKCFyRdh1DUYrx/jPb23mx6UXbCexr I+LoonAzqxhfPB2h3fQVujA/D27QKphAJoU6QW332PGE2dUoAu8= 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=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=sem, 0x4, Hong, hong X-HELO: mail-wm0-f53.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to; bh=NqGOyJeZuWmhDhVM9AH7LN95wpmKTSc8KguPiei8H5A=; b=XmhL9NL7lJ3ASfL/fsXvXWbd9BaOOJ0BME07UrEK22AT2wSdYe7z/DhkVF6Ivfg9Uc Pizy7yZcOWCa5G9C5EPbSMGP2XCU6lKeCkXNvabKZ6k/dtNVqhd8jxutPCli65LFpF9c SW3TTJqJd2pPqEROMgrYUHWeMl4Sah41Mm7ZAmLgVleUegwAhrYaunn4Zf0VKieKZDks KU8vaB+v+CzXH3vuBZdrqrofddzDl2XyvvIWpfALxU5r1dKP4hSdVbs1oS0Wb73mW8G5 0BtTdBW76hHaiJInsPhlXnDv6rDyCfvH7tdEqpBIllU9fUqDtGCu3HM1JIYPttcYtcEs ecMQ== X-Gm-Message-State: ALyK8tL451V1KGmq2mV0tDLkPfAWrzPn7kH0mhmsMTVCmPldGrO6ZlDe3a9Twe/Xs9of583fXNxV3tpgYM0buQ== X-Received: by 10.195.2.228 with SMTP id br4mr9392085wjd.59.1467600348511; Sun, 03 Jul 2016 19:45:48 -0700 (PDT) MIME-Version: 1.0 Reply-To: fracting AT gmail DOT com From: Qian Hong Date: Mon, 4 Jul 2016 10:45:08 +0800 Message-ID: Subject: 64 bit Cywgin 2.5.2 on Wine: python fails with sem_init: Invalid argument To: cygwin Content-Type: multipart/mixed; boundary=001a11c3f0b47221380536c6551c X-IsSubscribed: yes --001a11c3f0b47221380536c6551c Content-Type: text/plain; charset=UTF-8 Hi folks, When compiling 64 bit Cygwin on Wine, I found a python{2,3} failure when building documentation [1]: xmlto --skip-validation --with-dblatex pdf -o cygwin-ug-net/ -m /drone/src/github.com/cygwin/cygwin/winsup/doc/fo.xsl /drone/src/github.com/cygwin/cygwin/winsup/doc/cygwin-ug-net.xml sem_init: Invalid argument Traceback (most recent call last): File "/usr/bin/dblatex", line 10, in from dbtexmf.dblatex import dblatex File "/usr/lib/python2.7/site-packages/dbtexmf/dblatex/dblatex.py", line 8, in from dbtexmf.core.dbtex import DbTex, DbTexCommand File "/usr/lib/python2.7/site-packages/dbtexmf/core/dbtex.py", line 11, in import urllib File "/usr/lib/python2.7/urllib.py", line 26, in import socket File "/usr/lib/python2.7/socket.py", line 67, in from _ssl import SSLError as sslerror ImportError: cannot import name SSLError make[3]: [Makefile:104: cygwin-ug-net/cygwin-ug-net.pdf] Error 1 (ignored) According to my previous experience this happens with previous version of Cygwin 64 bit on Wine, but works fine on Windows, and works fine on 32 bit Cygwin on Wine. I can't test latest git HEAD Cygwin version due to another known failure. I tried to track down the problem, and I found during the call of sem_init(sem, pshared=0, value=1), in some case pshared and value were unexpectedly changed to large integers after verifyable_object_isvalid(). I tried to reproduce with a simplified test case, and got the below code which behaviors wrong but not exactly in the same way: #include #include #include #include #include int main(int argc, char *argv[]) { sem_t *p_sem = malloc(sizeof(sem_t)); memset(p_sem, 0xcc, sizeof(sem_t)); /* trigger exception handling code in Cygwin sem_init()-->verifyable_object_isvalid() */ sem_init(p_sem, 0, 1); return 0; } Compiled using Cygwin gcc -pthread, The above code works fine on Cygwin on Windows and 32 bit Cygwin on Wine, but causes a stack overflow on 64 bit Cygwin on Wine. Unfortunately it does not fail exatly in the same way to Cygiwn python, but at least it brings some interesting question. I think it is a Wine bug which does not handle exception correctly, and I'm trying to track down deeper. At the time could anyone provide some hint which piece of Cygwin code could I learn to write a pure Win32 test case emulating the above example? I also attached +seh log comparing 64 bit Cygwin and 32 bit Cygwin on Wine, which show the stackoverflow on 64 bit but handles fine on 32 bit, hopefully that helps. I created a Wine bug on [2]. Thank you! [1] https://tea-ci.org/cygwin/cygwin/4 [2] https://bugs.wine-staging.com/show_bug.cgi?id=691 -- Regards, Qian Hong - http://www.winehq.org --001a11c3f0b47221380536c6551c Content-Type: text/plain; charset=US-ASCII; name="sem_init.wine.seh.64.txt" Content-Disposition: attachment; filename="sem_init.wine.seh.64.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_iq7ep3n60 MDBlYzp0cmFjZTpzZWg6cmFpc2VfZXhjZXB0aW9uIGNvZGU9YzAwMDAwMDUg ZmxhZ3M9MCBhZGRyPTB4MTgw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2Vo OlJ0bFVud2luZEV4ICByMTI9MDAwMDAwMDBmZmZmYjI1MCByMTM9MDAwMDAw MDBmZmZmYzllMCByMTQ9MDAwMDAwMDE4MDE1NGU5MSByMTU9MDAwMDAwMDBm ZmZmYjk4MAowMGVjOmVycjpzZWg6c2V0dXBfZXhjZXB0aW9uIHN0YWNrIG92 ZXJmbG93IDc0NzIgYnl0ZXMgaW4gdGhyZWFkIDAwZWMgZWlwIDAwMDAwMDAw N2JjOTljNjMgZXNwIDAwMDAwMDAwZmZmZjg4ZDAgc3RhY2sgMHhmZmUwMDAw MC0weGZmZmZhMDAwLTB4MTAwMDAwMDAwCjAwZWM6d2FybjpzZWg6YWJvcnRf dGhyZWFkIGV4aXQgZnJhbWUgb3V0c2lkZSBvZiBzdGFjayBsaW1pdHMgaW4g dGhyZWFkIDAwZWMgZnJhbWUgMHgzM2ZmODAgc3RhY2sgMHhmZmZmYTAwMC0w eDEwMDAwMDAwMAoK --001a11c3f0b47221380536c6551c Content-Type: text/plain; charset=US-ASCII; name="sem_init.wine.seh.32.txt" Content-Disposition: attachment; filename="sem_init.wine.seh.32.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_iq7epvem1 MDBjYTp0cmFjZTpzZWg6cmFpc2VfZXhjZXB0aW9uIGNvZGU9YzAwMDAwMDUg ZmxhZ3M9MCBhZGRyPTB4NjExMjRkYjkgaXA9NjExMjRkYjkgdGlkPTAwY2EK MDBjYTp0cmFjZTpzZWg6cmFpc2VfZXhjZXB0aW9uICBpbmZvWzBdPTAwMDAw MDAwCjAwY2E6dHJhY2U6c2VoOnJhaXNlX2V4Y2VwdGlvbiAgaW5mb1sxXT1j Y2NjY2NkMAowMGNhOnRyYWNlOnNlaDpyYWlzZV9leGNlcHRpb24gIGVheD1j Y2NjY2NjYyBlYng9MjAwMTAzNDggZWN4PTAwMDAwMDAwIGVkeD02MTIyYWE5 MCBlc2k9NjEzMjBmZTcgZWRpPTAwNjFjYTA0CjAwY2E6dHJhY2U6c2VoOnJh aXNlX2V4Y2VwdGlvbiAgZWJwPTAwNjFjYTA4IGVzcD0wMDYxYzlkMCBjcz0w MDIzIGRzPTAwMmIgZXM9MDAyYiBmcz0wMDYzIGdzPTAwNmIgZmxhZ3M9MDAw MTAyODYKMDBjYTp0cmFjZTpzZWg6Y2FsbF9zdGFja19oYW5kbGVycyBjYWxs aW5nIGhhbmRsZXIgYXQgMHg2MTAzMWFhMCBjb2RlPWMwMDAwMDA1IGZsYWdz PTAK --001a11c3f0b47221380536c6551c Content-Type: text/plain; charset=us-ascii -- 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 --001a11c3f0b47221380536c6551c--