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.
1e39a948a58f4569c53d971c2e120920?d=identicon&s=25 Ivan Porto carrero (casualjim)
on 2009-02-20 09: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?
Cb51033949ffccd982ae32c9f890f25a?d=identicon&s=25 Tomas Matousek (Guest)
on 2009-02-20 18: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: ironruby-core-bounces@rubyforge.org
[mailto:ironruby-core-bounces@rubyforge.org] 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?
1e39a948a58f4569c53d971c2e120920?d=identicon&s=25 Ivan Porto carrero (casualjim)
on 2009-02-21 21: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 Carrero
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 Matousek <
086c5d9a5f964abbce6423a80eb6ee13?d=identicon&s=25 Rafael Rosa (rafaelrosafu)
on 2009-03-04 01: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
E1deaac6561498a0e7472e6268ea9ccc?d=identicon&s=25 Jimmy Schementi (Guest)
on 2009-03-04 06: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
086c5d9a5f964abbce6423a80eb6ee13?d=identicon&s=25 Rafael Rosa (rafaelrosafu)
on 2009-03-04 07: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
1e39a948a58f4569c53d971c2e120920?d=identicon&s=25 Ivan Porto carrero (casualjim)
on 2009-03-04 08: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.
740c85b27e1a80c5f908d81dca5d4fbf?d=identicon&s=25 Jb Evain (Guest)
on 2009-03-04 11:08
(Received via mailing list)
Hey,

On 3/4/09, Rafael Rosa <lists@ruby-forum.com> 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.
1e39a948a58f4569c53d971c2e120920?d=identicon&s=25 Ivan Porto carrero (casualjim)
on 2009-03-04 12: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.
740c85b27e1a80c5f908d81dca5d4fbf?d=identicon&s=25 Jb Evain (Guest)
on 2009-03-04 13:18
(Received via mailing list)
On 3/4/09, Ivan Porto Carrero <ivan@flanders.co.nz> 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.
740c85b27e1a80c5f908d81dca5d4fbf?d=identicon&s=25 Jb Evain (Guest)
on 2009-03-04 13:44
(Received via mailing list)
On 3/4/09, Jb Evain <jb@nurv.fr> wrote:
> On 3/4/09, Ivan Porto Carrero <ivan@flanders.co.nz> 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.
086c5d9a5f964abbce6423a80eb6ee13?d=identicon&s=25 Rafael Rosa (rafaelrosafu)
on 2009-03-04 15: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
740c85b27e1a80c5f908d81dca5d4fbf?d=identicon&s=25 Jb Evain (Guest)
on 2009-03-04 21:18
(Received via mailing list)
Attachment: workaround_usings.diff (5 KB)
On 3/4/09, Jb Evain <jb@nurv.fr> 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.
1e39a948a58f4569c53d971c2e120920?d=identicon&s=25 Ivan Porto carrero (casualjim)
on 2009-03-04 22:34
(Received via mailing list)
Great :D
086c5d9a5f964abbce6423a80eb6ee13?d=identicon&s=25 Rafael Rosa (rafaelrosafu)
on 2009-03-05 06: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.
1e39a948a58f4569c53d971c2e120920?d=identicon&s=25 Ivan Porto carrero (casualjim)
on 2009-03-05 08:05
(Received via mailing list)
rename your .gemrc (hidden in your home folder) file and try again
086c5d9a5f964abbce6423a80eb6ee13?d=identicon&s=25 Rafael Rosa (rafaelrosafu)
on 2009-03-05 14: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
740c85b27e1a80c5f908d81dca5d4fbf?d=identicon&s=25 Jb Evain (Guest)
on 2009-03-05 14:58
(Received via mailing list)
Hey,

On 3/5/09, Rafael Rosa <lists@ruby-forum.com> 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.
740c85b27e1a80c5f908d81dca5d4fbf?d=identicon&s=25 Jb Evain (Guest)
on 2009-03-06 00:00
(Received via mailing list)
On 3/5/09, Jb Evain <jb@nurv.fr> wrote:
>  On 3/5/09, Rafael Rosa <lists@ruby-forum.com> 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.