Forum: IronRuby possible problem on mono

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ivan P. (Guest)
on 2009-02-20 10:46
(Received via mailing list)
Hi

When I try to run the igem script on mono it always comes back with a
NullReferenceException.

igem list --debug --backtrace
ERROR:  While executing gem ... (System::NullReferenceException)
    Object reference not set to an instance of an object
    IronRuby.Libraries:0:in `TryFlattenArray'
    :0:in `flatten!'
    mscorlib:0:in `_stub_$2591'
    gem_runner.rb:25:in `run'
    mscorlib:0:in `_stub_$2495'
    igem:0

Is this known or should I add it to the bugs?
Tomas M. (Guest)
on 2009-02-20 19:29
(Received via mailing list)
Could you try to narrow it down to a simple repro? What parameters are
passed to “flatten!” that make it fail? (You may want to run it with –D
to get full stack information, although it will be slower).

Tomas

From: removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalid] On Behalf Of Ivan Porto
Carrero
Sent: Friday, February 20, 2009 12:31 AM
To: ironruby-core
Subject: [Ironruby-core] possible problem on mono

Hi

When I try to run the igem script on mono it always comes back with a
NullReferenceException.

igem list --debug --backtrace
ERROR:  While executing gem ... (System::NullReferenceException)
    Object reference not set to an instance of an object
    IronRuby.Libraries:0:in `TryFlattenArray'
    :0:in `flatten!'
    mscorlib:0:in `_stub_$2591'
    gem_runner.rb:25:in `run'
    mscorlib:0:in `_stub_$2495'
    igem:0

Is this known or should I add it to the bugs?
Ivan P. (Guest)
on 2009-02-21 22:52
(Received via mailing list)
I'll try but i'm just moving into a new flat so it may take a few days
before I get some actual pc time
---
Met vriendelijke groeten - Best regards - Salutations
Ivan Porto C.
GSM: +32.486.787.582
Blog: http://flanders.co.nz
Twitter: http://twitter.com/casualjim



On Fri, Feb 20, 2009 at 5:59 PM, Tomas M. <
Rafael R. (Guest)
on 2009-03-04 02:56
Hi,

I've got the same error, but I'm just starting to use IronRuby. The igem
doesn't work and it's very hard to do anything useful without gems.

Cheers,
Rafael
www.rafaelrosafu.com
Jimmy S. (Guest)
on 2009-03-04 07:57
(Received via mailing list)
Which same error? Is anyone else having problems with igem on Mono? Have
you grabbed the build from here:
http://github.com/casualjim/ironruby-mono-builds ?

~js
Rafael R. (Guest)
on 2009-03-04 08:39
Hi,

Yes, I tried to build from source, but had a lot of problems and then I
found these builds. Calling igems gives the same error Ivan had
reported, here a fresh result:

~/Projetos : igem list --debug
ERROR:  While executing gem ... (System::NullReferenceException)
    Object reference not set to an instance of an object
  IronRuby.Libraries:0:in `TryFlattenArray'
  :0:in `flatten!'
  mscorlib:0:in `CallSite.Target'
  gem_runner.rb:25:in `run'
  mscorlib:0:in `CallSite.Target'
  igem:0


If I try to call just "igem" it shows the help, no problem, but if I try
to run "igem list" or "igem install any_gem" it shows the error above
adding the --debug directive, and shows just the first two lines of the
error if run without it.

Hope it helps.

Cheers,
Rafael
www.rafaelrosafu.com
Ivan P. (Guest)
on 2009-03-04 09:31
(Received via mailing list)
You can get the same behaviour by requiring rubygems I believe.

When I get back from work tonight I'll try to track down why this is
happening. I had it on my to-do list for a while now.
Jb Evain (Guest)
on 2009-03-04 12:08
(Received via mailing list)
Hey,

On 3/4/09, Rafael R. <removed_email_address@domain.invalid> wrote:
>  If I try to call just "igem" it shows the help, no problem, but if I try
>  to run "igem list" or "igem install any_gem" it shows the error above
>  adding the --debug directive, and shows just the first two lines of the
>  error if run without it.

Which version of Mono are you using? It works fine on Mono HEAD and
Mono 2.4. If you're interested in running IronRuby on Mono, I suggest
you use a (very) recent Mono anyway, as the DLR and IronRuby sometimes
kick Mono's tires hard.
Ivan P. (Guest)
on 2009-03-04 13:03
(Received via mailing list)
I'm using it with mono head.. I'll try when I've done my 8 hours of
mercenary time.
Jb Evain (Guest)
on 2009-03-04 14:18
(Received via mailing list)
On 3/4/09, Ivan Porto C. <removed_email_address@domain.invalid> wrote:
> I'm using it with mono head.. I'll try when I've done my 8 hours of
> mercenary time.

Then it's either a difference caused by gmcs or in the branch, as I'm
still building origin with csc.
Jb Evain (Guest)
on 2009-03-04 14:44
(Received via mailing list)
On 3/4/09, Jb Evain <removed_email_address@domain.invalid> wrote:
> On 3/4/09, Ivan Porto C. <removed_email_address@domain.invalid> wrote:
>  > I'm using it with mono head.. I'll try when I've done my 8 hours of
>  > mercenary time.
>
>
> Then it's either a difference caused by gmcs or in the branch, as I'm
>  still building origin with csc.

It's indeed an issue with gmcs which miscompiles the using in
TryFlattenArray.
Rafael R. (Guest)
on 2009-03-04 16:21
I'm using Mono 2.2, I'll try to install the trunk version. I read
somewhere that this version would work with 2,2. I'll inform you guys if
it worked or not.

Thanks
Jb Evain (Guest)
on 2009-03-04 22:18
(Received via mailing list)
Attachment: workaround_usings.diff (0 Bytes)
On 3/4/09, Jb Evain <removed_email_address@domain.invalid> wrote:
> It's indeed an issue with gmcs which miscompiles the using in TryFlattenArray.

This issue is fixed in Mono' HEAD. The fix is not going to be
backported to 2.4 though. Attached is a diff for the Mono branch which
work arounds the particular problem.
Ivan P. (Guest)
on 2009-03-04 23:34
(Received via mailing list)
Great :D
Rafael R. (Guest)
on 2009-03-05 07:12
I downloaded the the latest ironruby-mono-builds and the problem with
TryFlattenArray is gone, now "igem list" works, but when I tried to
install a gem I got the following error:

~ : igem install rspec --debug
ERROR:  While executing gem ... (URI::InvalidComponentError)
    bad component(expected absolute path component): latest_specs.4.8
mscorlib:0:in `CallSite.Target': undefined method `join' for
nil:NilClass (NoMethodError)
  from gem_runner.rb:25:in `run'
  from mscorlib:0:in `CallSite.Target'
  from igem:0


And "iirb" isn't working:

~ : iirb --debug
Microsoft.Scripting.Core:0:in `Reference': variable '$exception' of type
'System.Exception' referenced from scope
'ℑℜ;suspend_input_method;irb.rb;213;', but it is not defined (TypeError)
  from Microsoft.Scripting.Core:0:in `VisitParameter'
  from Microsoft.Scripting.Core:0:in `Accept'
  from Microsoft.Scripting.Core:0:in `Visit'
  from Microsoft.Scripting.Core:0:in `VisitBinary'
  from Microsoft.Scripting.Core:0:in `Accept'

I'll try to build a latest Mono version and see what happens.

Cheers.
Ivan P. (Guest)
on 2009-03-05 09:05
(Received via mailing list)
rename your .gemrc (hidden in your home folder) file and try again
Rafael R. (Guest)
on 2009-03-05 15:18
Thanks, I tought it was a related problem. More google, less complaining
:)

I'm taking a look at it now, I have .NET people meeting this weekend and
I want to show them IronRuby.

Cheers
Jb Evain (Guest)
on 2009-03-05 15:58
(Received via mailing list)
Hey,

On 3/5/09, Rafael R. <removed_email_address@domain.invalid> wrote:
>  And "iirb" isn't working:

I can reproduce that. It's another issue that is either in gmcs or in
the branch. I'll investigate.
Jb Evain (Guest)
on 2009-03-06 01:00
(Received via mailing list)
On 3/5/09, Jb Evain <removed_email_address@domain.invalid> wrote:
>  On 3/5/09, Rafael R. <removed_email_address@domain.invalid> wrote:
>  >  And "iirb" isn't working:
>
>
> I can reproduce that. It's another issue that is either in gmcs or in
>  the branch. I'll investigate.

That's an issue with the branch, as IronRuby compiled from origin with
`rake compile mono=1` doesn't exhibit this behavior.
This topic is locked and can not be replied to.