History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-5205
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: P0 P0
Assignee: Unassigned
Reporter: P T Withington
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

Debug.whyAlive no longer shows reference keeping object alive

Created: 05/Dec/07 04:50 PM   Updated: 19/Mar/08 08:41 AM
Component/s: Debugger
Affects Version/s: Legals, RingDing (4.1)
Fix Version/s: RingDing (4.1), Eskimo Pie (4.0.8)

Time Tracking:
Not Specified

Severity: Minor
Fixed in Change#: 7,489
Runtime: N/A
Fix in hand: False


 Description  « Hide
On 2007-12-05, at 15:43 EST, Antun Karlovac wrote:

Also, the output from whyAlive() differs in 4.0.x than in what we used before. Previously, it actually showed the references that were keeping the objects alive; it no longer does. So we're also wondering what's changed there.

That's a regression. As a workaround, before you start, in the Debugger say:

  Debug.printLength = Infinity

After you do:

  Debug.whyAlive()

Which gives the unsatisfactory result, in the Debugger say:

  Debug.format("%s", _.toString());

which should give you a more useful result.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
P T Withington - 09/Dec/07 05:45 AM
r7489 | ptw | 2007-12-09 08:42:32 -0500 (Sun, 09 Dec 2007) | 53 lines
Changed paths:
   M /openlaszlo/trunk/WEB-INF/lps/lfc/compiler/LzFormatter.lzs
   M /openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzMessage.lzs
   M /openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/dhtml/LzDebug.js
   M /openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/swf/LzDebug.as
   M /openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/swf/LzMemory.as

Change 20071207-ptw-v by ptw@dueling-banjos.local on 2007-12-07 22:50:21 EST
    in /Users/ptw/OpenLaszlo/ringding-2
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Bring memory tracing to the modern era

Bugs Fixed:
LPP-5205: 'Debug.whyAlive no longer shows reference keeping object alive'

Technical Reviewer: philip@pbrdev.com (message:<20071208152841.7BC797C16E@hemicuda.laszlosystems.com>)
QA Reviewer: yfang@laszlosystems.com (pending)

Details:
    LzMessage: fix error in concat observed in passing, make
    appendInternal of another LzMessage concat, not present the
    message

    LzMemory: Make some things classes. Store leaks as a new class
    that has a pretty descriptor and breaks out the leak information
    for easy inspection. Use a stable sort on leaks, sort the biggest
    leak to the front of the Array. Make whyAlive describe the top
    leaks.

    LzDebug.*: Use user toString methods, obey unique flag.

    LzFormatter: New formatting flag `=` takes the next argument as
    the object to be represented by the format (overriding the normal
    hot-linking that occurs in the debugger so you can write a custom
    representation for an object).

Tests:
    Debug.markObjects()
    Debug.findNewObjects()
    Debug.whyAlive()

    now yields useful information:

    lzx> Debug.whyAlive()
    global.spriteroot.$m1.debugloader.loadmc1.reqobj: (?52) ?Object#100| {_dbg_check:...?
    global.LzFocus.csel.sprite.__LZtextclip.filters: (?6) ?Array(0)#102| []?
    global.LzModeManager.__LZlastclick.sprite.__LZbuttonRef.but.filters: (?6) ?Array(0)#104| []?
    global.__offscreenkeyclip.filters: (?6) ?Array(0)#106| []?
    global.spriteroot.$m0.$m0.$m5.$LzText.filters: (?6) ?Array(0)#108| []?
    global.spriteroot.$m0.$m0.$mcB.but.filters: (?6) ?Array(0)#110| []?
    global.spriteroot.$m1.$m0.$m0.$mcB.but.filters: (?6) ?Array(0)#112| []?
    global.spriteroot.$m1.$m0.$m1.$m0.$mcB.but.filters: (?6) ?Array(0)#114| []?
    global.spriteroot.$m1.$m0.$m1.$m1.$mcB.but.filters: (?6) ?Array(0)#116| []?
    global.spriteroot.$m1.$m0.$m1.$m2.$mcB.but.filters: (?6) ?Array(0)#118| []?
    ...
    ?__LzLeaks(28)#120| 208 smoots?
    lzx>



P T Withington - 03/Jan/08 08:54 AM
Migrated to Wafflecone or 4.0.8:

r7714 | ptw | 2008-01-03 11:38:08 -0500 (Thu, 03 Jan 2008) | 132 lines
Changed paths:
   M /openlaszlo/branches/wafflecone
   M /openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/compiler/LzFormatter.lzs
   M /openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/compiler/LzRuntime.lzs
   M /openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/Library.lzs
   M /openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzDebug.lzs
   A /openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzMemory.lzs (from /openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzMemory.lzs:7708)
   M /openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/LzMessage.lzs
   M /openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/platform/dhtml/LzDebug.js
   M /openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/platform/dhtml/kernel.js
   M /openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/platform/swf/LzDebug.as
   D /openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/debugger/platform/swf/LzMemory.as
   M /openlaszlo/branches/wafflecone/lps/includes/laszlo-debugger.css

Change 20080102-ptw-l by ptw@dueling-banjos.local on 2008-01-02 19:49:48 EST
    in /Users/ptw/OpenLaszlo/wafflecone
    for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone

Summary: Merged revisions 7489,7573 via svnmerge from
http://svn.openlaszlo.org/openlaszlo/trunk

Technical Reviewer: amy (Message-ID: <12587382.4001199377511558.JavaMail.amuntz@hedwig.laszlosystems.com>)
QA Reviewer: mamye (pending)

Details:
........
  r7489 | ptw | 2007-12-09 08:42:32 -0500 (Sun, 09 Dec 2007) | 53 lines
  
  Change 20071207-ptw-v by ptw@dueling-banjos.local on 2007-12-07 22:50:21 EST
      in /Users/ptw/OpenLaszlo/ringding-2
      for http://svn.openlaszlo.org/openlaszlo/trunk
  
  Summary: Bring memory tracing to the modern era
  
  Bugs Fixed:
  LPP-5205: 'Debug.whyAlive no longer shows reference keeping object alive'
  
  Technical Reviewer: philip@pbrdev.com (message:<20071208152841.7BC797C16E@hemicuda.laszlosystems.com>)
  QA Reviewer: yfang@laszlosystems.com (pending)
  
  Details:
      LzMessage: fix error in concat observed in passing, make
      appendInternal of another LzMessage concat, not present the
      message
  
      LzMemory: Make some things classes. Store leaks as a new class
      that has a pretty descriptor and breaks out the leak information
      for easy inspection. Use a stable sort on leaks, sort the biggest
      leak to the front of the Array. Make whyAlive describe the top
      leaks.
  
      LzDebug.*: Use user toString methods, obey unique flag.
  
      LzFormatter: New formatting flag `=` takes the next argument as
      the object to be represented by the format (overriding the normal
      hot-linking that occurs in the debugger so you can write a custom
      representation for an object).
  
  Tests:
      Debug.markObjects()
      Debug.findNewObjects()
      Debug.whyAlive()
  
      now yields useful information:
  
      lzx> Debug.whyAlive()
      global.spriteroot.$m1.debugloader.loadmc1.reqobj: (?\194?\16352) ?\194?\171Object#100| {_dbg_check:...?\194?\187
      global.LzFocus.csel.sprite.__LZtextclip.filters: (?\194?\1636) ?\194?\171Array(0)#102| []?\194?\187
      global.LzModeManager.__LZlastclick.sprite.__LZbuttonRef.but.filters: (?\194?\1636) ?\194?\171Array(0)#104| []?\194?\187
      global.__offscreenkeyclip.filters: (?\194?\1636) ?\194?\171Array(0)#106| []?\194?\187
      global.spriteroot.$m0.$m0.$m5.$LzText.filters: (?\194?\1636) ?\194?\171Array(0)#108| []?\194?\187
      global.spriteroot.$m0.$m0.$mcB.but.filters: (?\194?\1636) ?\194?\171Array(0)#110| []?\194?\187
      global.spriteroot.$m1.$m0.$m0.$mcB.but.filters: (?\194?\1636) ?\194?\171Array(0)#112| []?\194?\187
      global.spriteroot.$m1.$m0.$m1.$m0.$mcB.but.filters: (?\194?\1636) ?\194?\171Array(0)#114| []?\194?\187
      global.spriteroot.$m1.$m0.$m1.$m1.$mcB.but.filters: (?\194?\1636) ?\194?\171Array(0)#116| []?\194?\187
      global.spriteroot.$m1.$m0.$m1.$m2.$mcB.but.filters: (?\194?\1636) ?\194?\171Array(0)#118| []?\194?\187
      ...
      ?\194?\171__LzLeaks(28)#120| 208 smoots?\194?\187
      lzx>
........
  r7573 | ptw | 2007-12-17 17:41:55 -0500 (Mon, 17 Dec 2007) | 64 lines
  
  Change 20071214-ptw-i by ptw@dueling-banjos.local on 2007-12-14 18:23:23 EST
      in /Users/ptw/OpenLaszlo/ringding-2
      for http://svn.openlaszlo.org/openlaszlo/trunk
  
  Summary: Make the memory tracer generic
  
  New Features: Memory tracing now works (for some definition of works)
  in DHTML in addition to SWF.
  
  Bugs Fixed:
  LPP-2071: '__LzDebug.whyAlive() incorrectly reports leaking arrays with SWF8'
  
  Technical Reviewer: a.bargull@intensis.de (pending)
  QA Reviewer: promanik@laszlosystems.com (message://<20071216160543.EBA091EF912@hemicuda.laszlosystems.com>)
  
  Documentation:
      Debug.markObjects, findNewObjects, whyAlive now work in SWF and
      DHTML. DHTML is only beta-quality, and you will get a warning
      saying so, because it appears that some underlying runtimes
      themselves leak DOM objects (or our usage of them causes them to
      be leaked). It works reasonably well in Safari, less well in
      Firefox, hangs Opera, is untested in IE (but IE has its own leak
      tools).
  
  Details:
      kernel.js: Initialize the debug window early so memory tracing can
      find it. Use a static style for debugger output, so that a new
      CSSStyle object is not consed for every line of debugger output.
  
      LzMemory.lzs: Make this generic (although there are still some if
      ($as2) bits for now, I think a unified code base is better than
      splitting this into the kernels). Add some metering to see how
      the background tracer is working. Add some documentation. Add
      some try/catch blocks to ignore errors trying to trace native
      wrapped objects in DHTML. Don't trace native wrapped object slots
      that return a 'new' object each time you access them. Use
      set/clearInterval instead of the old tracer movieclip to run the
      background task. Fix the path evaluator to be correct and
      platform-neutral. Use objectOwnProperties to find slots to trace.
      Make the code to hide the debugger from the leak detector generic,
      hide the debugger DOM tree. Make whyAlive output all relevant
      data, so it can be invoked as a button, not just from the
      debugger.
  
      Library.lzs: switch from the platform leak detector to the generic
      one.
  
      LzRuntime: Use static style for debugger output.
  
      laszlo-debugger.css: Define that static style.
  
  Tests:
      The following test program works for me (pressing the 3 buttons at
      the appropriate times, creates a leak report):
  
      <canvas debug="true">
        <simplelayout axis="x" />
        <button onclick="Debug.markObjects()">Mark</button>
        <button onclick="Debug.findNewObjects()">Find New</button>
        <button onclick="Debug.whyAlive()">Why Alive</button>
      </canvas>
........


P T Withington - 03/Jan/08 11:17 AM
Fixed in Eskimo Pie, not Cranberry

Mamye Kratt - 04/Jan/08 02:07 PM
(wafflecone local build r7719 - 4.0.8 RC)
Testcase:
<canvas debug="true">
        <simplelayout axis="x" />
        <button onclick="Debug.markObjects()">Mark</button>
        <button onclick="Debug.findNewObjects()">Find New</button>
        <button onclick="Debug.whyAlive()">Why Alive</button>
</canvas>

Results:
Marking objects ...
DEBUG: 14 loops @ 682 iterations, 1250.43 milliseconds
 ... done!
Finding new objects ...
DEBUG: 15 loops @ 638 iterations, 1257.80 milliseconds
 ... done!
124 smoots [4 objects @ ~31 smoots each]:
global.LzFocus.cseldest.__LZviewLinks: (£58) «Object#4| {_dbg_check: 58, _dbg_smoots: ...»
global.LzFocus.cseldest.onx: (£29) «LzEvent#7| «lz.button».onx»
global.LzFocus.cseldest.ony: (£29) «LzEvent#9| «lz.button».ony»
global.LzIdle.coi: (£8) «Array(1)#12| [Delegate for mode manager ...»

Mamye Kratt - 04/Jan/08 02:07 PM
Need to test in trunk for ringding.

Mamye Kratt - 19/Mar/08 08:41 AM
(trunk 4 build r8276)
Results of testcase:

lzx> Debug.printLength = Infinity
Infinity
lzx> Debug.whyAlive()
0 smoots [0 objects @ ~NaN smoots each]:
«__LzLeaks(0)#0| 0 smoots [0 objects @ ~NaN smoots each]»
lzx> Marking objects ...
DEBUG: 14 loops @ 714 iterations, 1259.00 milliseconds
 ... done!
Finding new objects ...
DEBUG: 16 loops @ 625 iterations, 1273.13 milliseconds
 ... done!
124 smoots [4 objects @ ~31 smoots each]:
global.LzFocus.cseldest.__LZviewLinks: (£58) «Object#5| {_dbg_check: 58, _dbg_smoots: ...»
global.LzFocus.cseldest.onx: (£29) «LzEvent#8| «lz.button».onx»
global.LzFocus.cseldest.ony: (£29) «LzEvent#10| «lz.button».ony»
global.LzIdle.coi: (£8) «Array(1)#13| [Delegate for mode manager ...»