[#9722] Kernel#system broken inside Dir.chdir(&block) if system command doesn't have shell characters — <noreply@...>

Bugs item #7278, was opened at 2006-12-14 13:59

8 messages 2006/12/14

[#9749] System V IPC in standard library? — Steven Jenkins <steven.jenkins@...>

Back in August, I needed a semaphore to serialize access to an external

14 messages 2006/12/19

[#9753] CVS freeze — SASADA Koichi <ko1@...>

Hi,

20 messages 2006/12/20
[#9755] Re: [ruby-dev:30039] CVS freeze — SASADA Koichi <ko1@...> 2006/12/20

Hi,

[#9757] Re: [ruby-dev:30040] Re: CVS freeze — SASADA Koichi <ko1@...> 2006/12/20

Hi,

Re: System V IPC in standard library?

From: Steven Jenkins <steven.jenkins@...>
Date: 2006-12-20 01:22:12 UTC
List: ruby-core #9752
Nobuyoshi Nakada wrote:
> Steven Jenkins wrote in [ruby-core:09749]:
>> Back in August, I needed a semaphore to serialize access to an external
>> resource. I found the System V IPC library by Daiki Ueno, and it worked
>> well enough on Linux, but wouldn't compile under Solaris. I fixed that
>> problem and contacted Daiki, who hadn't updated the package in several
>> years. After a little discussion, I created a project (sysvipc) on
>> RubyForge and made the updates.
> 
> I'm curious about have_type in extconf.rb.
> 
>> It prevents false negatives caused by optimization in gcc 4.x.
> 
> What do you mean by "false negatives"?  It returns false for an
> existing type, or true for a non-existing type?

Now that you ask, I may have gotten that backwards. Daiki observed it on
Debian with Ruby 1.8.5. and gcc 4.1.2.  have_type failed to detect that
that platform does not define struct msgbuf (which is, in fact, a false
positive). I don't quite know what I meant by 'false negative'; maybe
the fact that the error caused a definition of struct msgbuf to be
incorrectly omitted.

> Does "by optimization" mean `conftestval' is omitted and
> ignored completely?

I don't see that conftestval is used at all in have_type. But yes,
that's the idea. The test code has no side effects, so an aggressively
optimizing compiler can throw the whole thing away. (In this case, of
course, the desired side effect is an error.) I looked at autoconf
because I figured someone else would have encountered this problem
before. Their code returns values to the environment, so it can't be so
easily optimized away.

I thought about proposing this as an enhancement to mkmf, but I guess it
slipped my mind. Daiki said it was fixed in 1.9, so maybe the problem
goes away.

Steve


In This Thread