develooper Front page | perl.perl6.internals | Postings from October 2002

[perl #18142] [PACTH] Parrot_destroy

Thread Next
From:
Leopold Toetsch
Date:
October 29, 2002 02:44
Subject:
[perl #18142] [PACTH] Parrot_destroy
Message ID:
rt-18142-40716.3.18885905183336@bugs6.perl.org
# New Ticket Created by  Leopold Toetsch 
# Please include the string:  [perl #18142]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=18142 >


Attached is a (big) patch that implements Parrot_destroy.

Test results with --gc-debug: All tests successful.

Test results with leak detection[1]/--gc-debug:

Failed Test  Status Wstat Total Fail  Failed  List of failed
-------------------------------------------------------------------------------
t/op/hacks.t                  2    1  50,00%  1
t/op/interp.t                 2    2 100,00%  1-2
t/op/rx.t                    23    7  30,43%  8-9, 12-14, 21-22
t/op/stacks.t                35    2   5,71%  31-32
t/pmc/pmc.t                  83    4   4,82%  62-64, 76
7 subtests skipped.
Failed 5/34 test scripts, 85.29% okay. 16/495 subtests failed, 96.77% okay.

Some notes WRT still exisiting leaks:

- hacks.t: PIO related, open does new_IO which doesn't seem to store
   this structure somewhere. Explicit closing the handle would help, as
   done now in embed.c
- interp.t: crashes with ATEXIT_DESTROY (2 interpreters interfere)
- rx.t:    Bitmaps leakage
- stacks.t: leaking intstack
- pmc.t:  leaking intqueue

TODO:
- header file changes WRT global warnings
- probably remove intqueue from classes
- move the stack destroying code to stacks, reuse it in
   classes/coroutine.pmc
- fix PIO_destroy
- to clean up properly after exceptions, I added a define locally to
   interpreter.c: ATEXT_DESTROY, which installs an atexit-handler. This
   works only for one existing interpreter, due to the __interpreter
   global. We should either keep an interpreter array or fix
   internal_exception to take an Parrot_Interp*, so that Parrot_destroy
   can be called.
- Running with --gc=malloc is broken (mostly COWed strings).

- (unrelated) mmap in Parrot_readbc is not used now, missing
   HAS_HEADER_SYSMMAN definition

Some notes to the changes:
- classe/*.pmc missing flags setting in clone, destroy
- dod.c  made free_unused_* global
- embed.c PIO_close
- headers.c honor active_destroy, destroy_headers
- chartype.c usascii (better latin1) is default
- interpreter Parrot_destroy
- io/io.c PIO_destroy / _close
- res*.c destroy_memory_pools
- t/src/manifest accout for skipped test

[1] I used run-yamd (s. attached testyamd script) for running all tests
through the memory debugger and made leaking tests fail. This is part
of YAMD (Yet Another Memory Debugger).

Please test the patch on different platforms. Mine is i386/linux.

Have fun,
leo



-- attachment  1 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/40716/32820/b03730/parrot_destroy.patch


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About