comp.lang.ada
 help / color / mirror / Atom feed
* Ada/X Windows Newbie Problem
@ 1996-10-09  0:00 Scott D. Curtis
  1996-10-09  0:00 ` David Emery
  1996-10-10  0:00 ` Jon S Anthony
  0 siblings, 2 replies; 4+ messages in thread
From: Scott D. Curtis @ 1996-10-09  0:00 UTC (permalink / raw)



Howdy!
   Can anyone suggest why the following statement is raising a STORAGE_ERROR:

   hWnd := Xt.Intrinsic.XtVaCreateManagedWidget(
              "pushme",
              Motif.Pushb.XmPushButtonWidgetClass_obj,
             parent,
            Stdarg.Empty & Motif.xmstrdefs.XmNlabelString & label & Nulst
        );

   where parent is of type Widget, label is of type Motif.Xm.XmString.

The (very simple program) has no recursive calls and the debugger
verifies that there is no stack overflow. Tracing back through the
calls made by this function, I believe that the underlying C function
in Xlib is failing with one of the pointer values but none of my
colleagues can spot it.

Regards,
   Scott D. Curtis





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada/X Windows Newbie Problem
  1996-10-09  0:00 Ada/X Windows Newbie Problem Scott D. Curtis
@ 1996-10-09  0:00 ` David Emery
  1996-10-10  0:00 ` Jon S Anthony
  1 sibling, 0 replies; 4+ messages in thread
From: David Emery @ 1996-10-09  0:00 UTC (permalink / raw)



Scott Curtis wrote:`
>Howdy!
>   Can anyone suggest why the following statement is raising a STORAGE_ERROR:
>
>   hWnd := Xt.Intrinsic.XtVaCreateManagedWidget(
>              "pushme",
>              Motif.Pushb.XmPushButtonWidgetClass_obj,
>             parent,
>            Stdarg.Empty & Motif.xmstrdefs.XmNlabelString & label & Nulst
>        );
>
>   where parent is of type Widget, label is of type Motif.Xm.XmString.

I'd be willing to bet it's either the string "pushme" or the string
produced by 
  Stdarg.Empty & Motif.xmstrdefs.XmNlabelString & label & Nulst
with my money placed on the first string.  Try this, which should
be completely "benign":
	
   hWnd := Xt.Intrinsic.XtVaCreateManagedWidget(
              "pushme" & Ascii.nul,
              Motif.Pushb.XmPushButtonWidgetClass_obj,
             parent,
            Stdarg.Empty & Motif.xmstrdefs.XmNlabelString & label & Nulst
        );


				dave
--
<.sig is away on vacation>





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada/X Windows Newbie Problem
  1996-10-09  0:00 Ada/X Windows Newbie Problem Scott D. Curtis
  1996-10-09  0:00 ` David Emery
@ 1996-10-10  0:00 ` Jon S Anthony
  1996-10-10  0:00   ` Robert Dewar
  1 sibling, 1 reply; 4+ messages in thread
From: Jon S Anthony @ 1996-10-10  0:00 UTC (permalink / raw)



In article <53g3e1$fj5@curlew.mtx.net.au> scurtis@dove.mtx.net.au (Scott D. Curtis) writes:

>    hWnd := Xt.Intrinsic.XtVaCreateManagedWidget(
>               "pushme",
>               Motif.Pushb.XmPushButtonWidgetClass_obj,
>              parent,
>             Stdarg.Empty & Motif.xmstrdefs.XmNlabelString & label & Nulst
>         );
> 
>    where parent is of type Widget, label is of type Motif.Xm.XmString.
....
> calls made by this function, I believe that the underlying C function
> in Xlib is failing with one of the pointer values

Almost certainly.  On the face of it, it looks about right.  Have you
assigned label and parent???


>    Can anyone suggest why the following statement is raising a STORAGE_ERROR:

To any ACT folk (or other GNAT savvy folk):

I've noticed that GNAT (tries?) to raise Storage_Error in this sort of
case (bad pointer dereference attempt in imported code), though it is
not always successful.  Is this (the "catching" of the segv and
raising of SE) by design or accidental in some way?

/Jon
-- 
Jon Anthony
Organon Motives, Inc.
1 Williston Road, Suite 4
Belmont, MA 02178

617.484.3383
jsa@organon.com





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada/X Windows Newbie Problem
  1996-10-10  0:00 ` Jon S Anthony
@ 1996-10-10  0:00   ` Robert Dewar
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Dewar @ 1996-10-10  0:00 UTC (permalink / raw)



iJon asked

"I've noticed that GNAT (tries?) to raise Storage_Error in this sort of
case (bad pointer dereference attempt in imported code), though it is
not always successful.  Is this (the "catching" of the segv and
raising of SE) by design or accidental in some way?"

The only legitimate sigsegv that can occur is one caused by reference to
the stack guard page (in implementatoins where this occurs). This causes
storage error to be raised. There is some attempt to determine whether
the sigsegv is a result of a real storage error, but it is not always
successful.

All other cases of sigsegv's correspond to erroneous programs, and raising
storage error is of course a perfectly acceptable execution semantics for
an erroneous execution.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1996-10-10  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-10-09  0:00 Ada/X Windows Newbie Problem Scott D. Curtis
1996-10-09  0:00 ` David Emery
1996-10-10  0:00 ` Jon S Anthony
1996-10-10  0:00   ` Robert Dewar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox