Cory Spencer <[EMAIL PROTECTED]> wrote: > I've come across another garbage collection/DOD issue that I'm trying to > solve (without much success) and would appreciate some tips/advice on how > to locate the source of the problem.
When I'm investigating GC bugs, the usual procedure is like this: - run the program with -t with or w/o --gc-debug (GC bug sometimes happens earlier, which usually simplifies things) - check the backtraces - run it with -t -G - compare trace outputs (possibly after reducing trace dumps with the help of a perl script that deletes DOD/GC messages and maybe addresses) - try to locate which POBj (or parent(s) of it) are involved - turn on GC_VERBOSE and set the PObj_report_FLAG in involved PMCs - or put a printf message into destroy vtable functions - check if parent of too early collected objects are alive and if they mark their contents (or refs) properly Overall: it's a nasty and time consuming job. > ... It appears to affectthe String class (in > my case, a subclass of String). Does it happen with the plain String PMC too? > ... Oddly, it appears to only affect strings > with a length of 1 (ie. a single character - changing the string to a > longer length does not cause it be be marked as a dead object). Strange. How are these strings created? Some special cased code? > I've also noticed similar behaviour when I use a native string type (ie. > something declared with an IMC ".local string str" declaration) as a key > in a Hash table (again, it only appears to happen when the string is a > single character in length). Later, when I go back to retrieve the value > stored in the hash, it can't find it. (Running an iterator over the keys > of the Hash shows keys that appears as garbage characters (presumably > string types that have since been collected).) Are the strings created dynamically during an eval sequence (compreg/compile)? String constants or outcome of a string expression? > I've as of yet been unable to produce a concise, working example. Any > tips as to how I can find the source of this bug? If you can't reduce it, just send a tarball of needed stuff in PM to me. leo