public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: cygwin@cygwin.com, Girish Joglekar <girish53@gmail.com>
Subject: Re: Cygwin 64 problem
Date: Sun, 04 Dec 2016 15:59:00 -0000	[thread overview]
Message-ID: <dcc15a97-ca2d-90ee-a7a4-6106db368f76@cornell.edu> (raw)
In-Reply-To: <37067fb7-8250-5aff-ebb5-8abe6746c8f6@cornell.edu>

On 11/29/2016 3:14 PM, Ken Brown wrote:
> 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.

I've done that now.  There are three places in mosprshx.c where you cast a pointer to a pointer to an object of a different size.  Interesting things happen when you dereference that pointer.  The following patch gets rid of the crash:

--- mosprshx.c~ 2016-12-04 10:02:36.706325200 -0500
+++ mosprshx.c  2016-12-04 10:28:35.160038200 -0500
@@ -235,7 +235,7 @@
    }
    XtSetArg(al[ac],XmNcolumns,longestFixedColumnSize+1); ac++;
    if(toValue.addr) {
-      XtSetArg(al[ac],XmNfontList,*(unsigned int *)toValue.addr); ac++;
+      XtSetArg(al[ac],XmNfontList,*(XtArgVal *)toValue.addr); ac++;
    }
    for(i1=0 ; i1<nRows ; i1++) {
       sprintf(widgetName,"fixedColumnRow%d",i1);
@@ -265,7 +265,7 @@
       XtSetArg(al[ac],XmNcolumns,cellSize); ac++;
    }
    if(toValue.addr) {
-      XtSetArg(al[ac],XmNfontList,*(unsigned int *)toValue.addr); ac++;
+      XtSetArg(al[ac],XmNfontList,*(XtArgVal *)toValue.addr); ac++;
    }
    for(j1=0 ; j1<nColumns ; j1++) {
       sprintf(widgetName,"fixedRowColumn%d",j1);
@@ -295,7 +295,7 @@
             XtSetArg(al[ac],XmNmaxLength,cellSize); ac++;
          }
          if(toValue.addr) {
-            XtSetArg(al[ac],XmNfontList,*(unsigned int *)toValue.addr); ac++;
+            XtSetArg(al[ac],XmNfontList,*(XtArgVal *)toValue.addr); ac++;
          }
          sprintf(widgetName,"column%drow%d",j1,i1);
          variableRowAndColumnTF[loc] = XmCreateTextField(variableColumnFM[j1],widgetName,al,ac); loc++;


Ken

--
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

      reply	other threads:[~2016-12-04 15:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAGX=k3HczQGx=51xRwyKrwpKTMqaOVqxj+ud4UH=i1yCPAFGWQ@mail.gmail.com>
2016-11-28 12:03 ` Ken Brown
2016-11-28 14:34   ` Duncan Roe
2016-11-28 16:19     ` Ken Brown
2016-11-30  3:01   ` Ken Brown
2016-12-04 15:59     ` Ken Brown [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dcc15a97-ca2d-90ee-a7a4-6106db368f76@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=cygwin@cygwin.com \
    --cc=girish53@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).