home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / Programming / Source / winterp-1.13 / doc / BUGS next >
Encoding:
Text File  |  1991-10-06  |  8.8 KB  |  164 lines

  1. # WINTERP Copyright 1989, 1990, 1991 Hewlett-Packard Company (by Niels Mayer).
  2. # XLISP version 2.1, Copyright (c) 1989, by David Betz.
  3. #
  4. # Permission to use, copy, modify, distribute, and sell this software and its
  5. # documentation for any purpose is hereby granted without fee, provided that
  6. # the above copyright notice appear in all copies and that both that
  7. # copyright notice and this permission notice appear in supporting
  8. # documentation, and that the name of Hewlett-Packard, David Betz and
  9. # Niels Mayer not be used in advertising or publicity pertaining to distribution
  10. # of the software without specific, written prior permission.  Hewlett-Packard,
  11. # David Betz and Niels Mayer makes no representations about the suitability of
  12. # this software and documentation for any purpose.  It is provided "as is"
  13. # without express or implied warranty.
  14. #
  15.  
  16. There following describes bugs in WINTERP, all of which surfaced with Motif
  17. 1.1, and will hopefully go away in Motif 1.2 and/or X11r5. Despite these
  18. bugs, we've managed to run a number of WINTERP applications successfully --
  19. it is important to know the cause of these problems, and have knowledge of
  20. what sorts of operations will cause trouble.
  21.  
  22.             --------------------
  23.  
  24. The first bug occurs whenever a shell containing a popup or option menu is
  25. closed.  This causes an erroneous XtWarning:
  26.  
  27.     "Warning: Attempt to remove non-existant passive grab"
  28.  
  29. The warning itself is harmless. However, if you start up WINTERP with
  30. resource "Winterp.enableXtWarningBreak" set to TRUE (or specify the command
  31. line flag "-enable_xtwarn_brk"), you will notice problems. When
  32. enableXtWarningBreak is set, any XtWarnings will break out of the routine
  33. that caused the XtWarning and go to the XLISP error handling routine. For
  34. many XtWarnings, that works out just fine, allowing you to trace the exact
  35. call which cause the toolkit to balk. Unfortunately, for the "Attempt to
  36. remove non-existant passive grab" warning, it seems to leave Motif/Xt in an
  37. indeterminate state that can result in odd behavior, program freezes, or
  38. core dumps. After a popup menu gets popupped up, any subsequent attempts at
  39. "closing" the shell containing the popup-menu or option-menu don't work
  40. correctly. By "closing" I mean using the window-manager's "close" menu
  41. entry (f.kill). Upon doing a "close" on a shell containing a popup menu,
  42. I've seen a number of things happen:
  43.    (1) The "close" is ignored, but subsequent attempts at closing a
  44.        different WINTERP shell result in a core dump.
  45.    (2) Doing the "close" generates the message:
  46.     error: X Toolkit Warning:
  47.         Attempt to remove non-existant passive grab
  48.        Doing the "close" again, on either the same shell, or a different
  49.        WINTERP shell will result in the following sort of error message:
  50.     XIO:  fatal IO error 32 (Broken pipe) on X server "unix:0.1"
  51.     after 19581 requests (19573 known processed) with 0 events remaining.
  52.     The connection was probably broken by a server shutdown or KillClient.
  53.  
  54. The workaround for the above problem is simple -- don't set resource
  55. "Winterp.enableXtWarningBreak" to TRUE. The default for WINTERP 1.13 is to
  56. set the resource to FALSE so as to avoid the problem.
  57.  
  58. Typically, you will also want to deliver WINTERP applications with
  59. "Winterp.enableXtWarningBreak" set to the default FALSE value. XtWarnings
  60. can occur when your X server runs out of colors, or can't find a particular
  61. font, etc -- such situations often warrant continuing program operation
  62. normally (after issuing a warning), rather than causing a Lisp break.
  63.  
  64. The only reason why you'd want to set "Winterp.enableXtWarningBreak" to
  65. TRUE is during debugging a program -- enableXtWarningBreak combined with
  66. 'baktrace' will allow you to figure out which particular call in your
  67. program caused the warning to be issued.
  68.  
  69.             --------------------
  70.  
  71. The second major problem is related to X11r4&Motif-1.1's flaw of not being
  72. able to destroy widgets properly when running in nested Xt eventloops
  73. (XtAppMainLoop(), or XtAppNextEvent()+XtDispatchEvent()). This had not been
  74. a problem in Motif 1.0/X11r3 which was WINTERP's original design platform,
  75. and the bug has supposedly been fixed in Motif 1.2 and X11r5.
  76.  
  77. WINTERP uses nested event loops in its handling of XLISP's debug breakloop.
  78. Problems seem to arise when XLISP is set up such that Lisp, Motif, Xt, or X
  79. errors throw into the Lisp break loop "at the wrong time".  This mode is
  80. not the default for XLISP -- it must be explicitly enabled by setting
  81. variable *BREAKENABLE* to T, by evaluating the function DEBUG (defined in
  82. examples/initialize.lsp), or by turning on the "debug" toggle-button in
  83. examples/w_ctrlpnl.lsp.
  84.  
  85. The symptoms of the problem are that on certain occasions, when
  86. *BREAKENABLE* is set, and a previous error has thrown you into the
  87. breakloop, you will not be able to destroy widgets or close windows using
  88. the window manager "close" (f.kill) function. Sometimes you will also see
  89. subsequent core dumps and other strange behavior indicating that Motif is
  90. stepping on its own memory.
  91.  
  92. The problem will simply not arise if *BREAKENABLE* is not set. There are
  93. even occasions where *BREAKENABLE* can be set and you won't see this
  94. problem.  Unfortunately, that may make debugging WINTERP programs difficult
  95. because you won't be able to find out which particular section of code
  96. caused an error and you will have to rely on the information presented by
  97. the error message.
  98.  
  99. The problem is seems to be caused by entering/exiting out of a break-level
  100. through a callback, which was how WINTERP 1.12's w_ctrlpnl.lsp implemented
  101. the Err-Cont (continue), Err-^Level (clean-up), and Err-~Level (top-level)
  102. commnands. Likewise, the problem will manifest itself if an error occurs
  103. while loading a file out of a callback (an error will throw into a
  104. different nesting of event loop). The workaround is to prevent such cases
  105. from arising out of callbacks.
  106.  
  107. WINTERP 1.13's w_ctrlpnl.lsp implements (kludges, hacks,...) the workaround
  108. to this problems by having "Load File", "Err-Cont", "Err-^Level", and
  109. "Err-~Level" not move between break-levels through callbacks. Instead, they
  110. call WINTERP's eval-server through the kludge of calling the Winterp-Lisp
  111. client 'wl' through SYSTEM. While this is certainly less direct/efficient
  112. means of interacting with XLISP than presented in WINTERP 1.12's
  113. w_ctrlpnl.lsp, users will not notice this as a problem since the operation
  114. occurs once per click on the "Load File", "Err-Cont", "Err-^Level", or
  115. "Err-~Level" buttons (i.e. it's a non-inner loop sort of operation).
  116.  
  117. The only real problem caused by this workaround to w_ctrlpnl.lsp is that
  118. you will not be able to use the control panel with a WINTERP that doesn't
  119. have an eval-server running (i.e. you must not specify -no_unix_server
  120. command line flag or resource "Winterp.enableUnixServer: false"). Of
  121. course, w_ctrlpnl.lsp now requires that the executable 'wl' be on your
  122. search path. Note that for Motif 1.0, none of this is a problem --
  123. w_ctrlpnl.lsp knows which version of Motif you are running and will adjust
  124. it's behavior accordingly, such that the "normal" callback-based "Load
  125. File", "Err-Cont", "Err-^Level", and "Err-~Level" functions will occur.
  126.  
  127. When interacting with WINTERP through the gnu-emacs interface
  128. (src-client/winterp.el), the eval-server is used by default, which means
  129. you will not be incurring the problem of entering/exiting the breakloop out
  130. of a callback.
  131.  
  132. I'm looking into better solutions for this problem in WINTERP release 1.14.
  133. Until then, please note the above warnings such that you can avoid
  134. problems, or at least understand which actions you took are causing
  135. problems. At worst, while debugging, you'll have to restart WINTERP
  136. occasionally, which is still far better than restarting a C application
  137. every time a trivial error occurs. Typically, delivered WINTERP
  138. applications will never enter a break-level, and when they do, it may make
  139. the most sense to pop up a dialog box and exit.
  140.  
  141.             --------------------
  142.  
  143. The last problem of note in WINTERP 1.13 and Motif 1.1 is that option menus
  144. created via XmCreateSimpleOptionMenu() (see examples/RowColumn.lsp) invoke
  145. yet another widget destroy problem. Basically, anytime I destroy a shell
  146. containing a simple option menu, I get a core dump, typically containgin
  147. the following C backtrace:
  148. | __XtDoPhase2Destroy+0x44:       _XtCreateApplicationShell+0x1CA (0x1F1538)
  149. | _XtDispatchEvent+0x46:  __XtDoPhase2Destroy     (0x151E88, 0x1)
  150. | _main+0x9FE:    _XtDispatchEvent(0xFFEFFCB8)
  151.  
  152. This problem, seems to be fixed in WINTERP 1.14, which will be released
  153. real soon now. Put yourself on the WINTERP mailing list
  154. (winterp-request@hplnpm.hpl.hp.com) or watch
  155. comp.windows.x/comp.windows.x.motif for annoucements of that release.
  156.  
  157. -------------------------------------------------------------------------------
  158.         Niels Mayer -- hplabs!mayer -- mayer@hplabs.hp.com
  159.           Human-Computer Interaction Department
  160.                Hewlett-Packard Laboratories
  161.                   Palo Alto, CA.
  162.                    *
  163.