[Moonlight-list] Getting a basic IronPython SL app working in Moonlight
Jimmy Schementi
jschementi at gmail.com
Wed Jul 22 19:34:55 EDT 2009
Here's a pretty significant IronRuby app working in Moonlight:
http://jimmy.schementi.com/silverlight/Tutorial/
Is there a good way to detect that Moonlight is running it? I do a very
naive test for System.Windows.Browser's existance to differentiate between
desktop and silverlight, but because some things don't work in Moonlight I
want to differentiate it further.
BUT it crashes Firefox when I click on the "IronRuby tutorial", and then try
to type something in the prompt. It's a TextBox with the KeyUp event hooked,
it looks like the crash happens before control gets to the handler.
Here's the stack trace from gdb
Thread 1 (Thread 0xb7d048e0 (LWP 12182)):
#0 0xffffe430 in __kernel_vsyscall ()
#1 0xb7f9fbbb in read () from /lib/libpthread.so.0
#2 0xadd4a405 in print_gdb_trace () at debug.cpp:678
#3 0xadd4c084 in moonlight_handle_native_sigsegv (signal=11) at
debug.cpp:731
#4 0xae0675c5 in mono_chain_signal (_dummy=11, info=0xadbd8c8c,
context=0xadbd8d0c)
at mini-posix.c:129
#5 0xadfb7db9 in mono_sigsegv_signal_handler (_dummy=11, info=0xadbd8c8c,
context=0xadbd8d0c) at mini.c:4501
#6 <signal handler called>
#7 0xb60c5045 in gdk_x11_drawable_get_xdisplay () from
/usr/lib/libgdk-x11-2.0.so.0
#8 0xb42f4e8e in ?? () from /usr/lib/gtk-2.0/2.10.0/immodules/im-xim.so
#9 0xb62bd330 in gtk_im_context_filter_keypress () from
/usr/lib/libgtk-x11-2.0.so.0
#10 0xb62bd330 in gtk_im_context_filter_keypress () from
/usr/lib/libgtk-x11-2.0.so.0
#11 0xade29d10 in TextBoxBase::OnKeyDown (this=0xb0a9728, args=0xaf09090)
at textbox.cpp:1484
#12 0xade2a57d in TextBoxBase::key_down (sender=0xb0a9728, args=0xaf09090,
closure=0xb0a9728) at textbox.cpp:1664
#13 0xadd4edcc in EventObject::DoEmit (this=0xb0a9728, event_id=3,
ctx=0xab8dfc0,
calldata=0xaf09090, only_unemitted=false) at dependencyobject.cpp:871
#14 0xade0471d in Surface::EmitEventOnList (this=0x9528348, event_id=3,
element_list=0x8f6c010, event=0xbf9d5c54, end_idx=18) at
runtime.cpp:1272
#15 0xade08184 in Surface::HandleUIKeyPress (this=0x9528348,
event=0xbf9d5c54)
at runtime.cpp:1943
#16 0xadc2ea35 in MoonWindowless::HandleEvent (this=0x94df090,
event=0xbf9d5de8)
at windowless.cpp:245
#17 0xadc05bc0 in PluginInstance::EventHandle (this=0x940aeb0,
event=0xbf9d5de8)
at plugin.cpp:1715
#18 0xadc10b32 in NPP_HandleEvent (instance=0x93f7cd0, event=0xbf9d5de8)
at plugin-glue.cpp:157
#19 0xb7371147 in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#20 0xb6f2960e in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#21 0xb6f2862e in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#22 0xb704fc6b in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#23 0xb70666d1 in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#24 0xb70667cd in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#25 0xb7066bda in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#26 0xb6ee66e6 in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#27 0xb6ee708a in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#28 0xb7128be7 in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#29 0xb712a5ac in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#30 0xb71259d5 in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#31 0xb742a4c4 in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#32 0xb7424a29 in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#33 0xb7424e93 in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#34 0xb62da4b6 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#35 0xb67cbd8b in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#36 0xb67e212d in ?? () from /usr/lib/libgobject-2.0.so.0
#37 0xb67e36bb in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#38 0xb67e3cb6 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#39 0xb63ef9fe in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#40 0xb64036af in gtk_window_propagate_key_event () from
/usr/lib/libgtk-x11-2.0.so.0
#41 0xb6406a1c in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#42 0xb62da4b6 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#43 0xb67ca4d9 in ?? () from /usr/lib/libgobject-2.0.so.0
#44 0xb67cbd8b in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#45 0xb67e1dd5 in ?? () from /usr/lib/libgobject-2.0.so.0
#46 0xb67e36bb in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#47 0xb67e3cb6 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#48 0xb63ef9fe in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#49 0xb62d3091 in gtk_propagate_event () from /usr/lib/libgtk-x11-2.0.so.0
#50 0xb62d4377 in gtk_main_do_event () from /usr/lib/libgtk-x11-2.0.so.0
#51 0xb60ca6ca in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#52 0xb67319c8 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#53 0xb6735083 in ?? () from /usr/lib/libglib-2.0.so.0
#54 0xb6735241 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#55 0xb7428e10 in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#56 0xb743de4c in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#57 0xb743dfe3 in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#58 0xb74eb8ea in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#59 0xb74bc5b8 in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#60 0xb743e12c in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#61 0xb7313868 in ?? () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#62 0xb6d7203e in XRE_main () from /usr/lib/xulrunner-1.9.0.11/libxul.so
#63 0x0804922b in ?? ()
#64 0xb7d1b705 in __libc_start_main () from /lib/libc.so.6
#65 0x08048d91 in ?? ()
Debug info from libmoon:
/home/rupert/.mozilla/firefox/pi8vfe17.default/extensions/
moonlight at novell.com/plugins/moonlight/libmoonxpi.so [0xadd4bfab]
print_stack_trace
/home/builder/moonbuilder/data/lanes/moon-trunk-2.0/138338/source/moon/src/debug.cpp:135
/home/rupert/.mozilla/firefox/pi8vfe17.default/extensions/
moonlight at novell.com/plugins/moonlight/libmoonxpi.so [0xadd4c0b3]
moonlight_handle_native_sigsegv
/home/builder/moonbuilder/data/lanes/moon-trunk-2.0/138338/source/moon/src/debug.cpp:736
/home/rupert/.mozilla/firefox/pi8vfe17.default/extensions/
moonlight at novell.com/plugins/moonlight/libmono.so [0xae0675c5]
mono_chain_signal /home/builder/src/mono/mono/mini/mini-posix.c:138
/home/rupert/.mozilla/firefox/pi8vfe17.default/extensions/
moonlight at novell.com/plugins/moonlight/libmono.so [0xadfb7db9]
mono_sigsegv_signal_handler /home/builder/src/mono/mono/mini/mini.c:4501
[0xffffe410]
/usr/lib/gtk-2.0/2.10.0/immodules/im-xim.so [0xb42f4e8e]
gtk_im_context_xim_register_type ??:0
/usr/lib/libgtk-x11-2.0.so.0.1400.4 [0xb62bd330]
gtk_im_context_filter_keypress ??:0
/usr/lib/libgtk-x11-2.0.so.0.1400.4 [0xb62bd330]
gtk_im_context_filter_keypress ??:0
/usr/bin/firefox: line 126: 12182 Aborted $MOZ_PROGRAM "$@"
~Jimmy
On Wed, Jul 22, 2009 at 12:45 PM, Jimmy Schementi <jschementi at gmail.com>wrote:
> > The webide problem is fixed* in SVN r138338.
> > Your extra details about the '/' parts helped a lot.
>
> I got it working against that latest build of Moonlight! Thanks!!! Here's a
> little test app working:
> http://jimmy.schementi.com/silverlight/mlruby
>
> Now time to play with some non-trivial examples, I'll let you know if I
> have any other problems. Thanks!!!
>
> ~Jimmy
>
>
>
> On Tue, Jul 21, 2009 at 8:41 PM, Jimmy Schementi <jschementi at gmail.com>wrote:
>
>> Ah yes, it is failing because ExtensionPart is referenced; the stack trace
>> you gave me makes that clear. I can build the DLR without the SILVERLIGHT_3
>> flag, which will avoid using ExtensionPart. I'll let you know what happens.
>> Thanks!
>> ~Jimmy
>>
>>
>>
>> On Tue, Jul 21, 2009 at 6:00 PM, Sebastien Pouliot <
>> sebastien.pouliot at gmail.com> wrote:
>>
>>> Hello Jimmy,
>>>
>>> System.Windows.ExtensionPart is new in Silverlight 3 and used to refer
>>> to external library packages (shared zip files). This feature does not
>>> yet exists in Moonlight.
>>>
>>>
>>> http://msdn.microsoft.com/en-us/library/system.windows.extensionpart(VS.95).aspx
>>>
>>> However this is not used inside of your AppManifest.xaml so I guess*
>>> you're shipping a new (3.0) assembly in your XAP file (which refers to
>>> that type).
>>>
>>> * well a bit more than a guess since grep says your XAP's
>>> Microsoft.Scripting.Silverlight.dll refers to this type
>>>
>>> Then again this message about System.Windows.ExtensionPart could be
>>> unrelated to real issue** but you may wish to try with older (2.0)
>>> assemblies to confirm this on Moonlight.
>>>
>>> ** but
>>> while http://jimmy.schementi.com/silverlight/sl-ipy-clock give
>>> me some output on SL2/XP - the only thing I get is the standard
>>> splashscreen followed by a TypeLoadException ;-)
>>>
>>> TypeLoadException: Error 0x80131522. Debugging resource strings are
>>> unavailable. See
>>> http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.31005.0&File=mscorrc.dll&Key=0x80131522
>>> at
>>> Microsoft.Scripting.Silverlight.DynamicAppManifest.UsesDLRExternals()
>>> at
>>> Microsoft.Scripting.Silverlight.DynamicAppManifest.LoadAssemblies(Action
>>> onComplete)
>>> at
>>> Microsoft.Scripting.Silverlight.DynamicApplication.DynamicApplication_Startup(Object
>>> sender, StartupEventArgs e)
>>> at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex,
>>> Delegate handlerDelegate, Object sender, Object args)
>>> at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr
>>> unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
>>>
>>> Sebastien
>>>
>>> On Tue, 2009-07-21 at 18:00 -0400, Sebastien Pouliot wrote:
>>> > Hello Jimmy,
>>> >
>>> > The webide problem is fixed* in SVN r138338. Your extra details about
>>> > the '/' parts helped a lot.
>>> >
>>> > If you cannot build moonlight from SVN then you should try to install
>>> > the unsigned XPI that our build bots produce. Once built the links will
>>> > be shown on those URLs.
>>> >
>>> > [x86_64]
>>> >
>>> http://sublimeintervention.com:8123/ViewLane.aspx?lane_id=4&host_id=7&revision_id=8633
>>> >
>>> > [x86]
>>> >
>>> http://sublimeintervention.com:8123/ViewLane.aspx?lane_id=4&host_id=6&revision_id=8633
>>> >
>>> >
>>> > No fix yet about http://jimmy.schementi.com/silverlight/sl-ipy-clock
>>> > With the previous commit it seems to be looking for the (missing)
>>> > System.Windows.ExtensionPart class
>>> >
>>> > Sebastien
>>> >
>>> > * there seems to be a few other buglets around but hopefully they will
>>> > be solved in later revisions.
>>> >
>>> >
>>> > On Tue, 2009-07-21 at 13:28 -0700, Chris Toshok wrote:
>>> > > We've spent some cycles tracking this down, but nothing concrete
>>> > > toward fixing it (yet). It's similar to problems that have crept in
>>> > > to make the tests work which cause problems with several deployed
>>> > > sites, like netflix. We'll put some effort in tonight and hopefully
>>> > > have some good news for you in the morning.
>>> > >
>>> > > Chris
>>> > >
>>> > > On 07/21/2009 01:13 PM, Jimmy Schementi wrote:
>>> > > > Any thoughts? Sorry for the urgency, but I'd like to show Moonlight
>>> > > > and IronRuby at OSCON on Thursday.
>>> > > >
>>> > > >
>>> > > > Thanks,
>>> > > > ~Jimmy
>>> > > >
>>> > > > On Jul 21, 2009, at 1:19 AM, Jimmy Schementi <jschementi at gmail.com
>>> >
>>> > > > wrote:
>>> > > >
>>> > > >
>>> > > > > I'm trying to get a simple IronPython application working in
>>> > > > > Moonlight:
>>> > > > > http://jimmy.schementi.com/silverlight/sl-ipy-clock
>>> > > > > (Download:
>>> > > > > http://jimmy.schementi.com/silverlight/sl-ipy-clock.zip)
>>> > > > >
>>> > > > > This works in Silverlight 2 and Silverlight 3, but not Moonlight
>>> > > > > 1.9.6. And the error is unfortunately not that helpful:
>>> > > > >
>>> > > > > Unhandled Error in Silverlight 2 Application
>>> > > > > Code: -1
>>> > > > > Category: RuntimeError
>>> > > > > Message: A type load exception has occurred.
>>> > > > > MethodName: 0
>>> > > > >
>>> > > > > file:///srv/www/htdocs/clock/error.js
>>> > > > > Line 31
>>> > > > >
>>> > > > > Also, the Python WebIDE
>>> > > > > (http://www.voidspace.org.uk/ironpython/webide/webide.html) does
>>> > > > > not work, though is site says it does
>>> > > > > (http://go-mono.com/moonlight/MoonlightStatus.aspx?v=2). FWIW,
>>> > > > > most of the examples on that page do work for me. The error
>>> > > > > message this encounters is a bit more descriptive: this app uses
>>> a
>>> > > > > slightly-undocumented feature (I've documented it on my blog =P)
>>> > > > > which will load an assembly outside the XAP file if a the
>>> > > > > AppManifest.xaml file has a <AssemblyPart Source="<uri>" />
>>> > > > > element where <url> is a rooted relative URL
>>> > > > > (eg /deploy/IronPython.dll) or a fully-qualified URI. And it
>>> seems
>>> > > > > that Moonlight doesn't support this yet:
>>> > > > >
>>> > > > > Unhandled Error in Silverlight 2 Application Code: 2105 Category:
>>> > > > > RuntimeError Message: Trying to load the assembly
>>> > > > > '/deploy/Microsoft.Scripting.ExtensionAttribute.dll' outside the
>>> > > > > XAP directory. MethodName: 0
>>> > > > >
>>> > > > > I've installed the Moonlight 2.0 Preview 7 (1.9.6) on the VMware
>>> > > > > Suse VM here:
>>> > > > >
>>> http://ftp.novell.com/pub/mono/appliance/2.4.2.1/Mono-2.4.2.1-vmx.zip.
>>> > > > >
>>> > > > > What is the preferred way I can debug a Moonlight app so I can
>>> > > > > give you guys better bug reports?
>>> > > > >
>>> > > > > Thanks!
>>> > > > > ~Jimmy
>>> > > > >
>>> > > > >
>>> > > > >
>>> > > > >
>>> > > > >
>>> > > >
>>> > > >
>>> ____________________________________________________________________
>>> > > >
>>> > > > _______________________________________________
>>> > > > Moonlight-list mailing list
>>> > > > Moonlight-list at lists.ximian.com
>>> > > > http://lists.ximian.com/mailman/listinfo/moonlight-list
>>> > > >
>>> > >
>>> > > _______________________________________________
>>> > > Moonlight-list mailing list
>>> > > Moonlight-list at lists.ximian.com
>>> > > http://lists.ximian.com/mailman/listinfo/moonlight-list
>>> >
>>> > _______________________________________________
>>> > Moonlight-list mailing list
>>> > Moonlight-list at lists.ximian.com
>>> > http://lists.ximian.com/mailman/listinfo/moonlight-list
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/moonlight-list/attachments/20090722/7431e25a/attachment-0001.html
More information about the Moonlight-list
mailing list