Re: [BUG] GC problem
Jens Rieks [EMAIL PROTECTED] wrote: the attached program aborts if run without without -G... $ tar xzf err6.tgz I found three problems with that test: 1) Subs/Methods loaded by load_bytecode weren't marked 2) The regsave are of delelgate.pmc needs marking 3) It seems that your code has a slight bug (which I'm not too sure because I don't know exactly what it's supposed to do) Anway, inserting one line in EBNF/Source.imc:150 lets it run with above fixes w and w/o -t, --gc-debug. NO_EOF: set str, buffer # str is a reference to the original string property # running with or w/o DOD differs here clone str, str # concat str, stmp set i, pos Thanks again for your test code leo
Re: [BUG] GC problem
Jens Rieks [EMAIL PROTECTED] wrote: $ tar xzf err6.tgz I could reduce the bug to the program below. Program runs with -G and segfaults without. It seems that Dan's comment WRT delegate is too true: ,--[ delegate.pmc ]-- | The following bit is a fast register save/restore pair. | ... | | Also note that if the vtable method clobbers a register that contains a | string or PMC not otherwise rooted it could be collected too early. ` The register P12 is reused in the overridden method calls, the object P12 in main isn't visible then anymore and gets DODed. I think, we need a custom mark for objects that trace the saved register area(s). leo newclass P9, Source newclass P10, Source::Buffer find_type I9,Source new P12, I9 set S20, P12 print S20 set S20, P12 # SEGV, P12 destroyed print S20 end .namespace [Source] .pcc_sub __get_string: # buffer getprop P12, buf, P2 sweep 1 typeof I12, P12 ne I12, .PerlUndef, buffer_ok find_type I12, Source::Buffer new P12, I12 new P14, .PerlString set P14, hello\n setprop P12, buf, P14 setprop P2, buffer, P12 buffer_ok: set S5, P12 invoke P1 .namespace [Source::Buffer] .pcc_sub __get_string: sweep 1 getprop P12, buf, P2 set S16, P12 set S5, S16 invoke P1
Re: [BUG] GC problem
Jens Rieks [EMAIL PROTECTED] wrote: the attached program aborts if run without without -G... $ tar xzf err6.tgz $ ../parrot languages/EBNF/main.imc a.ebnf ... Can't find method '__set_string_native' for object I've now actually fixed two more DOD bugs, but its still failing. - as outlined previously, the saved registers in delegate need marking - mark_const_subs() didn't mark Sub objects loaded in by load_bytecode I'll committ these tomorrow. jens leo
[BUG] GC problem
Hi, the attached program aborts if run without without -G... $ tar xzf err6.tgz $ cd err6 $ ../parrot languages/EBNF/main.imc a.ebnf 'h' = code=1 'e' = code=1 'l' = code=1 'l' = code=1 'o' = code=1 '=' = code=4 a.ebnf:1:5 end of terminal 'hello' a.ebnf:1:6 defining meta-identifier 'hello'... '(*' = code=15 a.ebnf:1:7 comment start Can't find method '__set_string_native' for object jens err6.tgz Description: application/tgz