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

threads: crash in nqp with proxy NQPLexPad #869

Closed
rurban opened this issue Nov 21, 2012 · 4 comments
Closed

threads: crash in nqp with proxy NQPLexPad #869

rurban opened this issue Nov 21, 2012 · 4 comments

Comments

@rurban
Copy link
Member

rurban commented Nov 21, 2012

Crash in nqp with wrong Parrot_NQPLexPad_set_pointer info->vtable->base_type 78 enum_class_Proxy
This is probably a nqp bug but still marked here as potential blocker for the threads branch.
whiteknight argued to merge threads into parrot, and to fix the remaining nqp issues later.

nqp needs to get the real lexpad from the other thread, not the Proxy .
This can be a can of worms. Does nqp need to check all pmc's for proxies,
i.e. when they were created in another thread?

Also, all 6model related nqp ops expect a SixModelObject PMC and not a proxy,
which will need to access the PARROT_PROXY(self)->target instead.

After
--- a/src/pmc/nqplexpad.pmc
+++ b/src/pmc/nqplexpad.pmc
@@ -111,6 +111,8 @@ Return the LexInfo PMC, if any or a Null PMC.
if (info->vtable->base_type != enum_class_LexInfo) {
PMC *name_map;
GETATTR_NQPLexInfo_name_to_register_map(INTERP, info, name_map);
+ if (info->vtable->base_type != 97)
+printf("Parrot_NQPLexPad_set_pointer info->vtable->base_type %d\n",info->vtable->base_type);
hash = (Hash *)VTABLE_get_pointer(INTERP, name_map);
}
else {

We get with threads-crash.nqp:

say("alive");

my $x := 5;

my $a := sub foo() {
    say($x);
    say(5);
}

my $b := pir::new__PSP('Task', $a);
pir::schedule__0P($b);
pir::wait__0P($b);

say(7);

$ ./nqp threads-crash.nqp
alive
Parrot_NQPLexPad_set_pointer info->vtable->base_type 78 i.e. enum_class_Proxy
SEGV

@rurban
Copy link
Member Author

rurban commented Dec 4, 2012

Not a parrot problem.
For verification we added a nqp-rx testcase ext/nqp-rx/t/nqp/67-threads.t
and added the nqp-rx tests to run with make test.

To help pmc code to get the dynpmc base_type we added new dynpmc_class_ constants.

@rurban rurban closed this as completed Dec 4, 2012
@leto
Copy link
Member

leto commented Dec 4, 2012

ext/nqp-rx should be a snapshot of an external repo. It seems that you added a test to it solely in the parrot.git repo, which is essentially forking. Would it be possible to get that test added to the upstream repo?

@rurban
Copy link
Member Author

rurban commented Dec 4, 2012

I did not know about yet another perl6/nqp-rx.git repo.
I only knew nqp-rx (aka parrot-nqp) which lives in parrot/parrot.git, and nqp which lives in perl6/nqp.git

I'll add the missing commits to the dead perl6/nqp-rx.git also.
Should ext/nqp-rx be handled as git submodule then inside parrot/parrot.git?

@rurban
Copy link
Member Author

rurban commented Dec 4, 2012

Synced the tests of both repos.
parrot.git: 53cf923 and b6f8b3f
nqp-rx.git: c89a5b9f7b

@rurban rurban reopened this Dec 4, 2012
@rurban rurban closed this as completed Dec 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants