From: Jonathan Paisley Date: 2005-05-18T01:25:31+09:00 Subject: Re: IRB, Mac OS X, command-line require via "-r" and Bus Errors On Tue, 17 May 2005 18:51:03 +0200, Luc Heinrich wrote: > Very interesting. So we now know exactly what happens and why it > happens. Cool :) > > But whose bug is it, really ? > > On one hand, I agree that checking for NULL values in argv should > probably be done in CFRuntime.c. But on the other hand, nullifying argv > entries in set_arg0 while keeping the argc value intact is really asking > for troubles don't you think ? :) Fiddling with command line arguments like this is a common unix idiom for changing the way the process appears in output from the 'ps' command, so it's fair game for ruby to be doing this. Unfortunately there's nothing you can do about the argc value - since C is call-by-reference there's no value that can be updated to reflect the new length of the argument list. Since Apple are overloading the interpretation of arguments to command line applications, I think it's up to them to make sure they do it defensively.