dln.c: check incompatible libruby
* dln.c (dln_load): check if a different libruby is loaded by the extension library, and then bail out to get rid of very frequent reported stale bug reports. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2d3a0fa61b
commit
f2604ef512
@ -1,3 +1,9 @@
|
|||||||
|
Fri May 1 13:30:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* dln.c (dln_load): check if a different libruby is loaded by the
|
||||||
|
extension library, and then bail out to get rid of very frequent
|
||||||
|
reported stale bug reports.
|
||||||
|
|
||||||
Thu Apr 30 19:51:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Apr 30 19:51:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* compile.c (iseq_compile_each): revert r46873 and r46875, not to
|
* compile.c (iseq_compile_each): revert r46873 and r46875, not to
|
||||||
|
15
dln.c
15
dln.c
@ -1324,6 +1324,21 @@ dln_load(const char *file)
|
|||||||
error = dln_strerror();
|
error = dln_strerror();
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
# if defined RUBY_EXPORT
|
||||||
|
{
|
||||||
|
static const char incompatible[] = "incompatible library version";
|
||||||
|
void *ex = dlsym(handle, EXPORT_PREFIX"ruby_xmalloc");
|
||||||
|
if (ex && ex != ruby_xmalloc) {
|
||||||
|
|
||||||
|
# if !defined __APPLE__
|
||||||
|
/* dlclose() segfaults */
|
||||||
|
dlclose(handle);
|
||||||
|
# endif
|
||||||
|
error = incompatible;
|
||||||
|
goto failed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
init_fct = (void(*)())(VALUE)dlsym(handle, buf);
|
init_fct = (void(*)())(VALUE)dlsym(handle, buf);
|
||||||
if (init_fct == NULL) {
|
if (init_fct == NULL) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user