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

Maybe missing rb_fiber_current? #2402

Closed
ioquatix opened this issue Jul 14, 2021 · 6 comments
Closed

Maybe missing rb_fiber_current? #2402

ioquatix opened this issue Jul 14, 2021 · 6 comments
Assignees
Labels
Milestone

Comments

@ioquatix
Copy link
Contributor

It compiles, but fails:

https://github.com/socketry/event/runs/3063384404#step:5:63

1) Event::Selector::EPoll behaves like queue #push defers push during push to next iteration
		Failure/Error: subject.yield

		RuntimeError:
			External LLVMFunction rb_fiber_current cannot be found. (com.oracle.truffle.llvm.runtime.except.LLVMLinkerException)
			Translated to internal error
		Shared Example Group: "queue" called from ./spec/event/selector/queue_spec.rb:
		# ./ext/event/selector/selector.c:153:in `Event_Selector_wait_and_transfer'
		# ./ext/event/selector/selector.h:117:in `Event_Selector_yield'
		# ./ext/event/selector/epoll.c:130:in `Event_Selector_EPoll_yield'
		# /home/runner/.rubies/truffleruby-head/lib/truffle/truffle/cext_ruby.rb:41:in `yield'
		# ./spec/event/selector/queue_spec.rb:52:in `block (4 levels) in <top (required)>'
@ioquatix
Copy link
Contributor Author

It seems like we have it?

VALUE rb_fiber_current(void);

@eregon eregon added the cexts label Jul 14, 2021
@eregon
Copy link
Member

eregon commented Jul 14, 2021

VALUE rb_fiber_current(void);

is just the prototype, this error means there is no actual definition of the rb_fiber_current() function.

So we should add it, @bjfish could you do that?

@eregon eregon added this to the 21.3.0 milestone Jul 14, 2021
@eregon
Copy link
Member

eregon commented Jul 14, 2021

Note that if you use have_func('rb_fiber_current') it should correctly find out that it's not available on TruffleRuby (until we add it).

@ioquatix
Copy link
Contributor Author

Thanks, sorry, I didn't realise this was needed. I can add it.

@eregon
Copy link
Member

eregon commented Jul 15, 2021

Thanks, sorry, I didn't realise this was needed. I can add it.

It's just a good way to workaround if the function is not available, but we'll add it soon anyway (if you use truffleruby-head).

We noticed other rb_fiber_* functions are also not defined currently on TruffleRuby and will add those too.

@bjfish
Copy link
Contributor

bjfish commented Jul 15, 2021

This is now implemented at: 06bc34f. Thank you for reporting this.

@bjfish bjfish closed this as completed Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants