[前][次][番号順一覧][スレッド一覧]

ruby-changes:38388

From: usa <ko1@a...>
Date: Mon, 11 May 2015 11:12:23 +0900 (JST)
Subject: [ruby-changes:38388] usa:r50469 (ruby_2_1): merge revision(s) 50416: [Backport #11111]

usa	2015-05-11 11:12:09 +0900 (Mon, 11 May 2015)

  New Revision: 50469

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50469

  Log:
    merge revision(s) 50416: [Backport #11111]
    
    dln.c: fix EXTERNAL_PREFIX
    
    * configure.in (EXPORT_PREFIX): revert r50410.
    
    * dln.c (EXTERNAL_PREFIX): define by predefined macros.
      configured EXPORT_PREFIX is different thing.
    
    * win32/Makefile.sub: r50414-50415.

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/dln.c
    branches/ruby_2_1/version.h
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 50468)
+++ ruby_2_1/ChangeLog	(revision 50469)
@@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Mon May 11 11:09:08 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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.
+
+	* dln.c (dln_load): raise fatal error on OSX not other extension
+	  libraries to refer different libruby.
+
 Mon May 11 10:59:53 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (lambda): push and reset cmdarg_stack in lambda body.
Index: ruby_2_1/dln.c
===================================================================
--- ruby_2_1/dln.c	(revision 50468)
+++ ruby_2_1/dln.c	(revision 50469)
@@ -107,10 +107,11 @@ dln_loaderror(const char *format, ...) https://github.com/ruby/ruby/blob/trunk/ruby_2_1/dln.c#L107
 
 #ifndef FUNCNAME_PATTERN
 # if defined(__hp9000s300) || ((defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)) && !defined(__ELF__)) || defined(__BORLANDC__) || defined(NeXT) || defined(__WATCOMC__) || defined(MACOSX_DYLD)
-#  define FUNCNAME_PREFIX "_Init_"
+#  define EXTERNAL_PREFIX "_"
 # else
-#  define FUNCNAME_PREFIX "Init_"
+#  define EXTERNAL_PREFIX ""
 # endif
+# define FUNCNAME_PREFIX EXTERNAL_PREFIX"Init_"
 #endif
 
 #if defined __CYGWIN__ || defined DOSISH
@@ -1340,6 +1341,24 @@ dln_load(const char *file) https://github.com/ruby/ruby/blob/trunk/ruby_2_1/dln.c#L1341
 	    goto failed;
 	}
 
+# if defined RUBY_EXPORT
+	{
+	    static const char incompatible[] = "incompatible library version";
+	    void *ex = dlsym(handle, EXTERNAL_PREFIX"ruby_xmalloc");
+	    if (ex && ex != ruby_xmalloc) {
+
+#   if defined __APPLE__
+		/* dlclose() segfaults */
+		rb_fatal("%s - %s", incompatible, file);
+#   else
+		dlclose(handle);
+		error = incompatible;
+		goto failed;
+#   endif
+	    }
+	}
+# endif
+
 	init_fct = (void(*)())(VALUE)dlsym(handle, buf);
 #ifdef __native_client__
 	strcpy(file, orig);
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 50468)
+++ ruby_2_1/version.h	(revision 50469)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.7"
 #define RUBY_RELEASE_DATE "2015-05-11"
-#define RUBY_PATCHLEVEL 341
+#define RUBY_PATCHLEVEL 342
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 5

Property changes on: ruby_2_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r50416


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]