[squeak-dev] FFI on 3.10 Dev image?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] FFI on 3.10 Dev image?

Ken G. Brown
Is FFI supposed to load into 3.10?
When I try loading FFI() from SqueakMap into a fresh sq3.10-7159dev08.02.1 I get the following failure:

Ken G. Brown
-----------------------------------------------------------------------------------
VM: Mac OS - a SmalltalkImage
Image: Squeak3.10beta [latest update: #7159]

SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir /mySqueakStuff/Sqkb/Sqkb3.10/sq3.10-7159dev08.02.1
Trusted Dir /foobar/tooBar/forSqueak/bogus
Untrusted Dir /Users/kbrownMPro/Library/Preferences/Squeak/Internet/My Squeak

UndefinedObject(Object)>>doesNotUnderstand: #at:ifAbsent:
        Receiver: nil
        Arguments and temporary variables:
                aMessage: at: #ExternalStructure ifAbsent: [] in ExternalType class>>noticeModi...etc...
        Receiver's instance variables:
nil

[] in ExternalType class>>noticeModificationOf: {[:cls |  type := StructTypes     at: cls name     ifAbsent: [].  type   ifNo...]}
        Arguments and temporary variables:
                aClass: ExternalStructure
                type: nil
                cls: ExternalStructure

ExternalStructure class(Behavior)>>withAllSubclassesDo:
        Receiver: ExternalStructure
        Arguments and temporary variables:
                aBlock: [] in ExternalType class>>noticeModificationOf: {[:cls |  type := Struc...etc...
        Receiver's instance variables:
                superclass: ExternalObject
                methodDict: a MethodDictionary(#free->a CompiledMethod (1328) #longPrintOn:->a ...etc...
                format: 132
                instanceVariables: nil
                organization: ('as yet unclassified')

                subclasses: {ExternalData}
                name: #ExternalStructure
                classPool: nil
                sharedPools: an OrderedCollection(FFIConstants)
                environment: a SystemDictionary(lots of globals)
                category: #'FFI-Kernel'
                traitComposition: {}
                localSelectors: nil
                compiledSpec: nil

ExternalType class>>noticeModificationOf:
        Receiver: ExternalType
        Arguments and temporary variables:
                aClass: ExternalStructure
                type: nil
                cls: ExternalStructure
        Receiver's instance variables:
                superclass: Object
                methodDict: a MethodDictionary(#asNonPointerType->a CompiledMethod (3691) #asPo...etc...
                format: 136
                instanceVariables: #('compiledSpec' 'referentClass' 'referencedType')
                organization: ('as yet unclassified')

                subclasses: nil
                name: #ExternalType
                classPool: a Dictionary(#AtomicSelectors->nil #AtomicTypeNames->nil #AtomicType...etc...
                sharedPools: an OrderedCollection(FFIConstants)
                environment: a SystemDictionary(lots of globals)
                category: #'FFI-Kernel'
                traitComposition: {}
                localSelectors: nil


--- The full stack ---
UndefinedObject(Object)>>doesNotUnderstand: #at:ifAbsent:
[] in ExternalType class>>noticeModificationOf: {[:cls |  type := StructTypes     at: cls name     ifAbsent: [].  type   ifNo...]}
ExternalStructure class(Behavior)>>withAllSubclassesDo:
ExternalType class>>noticeModificationOf:
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ExternalStructure class>>doneCompiling
[] in ClassBuilder>>name:inEnvironment:subclassOf:type:instanceVariableNames:classVariableNames:poolDictionaries:category:unsafe: {[unsafe   ifFalse: [(self validateSuperclass: newSuper forSubclass: oldClass...]}
BlockContext>>ensure:
ClassBuilder>>name:inEnvironment:subclassOf:type:instanceVariableNames:classVariableNames:poolDictionaries:category:unsafe:
ClassBuilder>>name:inEnvironment:subclassOf:type:instanceVariableNames:classVariableNames:poolDictionaries:category:
MCClassDefinition>>createUnionClassWith:
MCClassDefinition>>postinstall
[] in MCPackageLoader1b>>basicLoad {[:ea | ea postinstall]}
OrderedCollection>>do:
MCPackageLoader1b>>basicLoad
[] in MCPackageLoader1b>>protectedLoad {[self basicLoad]}
BlockContext>>on:do:
[] in MCPackageLoader1b>>protectedLoad {[[self basicLoad]   on: InMidstOfFileinNotification   do: [:n | n resume: tr...]}
BlockContext>>ensure:
[] in MCPackageLoader1b>>protectedLoad {[[[self basicLoad]   on: InMidstOfFileinNotification   do: [:n | n resume: t...]}
BlockContext>>on:do:
MCPackageLoader1b>>protectedLoad
[] in MCPackageLoader1b>>loadWithNameLike: {[self protectedLoad]}
[] in MCPackageLoader1b>>useChangeSetNamed:during: {[aBlock value]}
BlockContext>>ensure:
MCPackageLoader1b>>useChangeSetNamed:during:
MCPackageLoader1b>>useNewChangeSetNamedLike:during:
MCPackageLoader1b>>loadWithNameLike:
MCVersionLoader>>loadWithNameLike:
MCVersionLoader>>load
MCVersionLoader class>>loadVersion:
MCVersion>>load
[] in UndefinedObject>>DoIt {[:t2 :t3 |  t1 value: t2 * 2 - 1.  reader := repo versionReaderForFileNamed:...]}
Array(SequenceableCollection)>>keysAndValuesDo:
[] in UndefinedObject>>DoIt {[:t1 | #('FFI-Kernel-ar.8.mcz' 'FFI-Tests-ar.2.mcz' 'FFI-Examples-ar.1.mcz' ...]}
...etc...

Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: FFI on 3.10 Dev image?

EstebanLM
Hi Ken,
I loaded in 3.10 build 7159, from universes, almost without problems...
and I said "almost" because I had to load the package before any
other... otherwise, it hangs... and maybe there is something else wrong
later, but for now, everything work well (right now I'm using just
FreeType, but I will load more libraries next weeks)

Cheers,
Esteban

On 2008-02-25 22:38:04 -0200, "Ken G. Brown" <[hidden email]> said:

> Is FFI supposed to load into 3.10?
> When I try loading FFI() from SqueakMap into a fresh
> sq3.10-7159dev08.02.1 I get the following failure:
>
> Ken G. Brown
> -----------------------------------------------------------------------------------
VM:

>
> Mac OS - a SmalltalkImage
> Image: Squeak3.10beta [latest update: #7159]
>
> SecurityManager state:
> Restricted: false
> FileAccess: true
> SocketAccess: true
> Working Dir /mySqueakStuff/Sqkb/Sqkb3.10/sq3.10-7159dev08.02.1
> Trusted Dir /foobar/tooBar/forSqueak/bogus
> Untrusted Dir /Users/kbrownMPro/Library/Preferences/Squeak/Internet/My Squeak
>
> UndefinedObject(Object)>>doesNotUnderstand: #at:ifAbsent:
> Receiver: nil
> Arguments and temporary variables:
> aMessage: at: #ExternalStructure ifAbsent: [] in ExternalType
> class>>noticeModi...etc...
> Receiver's instance variables:
> nil
>
> [] in ExternalType class>>noticeModificationOf: {[:cls |  type :=
> StructTypes     at: cls name     ifAbsent: [].  type   ifNo...]}
> Arguments and temporary variables:
> aClass: ExternalStructure
> type: nil
> cls: ExternalStructure
>
> ExternalStructure class(Behavior)>>withAllSubclassesDo:
> Receiver: ExternalStructure
> Arguments and temporary variables:
> aBlock: [] in ExternalType class>>noticeModificationOf: {[:cls |  
> type := Struc...etc...
> Receiver's instance variables:
> superclass: ExternalObject
> methodDict: a MethodDictionary(#free->a CompiledMethod (1328)
> #longPrintOn:->a ...etc...
> format: 132
> instanceVariables: nil
> organization: ('as yet unclassified')
>
> subclasses: {ExternalData}
> name: #ExternalStructure
> classPool: nil
> sharedPools: an OrderedCollection(FFIConstants)
> environment: a SystemDictionary(lots of globals)
> category: #'FFI-Kernel'
> traitComposition: {}
> localSelectors: nil
> compiledSpec: nil
>
> ExternalType class>>noticeModificationOf:
> Receiver: ExternalType
> Arguments and temporary variables:
> aClass: ExternalStructure
> type: nil
> cls: ExternalStructure
> Receiver's instance variables:
> superclass: Object
> methodDict: a MethodDictionary(#asNonPointerType->a CompiledMethod
> (3691) #asPo...etc...
> format: 136
> instanceVariables: #('compiledSpec' 'referentClass' 'referencedType')
> organization: ('as yet unclassified')
>
> subclasses: nil
> name: #ExternalType
> classPool: a Dictionary(#AtomicSelectors->nil #AtomicTypeNames->nil
> #AtomicType...etc...
> sharedPools: an OrderedCollection(FFIConstants)
> environment: a SystemDictionary(lots of globals)
> category: #'FFI-Kernel'
> traitComposition: {}
> localSelectors: nil
>
>
> --- The full stack ---
> UndefinedObject(Object)>>doesNotUnderstand: #at:ifAbsent:
> [] in ExternalType class>>noticeModificationOf: {[:cls |  type :=
> StructTypes     at: cls name     ifAbsent: [].  type   ifNo...]}
> ExternalStructure class(Behavior)>>withAllSubclassesDo:
> ExternalType class>>noticeModificationOf:
>  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> ExternalStructure class>>doneCompiling
> [] in
> ClassBuilder>>name:inEnvironment:subclassOf:type:instanceVariableNames:classVariableNames:poolDictionaries:category:unsafe:
> {[unsafe   ifFalse: [(self validateSuperclass: newSuper forSubclass:
> oldClass...]}
> BlockContext>>ensure:
> ClassBuilder>>name:inEnvironment:subclassOf:type:instanceVariableNames:classVariableNames:poolDictionaries:category:unsafe:
ClassBuilder>>name:inEnvironment:subclassOf:type:instanceVariableNames:classVariableNames:poolDictionaries:category:
MCClassDefinition>>createUnionClassWith:
MCClassDefinition>>postinstall
[]

>
> in MCPackageLoader1b>>basicLoad {[:ea | ea postinstall]}
> OrderedCollection>>do:
> MCPackageLoader1b>>basicLoad
> [] in MCPackageLoader1b>>protectedLoad {[self basicLoad]}
> BlockContext>>on:do:
> [] in MCPackageLoader1b>>protectedLoad {[[self basicLoad]   on:
> InMidstOfFileinNotification   do: [:n | n resume: tr...]}
> BlockContext>>ensure:
> [] in MCPackageLoader1b>>protectedLoad {[[[self basicLoad]   on:
> InMidstOfFileinNotification   do: [:n | n resume: t...]}
> BlockContext>>on:do:
> MCPackageLoader1b>>protectedLoad
> [] in MCPackageLoader1b>>loadWithNameLike: {[self protectedLoad]}
> [] in MCPackageLoader1b>>useChangeSetNamed:during: {[aBlock value]}
> BlockContext>>ensure:
> MCPackageLoader1b>>useChangeSetNamed:during:
> MCPackageLoader1b>>useNewChangeSetNamedLike:during:
> MCPackageLoader1b>>loadWithNameLike:
> MCVersionLoader>>loadWithNameLike:
> MCVersionLoader>>load
> MCVersionLoader class>>loadVersion:
> MCVersion>>load
> [] in UndefinedObject>>DoIt {[:t2 :t3 |  t1 value: t2 * 2 - 1.  reader
> := repo versionReaderForFileNamed:...]}
> Array(SequenceableCollection)>>keysAndValuesDo:
> [] in UndefinedObject>>DoIt {[:t1 | #('FFI-Kernel-ar.8.mcz'
> 'FFI-Tests-ar.2.mcz' 'FFI-Examples-ar.1.mcz' ...]}
> ...etc...




Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: FFI on 3.10 Dev image?

Andrew Tween
In reply to this post by Ken G. Brown
Hi,
I noticed the same problem and tracked it down to this...
ExternalStructure class implements doneCompiling, and doneCompiling is sent
during the MC1.5 loading process.
(specifically - it is sent from
ClassBuilder>>name:inEnvironment:subclassOf:type:instanceVariableNames:classVariableNames:poolDictionaries:category:unsafe:
 )

ExternalStructure class>>doneCompiling then calls  ExternalType
class>>noticeModificationOf: , which then accesses its StructTypes class
var.
But ExternalType hasn't been sent #initialize yet, so its StructTypes class
var is nil.

I presume that the old MC loader loads/initializes things in a different
order, which is why the problem doesn't occur in a standard 3.10 image.

To workaround the problem, and get FFI loaded, I hacked
ClassBuilder>>name:inEnvironment:subclassOf:type:instanceVariableNames:classVariableNames:poolDictionaries:category:unsafe:
so that errors occuring during doneCompiling are ignored. (hacked method
attached).
FFI then loads ok from Universes, and seems to function correctly.

I've also noticed that preambles and postscripts aren't being run by the
MC1.5 loader, which causes problems for other packages (such as FreeType
Plus).

I have added both these issues to Mantis...
http://bugs.squeak.org/view.php?id=6952
http://bugs.squeak.org/view.php?id=6953

Cheers,
Andy



"Ken G. Brown" <[hidden email]> wrote in message
news:p0624043cc3e90f0bbeb8@[169.254.1.2]...

> Is FFI supposed to load into 3.10?
> When I try loading FFI() from SqueakMap into a fresh sq3.10-7159dev08.02.1
> I get the following failure:
>
> Ken G. Brown
> -----------------------------------------------------------------------------------
> VM: Mac OS - a SmalltalkImage
> Image: Squeak3.10beta [latest update: #7159]
>
> SecurityManager state:
> Restricted: false
> FileAccess: true
> SocketAccess: true
> Working Dir /mySqueakStuff/Sqkb/Sqkb3.10/sq3.10-7159dev08.02.1
> Trusted Dir /foobar/tooBar/forSqueak/bogus
> Untrusted Dir /Users/kbrownMPro/Library/Preferences/Squeak/Internet/My
> Squeak
>
> UndefinedObject(Object)>>doesNotUnderstand: #at:ifAbsent:
> Receiver: nil
> Arguments and temporary variables:
> aMessage: at: #ExternalStructure ifAbsent: [] in ExternalType
> class>>noticeModi...etc...
> Receiver's instance variables:
> nil
>
> [] in ExternalType class>>noticeModificationOf: {[:cls |  type :=
> StructTypes     at: cls name     ifAbsent: [].  type   ifNo...]}
> Arguments and temporary variables:
> aClass: ExternalStructure
> type: nil
> cls: ExternalStructure
>
> ExternalStructure class(Behavior)>>withAllSubclassesDo:
> Receiver: ExternalStructure
> Arguments and temporary variables:
> aBlock: [] in ExternalType class>>noticeModificationOf: {[:cls |  type :=
> Struc...etc...
> Receiver's instance variables:
> superclass: ExternalObject
> methodDict: a MethodDictionary(#free->a CompiledMethod (1328)
> #longPrintOn:->a ...etc...
> format: 132
> instanceVariables: nil
> organization: ('as yet unclassified')
>
> subclasses: {ExternalData}
> name: #ExternalStructure
> classPool: nil
> sharedPools: an OrderedCollection(FFIConstants)
> environment: a SystemDictionary(lots of globals)
> category: #'FFI-Kernel'
> traitComposition: {}
> localSelectors: nil
> compiledSpec: nil
>
> ExternalType class>>noticeModificationOf:
> Receiver: ExternalType
> Arguments and temporary variables:
> aClass: ExternalStructure
> type: nil
> cls: ExternalStructure
> Receiver's instance variables:
> superclass: Object
> methodDict: a MethodDictionary(#asNonPointerType->a CompiledMethod (3691)
> #asPo...etc...
> format: 136
> instanceVariables: #('compiledSpec' 'referentClass' 'referencedType')
> organization: ('as yet unclassified')
>
> subclasses: nil
> name: #ExternalType
> classPool: a Dictionary(#AtomicSelectors->nil #AtomicTypeNames->nil
> #AtomicType...etc...
> sharedPools: an OrderedCollection(FFIConstants)
> environment: a SystemDictionary(lots of globals)
> category: #'FFI-Kernel'
> traitComposition: {}
> localSelectors: nil
>
>
> --- The full stack ---
> UndefinedObject(Object)>>doesNotUnderstand: #at:ifAbsent:
> [] in ExternalType class>>noticeModificationOf: {[:cls |  type :=
> StructTypes     at: cls name     ifAbsent: [].  type   ifNo...]}
> ExternalStructure class(Behavior)>>withAllSubclassesDo:
> ExternalType class>>noticeModificationOf:
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> ExternalStructure class>>doneCompiling
> [] in
> ClassBuilder>>name:inEnvironment:subclassOf:type:instanceVariableNames:classVariableNames:poolDictionaries:category:unsafe:
> {[unsafe   ifFalse: [(self validateSuperclass: newSuper forSubclass:
> oldClass...]}
> BlockContext>>ensure:
> ClassBuilder>>name:inEnvironment:subclassOf:type:instanceVariableNames:classVariableNames:poolDictionaries:category:unsafe:
> ClassBuilder>>name:inEnvironment:subclassOf:type:instanceVariableNames:classVariableNames:poolDictionaries:category:
> MCClassDefinition>>createUnionClassWith:
> MCClassDefinition>>postinstall
> [] in MCPackageLoader1b>>basicLoad {[:ea | ea postinstall]}
> OrderedCollection>>do:
> MCPackageLoader1b>>basicLoad
> [] in MCPackageLoader1b>>protectedLoad {[self basicLoad]}
> BlockContext>>on:do:
> [] in MCPackageLoader1b>>protectedLoad {[[self basicLoad]   on:
> InMidstOfFileinNotification   do: [:n | n resume: tr...]}
> BlockContext>>ensure:
> [] in MCPackageLoader1b>>protectedLoad {[[[self basicLoad]   on:
> InMidstOfFileinNotification   do: [:n | n resume: t...]}
> BlockContext>>on:do:
> MCPackageLoader1b>>protectedLoad
> [] in MCPackageLoader1b>>loadWithNameLike: {[self protectedLoad]}
> [] in MCPackageLoader1b>>useChangeSetNamed:during: {[aBlock value]}
> BlockContext>>ensure:
> MCPackageLoader1b>>useChangeSetNamed:during:
> MCPackageLoader1b>>useNewChangeSetNamedLike:during:
> MCPackageLoader1b>>loadWithNameLike:
> MCVersionLoader>>loadWithNameLike:
> MCVersionLoader>>load
> MCVersionLoader class>>loadVersion:
> MCVersion>>load
> [] in UndefinedObject>>DoIt {[:t2 :t3 |  t1 value: t2 * 2 - 1.  reader :=
> repo versionReaderForFileNamed:...]}
> Array(SequenceableCollection)>>keysAndValuesDo:
> [] in UndefinedObject>>DoIt {[:t1 | #('FFI-Kernel-ar.8.mcz'
> 'FFI-Tests-ar.2.mcz' 'FFI-Examples-ar.1.mcz' ...]}
> ...etc...
>
>



ClassBuilder-nameinEnvironmentsubclassOftypeinstanceVariableNamesclassVariableNamespoolDictionariescategoryunsafe.st (4K) Download Attachment