Re: IDL 6.3 segmentation fault [message #48923] |
Thu, 01 June 2006 10:22 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
shd writes:
> I agree. My snippet suggests that the program name is 'build_gui', but
> that's not the case. I also posted generic names for my procedures
> because I'm sure that my actual naming scheme (which consists of unique
> names) has nothing to do with this issue. I've checked that. I agree
> that the indirection was needless so I dropped the '_exit' procedure
> and replaced it with the 'widget_control' call, but I'm still
> experiencing the crash.
>
> It really isn't that big a deal, just a mild annoyance which is easily
> avoided (ie.: don't use the toolbar button). I just thought it was
> strange that IDL doesn't crash until I try to restart the program and
> only from the command-line interpreter, not from the IDE.
I think it's strange, too. :-)
And if all is as you say it is, I would lean more toward "bug"
than "error", especially if it is reproducible.
> P.S. Good work on the website. It's been a great resource.
Thanks. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: IDL 6.3 segmentation fault [message #48924 is a reply to message #48923] |
Thu, 01 June 2006 10:13  |
shd
Messages: 4 Registered: June 2006
|
Junior Member |
|
|
David Fanning wrote:
> Well, poorly named widget program, then. :-)
> In any case, I don't see anything (except needless indirection) that
> causes me any worries. Perhaps you are not calling the _EXIT procedure
> you *think* you are calling. Easily done, I think, with this
> kind of naming scheme.
I agree. My snippet suggests that the program name is 'build_gui', but
that's not the case. I also posted generic names for my procedures
because I'm sure that my actual naming scheme (which consists of unique
names) has nothing to do with this issue. I've checked that. I agree
that the indirection was needless so I dropped the '_exit' procedure
and replaced it with the 'widget_control' call, but I'm still
experiencing the crash.
It really isn't that big a deal, just a mild annoyance which is easily
avoided (ie.: don't use the toolbar button). I just thought it was
strange that IDL doesn't crash until I try to restart the program and
only from the command-line interpreter, not from the IDE.
Thanks for the suggestions.
P.S. Good work on the website. It's been a great resource.
|
|
|
Re: IDL 6.3 segmentation fault [message #48927 is a reply to message #48924] |
Thu, 01 June 2006 09:18  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
shd writes:
> Ok, I see the confusion. Clarification:
>
> ==============================
> pro _exit, top
> widget_control, top, /DESTROY
> end
>
> pro action_event, event
> widget_control, event.id, GET_UVALUE=action
>
> case action of
> ...
> 'exit': _exit, event.top
> ...
> endcase
> end
>
> pro build_gui
> ...
>
> ; Create 'File' menu.
> wmenu = widget_button(mbar, VALUE='File', /MENU, $
> EVENT_PRO='action_event')
> ...
> w = widget_button(wmenu, VALUE='Exit', UVALUE='exit', /SEPARATOR)
> ...
>
> ; Create toolbar.
> wtb = widget_base(tlb, UNAME='toolbar', /ROW, /TOOLBAR, $
> EVENT_PRO='action_event')
> ...
> w = widget_button(wtb, VALUE='Exit', UVALUE='exit', $
> TOOLTIP='Exit program.')
> ...
> end
> ==============================
>
> I probably should have just said that in the first place, huh?
Well, poorly named widget program, then. :-)
In any case, I don't see anything (except needless indirection) that
causes me any worries. Perhaps you are not calling the _EXIT procedure
you *think* you are calling. Easily done, I think, with this
kind of naming scheme.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: IDL 6.3 segmentation fault [message #48929 is a reply to message #48927] |
Thu, 01 June 2006 08:55  |
shd
Messages: 4 Registered: June 2006
|
Junior Member |
|
|
David Fanning wrote:
>
> Strangely written widget program!
>
> This is not an event handler, so I presume it is a KILL_NOTIFY
> callback. But, assigned to two different widgets!? I suggest
> you are not killing what you *think* you are killing. :-)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
<rereads his post... smacks his forehead>
Ok, I see the confusion. Clarification:
==============================
pro _exit, top
widget_control, top, /DESTROY
end
pro action_event, event
widget_control, event.id, GET_UVALUE=action
case action of
...
'exit': _exit, event.top
...
endcase
end
pro build_gui
...
; Create 'File' menu.
wmenu = widget_button(mbar, VALUE='File', /MENU, $
EVENT_PRO='action_event')
...
w = widget_button(wmenu, VALUE='Exit', UVALUE='exit', /SEPARATOR)
...
; Create toolbar.
wtb = widget_base(tlb, UNAME='toolbar', /ROW, /TOOLBAR, $
EVENT_PRO='action_event')
...
w = widget_button(wtb, VALUE='Exit', UVALUE='exit', $
TOOLTIP='Exit program.')
...
end
==============================
I probably should have just said that in the first place, huh?
|
|
|
Re: IDL 6.3 segmentation fault [message #48930 is a reply to message #48929] |
Thu, 01 June 2006 08:39  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
shd writes:
> I wanted to post this as a reply to a thread on this group called
> 'How to debug seg fault' but it's past the 30 day mark. The author of
> that thread experienced something similar.
>
> I'm getting a bit of odd behavior from my widget program on Ubuntu
> 5.10. My GUI has a 'File' menu and a toolbar, both of which contain an
> 'Exit' item which execute the exact same code:
>
> ====================
> pro _exit, top
> widget_control, top, /DESTROY
> end
> ====================
>
> I'm working from the command-line interpreter, not the IDE. Here's the
> wierdness:
>
> I compile and launch my program and press the 'Exit' button on the
> toolbar. When I try to re-launch the program, my GUI doesn't come up
> and IDL exits with only a 'Segmentation fault' message. However, if I
> exit my GUI by simply killing the window (clicking the 'X' on the
> border), the seg. fault doesn't occur. Also, if I exit the GUI by
> selecting 'Exit' from the 'File' menu, the seg. fault doesn't occur.
> So I launched the IDE to step through the program and it got much
> stranger. I can't reproduce the segmentation fault from the IDE no
> matter how I exit my GUI.
>
> Any else seen something like this?
Strangely written widget program!
This is not an event handler, so I presume it is a KILL_NOTIFY
callback. But, assigned to two different widgets!? I suggest
you are not killing what you *think* you are killing. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|