Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fork causes infinite recursion on windows-mingw #419

Open
constantined opened this issue Jun 20, 2018 · 3 comments
Open

fork causes infinite recursion on windows-mingw #419

constantined opened this issue Jun 20, 2018 · 3 comments

Comments

@constantined
Copy link

Testcase:

my $pid = fork;
warn "$$ $pid";

Stack trace:

#0  0x0000000000c12679 in Perl_ptr_table_fetch (my_perl=0x403a2e58,
    tbl=0x403b2360, sv=0x1324ce8 <padname_8_list+37128>) at ..\sv.c:13745
#1  0x0000000000dc862e in Perl_padname_dup (my_perl=0x403a2e58,
    src=0x1324ce8 <padname_8_list+37128>, param=0x3e2af760) at ..\pad.c:2940
#2  0x0000000000dc86ba in Perl_padname_dup (my_perl=0x403a2e58,
    src=0x1324ce8 <padname_8_list+37128>, param=0x3e2af760) at ..\pad.c:2952
#3  0x0000000000dc86ba in Perl_padname_dup (my_perl=0x403a2e58,
    src=0x1324ce8 <padname_8_list+37128>, param=0x3e2af760) at ..\pad.c:2952
...

Temporary workaround:

--- a/pad.c
+++ b/pad.c
@@ -2947,7 +2947,7 @@ Perl_padname_dup(pTHX_ PADNAME *src, CLONE_PARAMS *param)
        return dst;
     }

-    dst = PadnameOUTER(src)
+    dst = FALSE  //PadnameOUTER(src)
      ? newPADNAMEouter(padname_dup(PADNAME_FROM_PV(PadnamePV(src)), param))
         : newPADNAMEpvn_flags(PadnamePV(src), PadnameLEN(src), PadnameUTF8(src));
     ptr_table_store(PL_ptr_table, src, dst);
@rurban
Copy link
Owner

rurban commented Jun 20, 2018

OUTER is wrong? Ouch. I hope there are better fixes for this.
But I see that in the OUTER case padname_dup() recurses.

@constantined
Copy link
Author

This is reproducible only with B::C, interpreter works fine

@rurban
Copy link
Owner

rurban commented Jun 20, 2018

Yes, I know. I'm the one who is setting this OUTER and the static padname struct. I have to avoid the recursion problem somehow. Probably only broken with threads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants