[#82518] [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — mame@...
Issue #13618 has been updated by mame (Yusuke Endoh).
5 messages
2017/08/30
[#82552] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wong <normalperson@...>
2017/08/31
[email protected] wrote:
[#82756] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wrong <normalperson@...>
2017/09/12
Eric Wrong <[email protected]> wrote:
[ruby-core:82283] [Ruby trunk Bug#13788] libruby.so cannot be loaded by another program when --enable-load-relative is used
From:
branan@...
Date:
2017-08-08 16:32:10 UTC
List:
ruby-core #82283
Issue #13788 has been updated by branan (Branan Riley).
It appears from the comment on `ruby_sysinit` that programs embedding ruby should NOT be calling it under normal usage:
/*! Initializes the process for ruby(1).
*
* This function assumes this process is ruby(1) and it has just started.
* Usually programs that embeds CRuby interpreter should not call this function,
* and should do their own initialization.
*/
Further, looking at the logic in `dladdr_path`, it appears to boil down to:
* if we are a statically-linked ruby executable, lookup our libpath from `/proc/self/exe`
* else, lookup our libpath from the `Dl_info` struct
If my interpretation of that logic is correct, it would not make sense for `origarg` to be set when embedding the ruby interpreter. We'd expect to fall through to the second case: looking up the libpath from where the ruby shared library is located.
All that aside, since there is a reasonable behavior if `origarg.argv` is NULL (using the `Dl_info` struct), I would expect the function to handle that case and allow the program to continue, instead of segfaulting.
----------------------------------------
Bug #13788: libruby.so cannot be loaded by another program when --enable-load-relative is used
https://bugs.ruby-lang.org/issues/13788#change-66071
* Author: branan (Branan Riley)
* Status: Feedback
* Priority: Normal
* Assignee:
* Target version:
* ruby -v:
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
--enable-load-relative causes `dladdr_path` in ruby.c to be called. This function assumes that `origarg` is set, but that global will only be set if `ruby_sysinit` is called. Normally that is done by the `ruby` executable, but not by other programs that embed the ruby interpreter.
The attached patch causes `dladdr_path` to check that `origarg` is set, before trying to access the data in it.
---Files--------------------------------
origarg.patch (390 Bytes)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>