[squeak-dev] Interaction with Sugar on Ubuntu.

Bert Freudenberg bert at freudenbergs.de
Mon Dec 9 20:28:32 UTC 2013


On 2013-12-09, at 21:08, Gustavo Duarte <gduarte at activitycentral.com> wrote:

> Hi Bert,
> 
> 
> I modified the startup parameters, adding DOCUMENT and SQUEAKLETS, as you can see on the log file (http://ubuntuone.com/2ENSAyrV5UgSm8uHA1yQV1).

You set the document to /home/gustavo/etoys but it needs to be an empty string.
> But exceptions still raiesd as you can see on printscreen: http://ubuntuone.com/7Zwub6TOv5A22HZeEQarsW

It's probably trying to load "/home/gustavo/etoys" as a startup document, which fails.

> Also i checked the gconf configuration: and it is same as on XO where Etoys is working fine.
> 
> gustavo at ceibal-cm2:~$ gconftool-2 -R  /desktop/sugar/user
>  nick = estudiante-cm2
>  default_nick = system
>  birth_timestamp = -663572121
>  color = #B20008,#FF8F00
>  background = /usr/share/backgrounds/ceibal/sugar.jpg

I guess the Squeaklet directory is not found because of the argument mixup.


> Something else to try ?

You could learn how to use the Squeak tools, like the debugger, so you know exactly what's going on ;)

- Bert -


> Thanks in advance.
> 
> Gustavo.
> 
> 
> On Mon, Dec 9, 2013 at 2:37 PM, Bert Freudenberg <bert at freudenbergs.de> wrote:
> Wow, I've been so busy this week I missed this thread ... thanks everyone for chiming in :)
> 
> On 2013-12-06, at 22:28, David T. Lewis <lewis at mail.msen.com> wrote:
> 
> >> Hi guys,
> >>
> >> I had tried another approach, I installed "Etoys-To-Go 5.0.1.app" on my
> >> Ubuntu, and interaction with Sugar work, as you can see in the following
> >> screenshot (http://ubuntuone.com/1Ax7rU0ikfZHH1n0NClzKe) , i can open
> >> Journal, but another kind or error raised:
> >>
> >>
> >> Any idea ?
> >>
> >
> > Etoys-To-Go is packaged with a VM that is compiled with Sugar support.
> > When you run the script to start Etoys in Etoys-To-Go, it uses that VM
> > rather than any other VM that you might have installed separately on your
> > Ubuntu system. That explains why the startup now works.
> >
> > The error that you are seeing now is something else. There is some sort of
> > failure occuring during the image startup. Class SugarLauncher is trying
> > to do something in its startUp method (that is a method that is sent to
> > various registered classes as image start time). It looks like it is
> > trying to retrieve some image from dbus having to do with its "ownerBuddy"
> > (whatever that is, I don't know). It apparently expects to get some sort
> > of XML data from dbus, and it's not getting it for some reason.
> 
> Almost. It's trying the "old way" of asking for the user name ("ownerBuddy") via DBus. This fails on newer Sugar versions, so in the error handler it then tries to use gconf to find the user name. It's reading .gconf/desktop/sugar/user/%gconf.xml and expects to find a "name" tag in it. Apparently that fails.
> 
> As for your startup problems, you appear to be missing an empty argument following the image argument. That is taken by Etoys as a "startup" document. After this empty argument there are additional arguments, like SQUEAKLETS etc.:
> 
>         ... /usr/share/etoys/etoys.image "" SQUEAKLETS ...
> 
> If you look at /usr/bin/etoys, it uses
> 
>         "$VM" -plugins "$BIN" $VMOPTIONS "$IMAGE" "$DOCUMENT" $IMOPTIONS
> 
> and "$DOCUMENT" is that startup document. It must be present, even if empty, if there are other image options following.
> 
> HTH,
> 
> - Bert -
> 
> > I'm completely guessing, but this might be just something to do with
> > starting your Etoys-To-Go directly from the command line, when perhaps the
> > SugarLauncher was expecting that it was started in some other way. Sorry I
> > don't know any more about this, but look for some kind of problem related
> > to Etoys not being able to get this initial information from dbus.
> >
> > Dave
> >
> >
> >> =========== SqueakDebug.log START ==========
> >> Error: attempt to index non-existent element in an ordered collection
> >> 6 December 2013 5:27:52 pm
> >>
> >> VM: unix - a SmalltalkImage
> >> Image: etoys5.0 [latest update: #2409]
> >>
> >> SecurityManager state:
> >> Restricted: false
> >> FileAccess: true
> >> SocketAccess: true
> >> Working Dir /home/gustavo/tmp/Etoys
> >> Trusted Dir /home/gustavo/tmp/.etoys
> >> Untrusted Dir /home/gustavo/tmp/Etoys
> >>
> >> OrderedCollection(Object)>>error:
> >> Receiver: an OrderedCollection()
> >> Arguments and temporary variables:
> >> aString: 'attempt to index non-existent element in an ordered collection'
> >> Receiver's instance variables:
> >> array: #(nil nil nil nil nil nil nil nil nil nil)
> >> firstIndex: 3
> >> lastIndex: 2
> >>
> >> OrderedCollection>>errorNoSuchElement
> >> Receiver: an OrderedCollection()
> >> Arguments and temporary variables:
> >>
> >> Receiver's instance variables:
> >> array: #(nil nil nil nil nil nil nil nil nil nil)
> >> firstIndex: 3
> >> lastIndex: 2
> >>
> >> OrderedCollection>>at:
> >> Receiver: an OrderedCollection()
> >> Arguments and temporary variables:
> >> anInteger: 1
> >> Receiver's instance variables:
> >> array: #(nil nil nil nil nil nil nil nil nil nil)
> >> firstIndex: 3
> >> lastIndex: 2
> >>
> >> OrderedCollection(SequenceableCollection)>>first
> >> Receiver: an OrderedCollection()
> >> Arguments and temporary variables:
> >>
> >> Receiver's instance variables:
> >> array: #(nil nil nil nil nil nil nil nil nil nil)
> >> firstIndex: 3
> >> lastIndex: 2
> >>
> >>
> >> --- The full stack ---
> >> OrderedCollection(Object)>>error:
> >> OrderedCollection>>errorNoSuchElement
> >> OrderedCollection>>at:
> >> OrderedCollection(SequenceableCollection)>>first
> >> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> >> [] in SugarLauncher>>gconfPropertiesAt: {[:entry | props   at: (entry
> >> attributeAt: 'name')   put: entry elements firs...]}
> >> XMLElement>>tagsNamed:do:
> >> [] in XMLElement(XMLNode)>>tagsNamed:do: {[:each | each tagsNamed: aSymbol
> >> do: aOneArgumentBlock]}
> >> [] in XMLElement(XMLNodeWithElements)>>elementsDo: {[:each | aBlock value:
> >> each]}
> >> OrderedCollection>>do:
> >> XMLElement(XMLNodeWithElements)>>elementsDo:
> >> XMLElement(XMLNode)>>tagsNamed:do:
> >> XMLElement>>tagsNamed:do:
> >> [] in XMLDocument(XMLNode)>>tagsNamed:do: {[:each | each tagsNamed:
> >> aSymbol
> >> do: aOneArgumentBlock]}
> >> [] in XMLDocument(XMLNodeWithElements)>>elementsDo: {[:each | aBlock
> >> value:
> >> each]}
> >> OrderedCollection>>do:
> >> XMLDocument(XMLNodeWithElements)>>elementsDo:
> >> XMLDocument(XMLNode)>>tagsNamed:do:
> >> [] in SugarLauncher>>gconfPropertiesAt: {[:f |  props := Dictionary new.
> >> (XMLDOMParser parseDocumentFrom: f)   tagsN...]}
> >> [] in FileStream class>>detectFile:do: {[anotherBlock value: file]}
> >> BlockContext>>ensure:
> >> FileStream class>>detectFile:do:
> >> FileStream class>>readOnlyFileNamed:do:
> >> [] in SugarLauncher>>gconfPropertiesAt: {[FileStream   readOnlyFileNamed:
> >> dir pathName , '/.gconf' , aString , '/%gco...]}
> >> BlockContext>>on:do:
> >> SugarLauncher>>gconfPropertiesAt:
> >> [] in SugarLauncher>>ownerBuddy {[:ex | ^ SugarBuddyOwner
> >> fromDictionary:
> >> (self gconfPropertiesAt: '/deskto...]}
> >> BlockContext>>valueWithPossibleArgs:
> >> [] in MethodContext(ContextPart)>>handleSignal: {[(self tempAt: 2)
> >> valueWithPossibleArgs: {exception}]}
> >> BlockContext>>ensure:
> >> MethodContext(ContextPart)>>handleSignal:
> >> DBusError(Exception)>>signal
> >> DBusError(Exception)>>signal:
> >> DBusError class(Exception class)>>signal:
> >> DBus>>sendDBusMessage:timeout:
> >> DBus>>sendDBusMessage:
> >> SugarPresence(DBusProxy)>>dbusPerform:interface:withArguments:
> >> SugarPresence(DBusProxy)>>dbusPerform:interface:
> >> SugarPresence>>getOwner
> >> [] in SugarLauncher>>ownerBuddy {[^ SugarBuddy fromDictionary: self
> >> presence getOwner getProperties]}
> >> BlockContext>>on:do:
> >> SugarLauncher>>ownerBuddy
> >> [] in SugarLauncher>>startUp {[:activityId |  OLPCVirtualScreen
> >> setupIfNeeded.  World windowEventHandler: ...]}
> >> Dictionary>>at:ifPresent:
> >> SugarLauncher>>startUp
> >> [] in AutoStart class>>startUp: {[launcher startUp]}
> >> WorldState>>runStepMethodsIn:
> >> PasteUpMorph>>runStepMethods
> >> WorldState>>doOneCycleNowFor:
> >> WorldState>>doOneCycleFor:
> >> PasteUpMorph>>doOneCycle
> >> [] in Project class>>spawnNewProcess {[[World doOneCycle.  Processor
> >> yield.
> >> false] whileFalse.  nil]}
> >> [] in BlockContext>>newProcess {[self value.  Processor terminateActive]}
> >> =========== SqueakDebug.log END  ==========
> >>
> >>
> >>
> >>
> >> On Fri, Dec 6, 2013 at 11:57 AM, David T. Lewis <lewis at mail.msen.com>
> >> wrote:
> >>
> >>> On Fri, Dec 06, 2013 at 10:34:16AM -0200, Gustavo Duarte wrote:
> >>>> Dave,
> >>>>
> >>>> I believe that squeakvm is compiled with Sugar support, because I can
> >>> run
> >>>> Scratch and save projects on Journal, just in case, there is another
> >>> way
> >>> to
> >>>> know if squeakvm is compiled with Sugar support ?
> >>>>
> >>>
> >>> If you run the VM executable directly with the -help option, it will
> >>> print
> >>> a list of available command line options. If the VM was compiled with
> >>> Sugar support, the list of X11 options will include this:
> >>>
> >>>  -sugarBundleId <id>   set window property _SUGAR_BUNDLE_ID to <id>
> >>>  -sugarActivityId <id> set window property _SUGAR_ACTIVITY_ID to <id>
> >>>
> >>> If the VM does not have this, then it will not handle the command line
> >>> option parsing as expected.
> >>>
> >>> As far as I can tell, the Sugar support in the VM is used only to set
> >>> some X11 window properties. I am not familiar with Sugar, so I do not
> >>> know why this is important, but I would expect that the basic
> >>> functioning
> >>> of Etoys and Squeak would not be affected by this at all. So just for
> >>> purposes of testing, you might want to try running Etoys with the
> >>> following
> >>> two parameters removed from the command line:
> >>>
> >>>  -sugarBundleId org.vpri.EtoysActivity
> >>>  -sugarActivityId > 24c67ec800d1d71723f959b56a213accf140e7bc
> >>>
> >>> I expect that if you run it this way, then Etoys should start up
> >>> normally
> >>> and the "inverted dictionary" problem will be resolved. This will at
> >>> least confirm the problem, then we can figure out what to do to fix it.
> >>>
> >>> Dave
> >>>
> >>>
> >>>>
> >>>> I paste bellow another test I had done:
> >>>>
> >>>> As Scratch is working well with the interaction with Sugar, I copied
> >>> the
> >>>> same parameters of Scratch starting script, and executed this from a
> >>>> terminal as:
> >>>>
> >>>> sudo /usr/lib/squeak/4.4.7-2357/squeakvm -vm-display-X11 -swapbtn
> >>> -encoding
> >>>> UTF-8 -vm-sound-ALSA -sugarBundleId org.vpri.EtoysActivity
> >>> -sugarActivityId
> >>>> 24c67ec800d1d71723f959b56a213accf140e7bc /usr/share/etoys/etoys.image
> >>>> SQUEAKLETS
> >>>> /home/gustavo-cm1/.sugar/default/org.vpri.EtoysActivity/instance/
> >>> BUNDLE_ID
> >>>> org.vpri.EtoysActivity ACTIVITY_ID
> >>> 24c67ec800d1d71723f959b56a213accf140e7bc
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> The output debug log is:
> >>>>
> >>>>
> >>>> =========== SqueakDebug.log START ==========
> >>>> Error: No content to install
> >>>> 6 December 2013 10:05:27 am
> >>>>
> >>>> VM: unix - a SmalltalkImage
> >>>> Image: etoys5.0 [latest update: #2408]
> >>>>
> >>>> SecurityManager state:
> >>>> Restricted: false
> >>>> FileAccess: true
> >>>> SocketAccess: true
> >>>> Working Dir /usr/share/etoys/My Squeak
> >>>> Trusted Dir /usr/share/etoys/secure
> >>>> Untrusted Dir /usr/share/etoys/My Squeak
> >>>>
> >>>> CodeLoader(Object)>>error:
> >>>> Receiver: a CodeLoader
> >>>> Arguments and temporary variables:
> >>>> aString:  'No content to install'
> >>>> Receiver's instance variables:
> >>>> baseURL:  ''
> >>>> sourceFiles:  #(a HTTPDownloadRequest)
> >>>> segments:  nil
> >>>> publicKey:  nil
> >>>>
> >>>> CodeLoader>>installSourceFile:
> >>>> Receiver: a CodeLoader
> >>>> Arguments and temporary variables:
> >>>> aStream:  nil
> >>>> contents:  nil
> >>>> trusted:  nil
> >>>> Receiver's instance variables:
> >>>> baseURL:  ''
> >>>> sourceFiles:  #(a HTTPDownloadRequest)
> >>>> segments:  nil
> >>>> publicKey:  nil
> >>>>
> >>>> [] in CodeLoader>>installSourceFiles {[:req | self installSourceFile:
> >>> req
> >>>> contentStream]}
> >>>> Arguments and temporary variables:
> >>>> req:  a HTTPDownloadRequest
> >>>>
> >>>> Array(SequenceableCollection)>>do:
> >>>> Receiver: #(a HTTPDownloadRequest)
> >>>> Arguments and temporary variables:
> >>>> aBlock:  [] in CodeLoader>>installSourceFiles {[:req | self
> >>>> installSourceFile: r...etc...
> >>>> index:  1
> >>>> indexLimiT:  1
> >>>> Receiver's instance variables:
> >>>> #(a HTTPDownloadRequest)
> >>>>
> >>>>
> >>>> --- The full stack ---
> >>>> CodeLoader(Object)>>error:
> >>>> CodeLoader>>installSourceFile:
> >>>> [] in CodeLoader>>installSourceFiles {[:req | self installSourceFile:
> >>> req
> >>>> contentStream]}
> >>>> Array(SequenceableCollection)>>do:
> >>>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> >>>> CodeLoader>>installSourceFiles
> >>>> ProjectLauncher>>startUpAfterLogin
> >>>> ProjectLauncher>>doEtoyLogin
> >>>> ProjectLauncher>>startUp
> >>>> [] in AutoStart class>>startUp: {[launcher startUp]}
> >>>> WorldState>>runStepMethodsIn:
> >>>> PasteUpMorph>>runStepMethods
> >>>> WorldState>>doOneCycleNowFor:
> >>>> WorldState>>doOneCycleFor:
> >>>> PasteUpMorph>>doOneCycle
> >>>> [] in Project class>>spawnNewProcess {[[World doOneCycle.  Processor
> >>> yield.
> >>>> false] whileFalse.  nil]}
> >>>> [] in BlockContext>>newProcess {[self value.  Processor
> >>> terminateActive]}
> >>>> =========== SqueakDebug.log END  ==========
> >>>>
> >>>>
> >>>>
> >>>> On Fri, Dec 6, 2013 at 12:17 AM, David T. Lewis <lewis at mail.msen.com>
> >>> wrote:
> >>>>
> >>>>> On Thu, Dec 05, 2013 at 02:36:42PM -0800, Eliot Miranda wrote:
> >>>>>> On Thu, Dec 5, 2013 at 2:01 PM, Gustavo Duarte
> >>>>>> <gduarte at activitycentral.com>wrote:
> >>>>>>
> >>>>>>> Eliot,
> >>>>>>>
> >>>>>>> Here the output of ps ww PID command.
> >>>>>>>
> >>>>>>> XO:
> >>>>>>>
> >>>>>>> PID TTY      STAT   TIME COMMAND
> >>>>>>>  976 ?        S      0:22 /usr/lib/squeak/4.10.2-2614/squeakvm
> >>>>> -encoding
> >>>>>>> UTF-8 -vm-display-x11 -xshm -sugarBundleId
> >>> org.vpri.EtoysActivity
> >>>>>>> -sugarActivityId d25f8c2f9a19397ce914965abf04ed31b3f6b0ea
> >>>>> -vm-sound-ALSA
> >>>>>>> /usr/share/etoys/etoys.image  BUNDLE_PATH
> >>>>>>> /home/olpc/Activities/Etoys.activity SQUEAKLETS
> >>>>>>> /home/olpc/.sugar/default/org.vpri.EtoysActivity/instance
> >>> BUNDLE_ID
> >>>>>>> org.vpri.EtoysActivity ACTIVITY_ID
> >>>>> d25f8c2f9a19397ce914965abf04ed31b3f6b0ea
> >>>>>>>
> >>>>>>>
> >>>>>>> CM:
> >>>>>>>
> >>>>>>> PID TTY      STAT   TIME COMMAND
> >>>>>>> 5912 ?        Rl     0:06 /usr/lib/squeak/4.4.7-2357/squeakvm
> >>>>> -encoding
> >>>>>>> UTF-8 -vm-display-x11 -xshm -sugarBundleId
> >>> org.vpri.EtoysActivity
> >>>>>>> -sugarActivityId c03be0a816bee1440f701b7d3b504b0968cb3274
> >>>>> -vm-sound-pulse
> >>>>>>> /usr/share/etoys/etoys.image BUNDLE_PATH
> >>>>>>> /usr/share/sugar/activities/Etoys.activity SQUEAKLETS
> >>>>>>> /home/gustavo-cm1/.sugar/default/org.vpri.EtoysActivity/instance
> >>>>> BUNDLE_ID
> >>>>>>> org.vpri.EtoysActivity ACTIVITY_ID
> >>>>> c03be0a816bee1440f701b7d3b504b0968cb3274
> >>>>>>>
> >>>>>>>
> >>>>>>> Seem the script that start squeak is ok, right ?
> >>>>>>>
> >>>>>>
> >>>>>>
> >>>>>> Looks like it :-(.  That implies theres a bug in the VM on ubuntu
> >>> :-(.
> >>>>>> Might it be something to do with the vm-sound-pulse plugin
> >>> mis-parsing
> >>>>> the
> >>>>>> command line?  What happens if you start it with no sound (omit
> >>>>>> -vm-sound-pulse) ?
> >>>>>>
> >>>>>
> >>>>> After reading this thread, I was initially confused by the command
> >>> line
> >>>>> options that are being passed to the VM:
> >>>>>
> >>>>>  -encoding UTF-8
> >>>>>  -vm-display-x11
> >>>>>  -xshm
> >>>>>  -sugarBundleId org.vpri.EtoysActivity
> >>>>>  -sugarActivityId c03be0a816bee1440f701b7d3b504b0968cb3274
> >>>>>  -vm-sound-pulse
> >>>>>
> >>>>> These are options that are parsed by the VM executable itself, as
> >>> opposed
> >>>>> to being passed to the Etoys image and evaluated there.
> >>>>>
> >>>>> I took a look at the VM sources, and see that the -sugarBundleId and
> >>>>> the -sugarActivityId parameters will be interpreted by the VM
> >>> executable
> >>>>> if and only if the VM was compiled with Sugar support:
> >>>>>
> >>>>>  #    if defined(SUGAR)
> >>>>>        else if (!strcmp(arg, "-sugarBundleId"))   sugarBundleId=
> >>> argv[1];
> >>>>>        else if (!strcmp(arg, "-sugarActivityId")) sugarActivityId=
> >>>>> argv[1];
> >>>>>  #    endif
> >>>>>
> >>>>> I expect that if the Etoys image is run from a script that specifies
> >>> those
> >>>>> two VM parameters, and if the VM was not compiled without Sugar
> >>> support,
> >>>>> then the command line parameters are probably going to get out of
> >>> whack.
> >>>>> The dictionary that got turned inside out is probably a side effect
> >>> of
> >>>>> this.
> >>>>>
> >>>>> So my guess is that the script is trying to run a VM for Etoys in
> >>> the
> >>>>> Sugar environment, but the VM that is being run by that script was
> >>> not
> >>>>> compiled with Sugar support enabled.
> >>>>>
> >>>>> Dave
> >>>>>
> >>>>>
> >>>>>
> >>>
> >>>>
> >>>
> >>>
> >>>
> >>
> >>
> >
> >
> >
> 
> - Bert -
> 
> 
> 

- Bert -


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20131209/868f0d4a/attachment.htm


More information about the Squeak-dev mailing list