logo       


Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

[ruby-dev:28373] Re: ruby_1_8 broken?: msg#00085

Subject: [ruby-dev:28373] Re: ruby_1_8 broken?
山本です。

>C_ALLOCA は定義されていないようです。
>一応 C++Builder にデバッガがついているんですが、どうもうまく
>使えません。とりあえず、最適化を切ると make できるようになる
>ことはわかりました。

まず、CodeGuard で

Error 00001. 0x310000 (スレッド 0x0618):
パラメータ不正: 関数に不正なファイル/パイプ ストリーム (0x32594DB0)
 が渡されました。
fileno(0x32594DB0) 

呼び出し履歴:
   0x004011D0(=z.exe:0x01:0001D0)
   0x3256E7DA(=CC3250.DLL:0x01:06D7DA)

みたいなエラーが出ていたので調べてみると、次のコードがクラッシュする
ことに気づきました。(とはいえ、クラッシュするのは CodeGuard を ON に
したときですが)

#include <stdio.h>
#include <windows.h>
#include <io.h>
#include <fcntl.h>

int main()
{
    HANDLE r, w;
    int h;
    FILE *f;

    if (CreatePipe(&r, &w, NULL, 2048))
    {
        puts("CreatePipe OK");

        if ((h = _open_osfhandle((long)r, O_RDONLY)) != -1)
        {
            if ((f = _fdopen(h, "r")) != NULL)
            {
                printf("%p %d\n", f, fileno(f));

                fclose(f);
            }
        }

        CloseHandle(w);

        CloseHandle(r);
    }
}


つまりパイプ(もしかするとソケットも)_fdopen を使う方法が
bcc32 ではうまくいってなかったということでしょうか・・・

そういえば HEAD はビルドできるんですよね。stdio を捨てたから?

とりあえずこうするとこのエラーは消えました。(正しい処置かどうかは不明)

Index: io.c
===================================================================
RCS file: /src/ruby/io.c,v
retrieving revision 1.246.2.97
diff -u -w -b -p -r1.246.2.97 io.c
--- io.c        14 Feb 2006 02:23:33 -0000      1.246.2.97
+++ io.c        23 Feb 2006 01:43:44 -0000
@@ -2899,7 +2899,12 @@ pipe_open(pstr, pname, mode)
     int modef = rb_io_mode_flags(mode);
     OpenFile *fptr;
 
-#if defined(DJGPP) || defined(__human68k__) || defined(__VMS)
+#if defined(DJGPP) || defined(__human68k__) || defined(__VMS) || 
defined(__BORLANDC__)
+
+#if defined(__BORLANDC__)
+#define popen _popen
+#endif
+
     FILE *f;
 
     if (!pname) pname = StringValuePtr(pstr);
Index: win32/win32.c
===================================================================
RCS file: /src/ruby/win32/win32.c,v
retrieving revision 1.103.2.43
diff -u -w -b -p -r1.103.2.43 win32.c
--- win32/win32.c       14 Feb 2006 05:03:16 -0000      1.103.2.43
+++ win32/win32.c       23 Feb 2006 02:38:08 -0000
@@ -3429,6 +3429,11 @@ rb_w32_fclose(FILE *fp)
     if (fflush(fp)) return -1;
     if (!is_socket(sock)) {
        UnlockFile((HANDLE)sock, 0, 0, LK_LEN, LK_LEN);
+#ifdef __BORLANDC__
+       if (GetFileType((HANDLE)sock) == FILE_TYPE_PIPE) {
+           return _pclose(fp);
+       }
+#endif
        return fclose(fp);
     }
     _set_osfhnd(fd, (SOCKET)INVALID_HANDLE_VALUE);



しかし、このパッチを当てても本来のエラーは消えません。その後、下のスクリプトでも
おかしくなることがわかりました。最適化を切ると問題なく動きます。

a = {}
1.times do
# a["foo"] ||= proc { puts "boo" }.call # infinite loop (output "boo" forever)
  a["foo"] ||= 3                        # unexpected throw
end

また bcc32 の最適化バグなんでしょうか・・・





Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
db.firebase.por...    text.xml.xalan....    qnx.openqnx.dev...    user-groups.zar...    internationaliz...    kde.devel.konve...    finance.e-gold....    emacs.latex.pre...    gis.therion/200...    web.webmin.gene...    yellowdog.gener...    vserver/2003-08...    redhat.release....    sysutils.tivoli...    xfree86.expert/...    mail.becky.user...    hardware.netapp...    netbsd.ports.xe...    python.distutil...    boot-loaders.gr...    culture.interne...    java.springfram...    activedir/2006-...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe