Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
rb_sys_fail problem with One Click Installer
djberg96
12/7/2004 3:43:00 PM
Hi all,
Ruby 1.8.2 RC 7 and 10
Win2k and WinXP Pro
VC++ 6.0 and 7.0
I've posted this as a bug on RubyForge, but I thought maybe some folks
here could help me.
I've got a C extension (win32-process) where I define my own
Process.kill method (for a couple reasons). In it, I use
rb_sys_fail(0). The problem is that it's causing a segfault:
# Sample script
require "win32/process"
Process.kill(0,99999) # Should raise Errno::ENOENT
Result:
C:\eclipse\workspace\win32-process>ruby ktest.rb
ktest.rb:10: [BUG] rb_sys_fail() - errno == 0
ruby 1.8.2 (2004-11-06) [i386-mswin32]
This application has requested the Runtime to terminate it in an
unusual way.
Please contact the application's support team for more information.
The relevant function comes from error.c:
void
rb_sys_fail(mesg)
const char *mesg;
{
extern int errno;
int n = errno;
VALUE arg;
errno = 0;
if (n == 0) {
rb_bug("rb_sys_fail(%s) - errno == 0", mesg ? mesg : "");
}
arg = mesg ? rb_str_new2(mesg) : Qnil;
rb_exc_raise(rb_class_new_instance(1, &arg, get_syserr(n)));
}
A couple of notes. First, if I replace rb_sys_fail(0) with something
like rb_raise(rb_eStandardError,"...") it works fine. Second, I only
see this behavior when I use the One Click Installer. If I build from
scratch, it works fine.
I could work around this if there were a way to set errno manually
somehow within the extension.
Any ideas?
Regards,
Dan
PS - RubyForge bug is at
http://rubyforge.org/tracker/index.php?func=detail&aid=363&group_id=167&am...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
rb_sys_fail problem with One Click Installer
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password