From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88597 invoked by alias); 29 Nov 2016 20:14:37 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 88519 invoked by uid 89); 29 Nov 2016 20:14:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_40,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=drow, Crash, Marco, 2816 X-HELO: limerock04.mail.cornell.edu Received: from limerock04.mail.cornell.edu (HELO limerock04.mail.cornell.edu) (128.84.13.244) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 29 Nov 2016 20:14:33 +0000 X-CornellRouted: This message has been Routed already. Received: from authusersmtp.mail.cornell.edu (granite4.serverfarm.cornell.edu [10.16.197.9]) by limerock04.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id uATKEVA0005733 for ; Tue, 29 Nov 2016 15:14:31 -0500 Received: from [10.128.147.78] (dhcp-gs-4942.eduroam.cornell.edu [10.128.147.78]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id uATKEUwG001166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Tue, 29 Nov 2016 15:14:31 -0500 Subject: Re: Cygwin 64 problem To: cygwin@cygwin.com References: From: Ken Brown Message-ID: <37067fb7-8250-5aff-ebb5-8abe6746c8f6@cornell.edu> Date: Wed, 30 Nov 2016 03:01:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------03FA48B83655A9D841B7A1DA" X-PMX-Cornell-Gauge: Gauge=XX X-PMX-CORNELL-AUTH-RESULTS: dkim-out=none; X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00341.txt.bz2 --------------03FA48B83655A9D841B7A1DA Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Content-length: 4279 On 11/27/2016 11:02 AM, Ken Brown wrote: > On 11/27/2016 9:03 AM, Girish Joglekar wrote: >> Hi Ken, >> Thank you for your reply on the Cygwin mailing list. I have created a >> slightly smaller test example smaller than what I had created in Feb. >> Attached is a tar file. After make insall if you run TEST.x and click >> the Open button, it gives segmentation fault. >> Hope you will be able to help. >> Thank you. >> Girish > > Please keep the discussion on the mailing list so that people who might > be able to help will see it. I personally am not familiar with X11 > programming, so I'm not one of those people. > > I do have a few comments, however: > > 1. This may be slightly smaller than your previous program, but it is > still *very* far from a small test case. You really can't expect people > to debug a program of this size for you. > > 2. I suggest that you build with -Wall (as Marco already suggested in > the earlier discussion) and fix all the compiler warnings. I saw > several that need attention (aside from the many "unused variable" > warnings). It wouldn't hurt to also use -Wextra. > > 3. I also suggest that you use gdb to find out where the program is > crashing and why. You made a start on that in the discussion last > March, but you didn't follow through. (By the way, I recommend building > without optimization; otherwise you may not be able to get accurate > information about the crash from gdb.) > > 4. If, after the steps above, you still think the crash is due to a > Cygwin bug rather than a programming error, then try to extract from > your program a test case as small as possible that reproduces the crash. I've looked at this a little, and the crash occurs because of a bad value of a pointer to a font list. I'm attaching an annotated transcript of a gdb session that illustrates this. I didn't try to figure out where the bad pointer came from. As a workaround, you can avoid the crash by removing from mosprshx.c all uses of spreadSheetFont, as in the following patch: --- mosprshx.c~ 2016-11-27 08:46:12.000000000 -0500 +++ mosprshx.c 2016-11-29 14:58:23.114377500 -0500 @@ -29,8 +29,6 @@ 0x00, 0x7c, 0x07, 0x1e, 0x0f, 0x07, 0x9e, 0x03, 0xfc, 0x01, 0xf8, 0x00, 0x70, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00}; -static char *spreadSheetFont = "-adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1"; - #ifdef __STDC__ static void mosprshCreateCheckMarkPixmap(Widget pushButton) #else @@ -208,11 +206,6 @@ if(isParentManaged) XtUnmanageChild(parentFM); - fromValue.addr = spreadSheetFont; - fromValue.size = utStringLength(fromValue.addr) + 1; - toValue.addr = NULL; - XtConvertAndStore(parentFM,XmRString,&fromValue,XmRFontList,&toValue); - ac = 0; XtSetArg(al[ac],XmNuserData,(XtPointer)spreadSheetSize); ac++; spreadSheet = XmCreateForm(parentFM,"SpreadSheet",al,ac); @@ -234,9 +227,6 @@ XtSetArg(al[ac],XmNtraversalOn,FALSE); ac++; } XtSetArg(al[ac],XmNcolumns,longestFixedColumnSize+1); ac++; - if(toValue.addr) { - XtSetArg(al[ac],XmNfontList,*(unsigned int *)toValue.addr); ac++; - } for(i1=0 ; i1 0) { XtSetArg(al[ac],XmNcolumns,cellSize); ac++; } - if(toValue.addr) { - XtSetArg(al[ac],XmNfontList,*(unsigned int *)toValue.addr); ac++; - } for(j1=0 ; j1) at /usr/src/debug/motif-2.3.6-1/lib/Xm/XmFontList.c:637 #2 0x00000003fc657920 in InitializeTextStruct (tf=tf@entry=0x6000af730) at /usr/src/debug/motif-2.3.6-1/lib/Xm/TextF.c:7295 #3 0x00000003fc657e67 in Initialize (request=request@entry=0x6000afb40, new_w=new_w@entry=0x6000af730, args=args@entry=0xffffbd60, num_args=num_args@entry=0xffffb320) at /usr/src/debug/motif-2.3.6-1/lib/Xm/TextF.c:7817 #4 0x00000003fc469bb1 in CallInitialize ( class=0x3fc72c440 , req_widget=req_widget@entry=0x6000afb40, new_widget=new_widget@entry=0x6000af730, args=args@entry=0xffffbd60, num_args=num_args@entry=8) at /usr/src/debug/libXt-1.1.5-1/src/Create.c:226 #5 0x00000003fc46a65c in xtCreate ( name=name@entry=0xffffb950 "fixedColumnRow0", class=class@entry=0x0, widget_class=widget_class@entry=0x3fc72c440 , parent=0x1fc5dd590, parent@entry=0x6000af0d0, default_screen=0x600052780, args=args@entry=0xffffbd60, num_args=num_args@entry=8, typed_args=typed_args@entry=0x0, num_typed_args=num_typed_args@entry=0, parent_constraint_class=0x3fc720dc0 , post_proc=post_proc@entry=0x3fc469bf0 ) at /usr/src/debug/libXt-1.1.5-1/src/Create.c:416 #6 0x00000003fc46a906 in _XtCreateWidget ( name=name@entry=0xffffb950 "fixedColumnRow0", widget_class=widget_class@entry=0x3fc72c440 , parent=parent@entry=0x6000af0d0, args=args@entry=0xffffbd60, num_args=num_args@entry=8, typed_args=typed_args@entry=0x0, num_typed_args=num_typed_args@entry=0) at /usr/src/debug/libXt-1.1.5-1/src/Create.c:570 #7 0x00000003fc46abd9 in XtCreateWidget (name=0xffffb950 "fixedColumnRow0", widget_class=0x3fc72c440 , parent=0x6000af0d0, args=0xffffbd60, num_args=8) at /usr/src/debug/libXt-1.1.5-1/src/Create.c:589 #8 0x00000003fc658a81 in XmCreateTextField (parent=, name=, arglist=, argcount=) at /usr/src/debug/motif-2.3.6-1/lib/Xm/TextF.c:10645 #9 0x000000010040882d in mosprshCreateSpreadsheet (parentFM=0x6000acc60, spreadSheetTitle=0x100421087 "Measuring Unit Specification", rowNames=0x6000ab4f0, columnNames=0x6000ab4b0, cellSize=0, mosprshCheckButtonCallback=0x0) at mosprshx.c:242 [...] +p *table $1 = (struct __XmRenderTableRec *) 0x56f700001ea1 +p *$ Cannot access memory at address 0x56f700001ea1 +f 2 #2 0x00000003fc657920 in InitializeTextStruct (tf=tf@entry=0x6000af730) at /usr/src/debug/motif-2.3.6-1/lib/Xm/TextF.c:7295 7295 TextF_FontList(tf) = (XmFontList)XmFontListCopy(TextF_FontList(tf)); +p tf->text.font_list $2 = (XmFontList) 0xaeeb0 [This is the bad pointer that was propagated to XmRenderTableCopy. I didn't chase down where it came from.] --------------03FA48B83655A9D841B7A1DA Content-Type: text/plain; charset=us-ascii Content-length: 218 -- 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 --------------03FA48B83655A9D841B7A1DA--