Project

General

Profile

Backport #7746

Backport NSGetEnviron()/setproctitle.c fix for macosx

Added by docwhat (Christian Höltje) over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:51713]

Description

The fix for issue #6576 should be back ported to 1.9.3 as well. Without it you cannot build shared ruby libraries that work reliably. An example of this breakage is compiling something that uses the embedded library like vim; it crashes the instance vim tries to use ruby.

Here's the patch needed:

diff --git a/missing/setproctitle.c b/missing/setproctitle.c
index 169ba8b..4dc6d03 100644
--- a/missing/setproctitle.c
+++ b/missing/setproctitle.c
@@ -48,6 +48,12 @@
#endif
#include

+#if defined(APPLE)
+#include
+#undef environ
+#define environ (_NSGetEnviron())
+#endif
+
#define SPT_NONE 0 /
don't use it at all /
#define SPT_PSTAT 1 /
use pstat(PSTAT_SETCMD, ...) /
#define SPT_REUSEARGV 2 /
cover argv with title information */

Associated revisions

Revision 4be94836
Added by usa (Usaku NAKAMURA) over 6 years ago

merge revision(s) 36151: [Backport #7746]

    * missing/setproctitle.c (environ): use (*_NSGetEnviron()) instead of
      environ on Darwin for namespace cleanness, same as [ruby-core:00537].
      [ruby-core:45615] [Bug #6576]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@39091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 39091
Added by usa (Usaku NAKAMURA) over 6 years ago

merge revision(s) 36151: [Backport #7746]

* missing/setproctitle.c (environ): use (*_NSGetEnviron()) instead of
  environ on Darwin for namespace cleanness, same as [ruby-core:00537].
  [ruby-core:45615] [Bug #6576]

History

Updated by kosaki (Motohiro KOSAKI) over 6 years ago

Confused. Mac OS X has native setproctile(). I think missing/setproctitle.c shouldn't be used.

Updated by jacknagel (Jack Nagel) over 6 years ago

kosaki (Motohiro KOSAKI) wrote:

Confused. Mac OS X has native setproctile(). I think missing/setproctitle.c shouldn't be used.

At least 10.6 does not have setproctitle().

Updated by kosaki (Motohiro KOSAKI) over 6 years ago

  • Status changed from Open to Assigned
  • Assignee changed from kosaki (Motohiro KOSAKI) to usa (Usaku NAKAMURA)

OK, ack then.
Usa-san, I think r36151 can be apply cleanly.

#4

Updated by usa (Usaku NAKAMURA) over 6 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r39091.
Christian, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 36151: [Backport #7746]

* missing/setproctitle.c (environ): use (*_NSGetEnviron()) instead of
  environ on Darwin for namespace cleanness, same as [ruby-core:00537].
  [ruby-core:45615] [Bug #6576]

Also available in: Atom PDF