IncompatibleLayoutConflict with NativeBoost in recent #30700
When loading PunQLite [1] in recent Pharo3.0 Latest update: #30700 I get an exception (IncompatibleLayoutConflict). It all boils down to the single expression: (NBExternalTypeValue ofType: 'NBInt64') from an initialize method which raises this. When I try in Pharo3.0 Latest update: #30579 it works. How can this be fixed? Is there something missing from the latest NB integration? Thx T. [1] http://smalltalkhub.com/#!/~MasashiUmezawa/PunQLite
Hello, I was looking into that, the first (maybe only) reason is that the new class builder can not make anonymous subclasses of classes with ByteLayout https://pharo.fogbugz.com/f/cases/12488/Can-not-create-newAnonymousSubclass-... On 16 Jan 2014, at 16:55, Torsten Bergmann <astares@gmx.de> wrote:
When loading PunQLite [1] in recent Pharo3.0 Latest update: #30700 I get an exception (IncompatibleLayoutConflict).
It all boils down to the single expression:
(NBExternalTypeValue ofType: 'NBInt64')
from an initialize method which raises this. When I try in Pharo3.0 Latest update: #30579 it works.
How can this be fixed? Is there something missing from the latest NB integration?
Thx T.
yep On 16 January 2014 16:58, Marcus Denker <marcus.denker@inria.fr> wrote:
Hello,
I was looking into that, the first (maybe only) reason is that the new class builder can not make anonymous subclasses of classes with ByteLayout
https://pharo.fogbugz.com/f/cases/12488/Can-not-create-newAnonymousSubclass-...
On 16 Jan 2014, at 16:55, Torsten Bergmann <astares@gmx.de> wrote:
When loading PunQLite [1] in recent Pharo3.0 Latest update: #30700 I get an exception (IncompatibleLayoutConflict).
It all boils down to the single expression:
(NBExternalTypeValue ofType: 'NBInt64')
from an initialize method which raises this. When I try in Pharo3.0 Latest update: #30579 it works.
How can this be fixed? Is there something missing from the latest NB integration?
Thx T.
-- Best regards, Igor Stasenko.
i start feeling guilty that NB uses anonymous classes, which brings so much problems to everyone... :) On 16 January 2014 20:54, Torsten Bergmann <astares@gmx.de> wrote:
OK, any expert in the new class builder who could help here?
Thx T.
-- Best regards, Igor Stasenko.
On 16 January 2014 22:07, Torsten Bergmann <astares@gmx.de> wrote:
Igor wrote:
i start feeling guilty that NB uses anonymous classes, which brings so much problems to everyone... :)
So now you should really be ashamed and repair the mess you created :)
I?
initially there was 'self shallowCopy methodDict: nil; superClass:self' kind of code.. and everything worked. Then people started telling that it is not using 'legal' protocols.. etc etc, so i asked: give me one. As it appears now a 'correct' implementation requires creating class/metaclass pair and involves new class builder with new and undocumented API. Which still doesn't delivers. Maybe i asking for impossible? :) ... ehh.. same story about generated code btw. To summarize, everything goes towards: - y u no use metaprogramming. Bye
T.
-- Best regards, Igor Stasenko.
On 16 janv. 2014, at 16:58, Marcus Denker <marcus.denker@inria.fr> wrote:
Hello,
I was looking into that, the first (maybe only) reason is that the new class builder can not make anonymous subclasses of classes with ByteLayout
Is that really a bug? Should it really be possible to subclass a class that has a byte layout with a class that has a fixed layout? Because: AnonymousClassInstaller make: [ :builder | builder superclass: NBExternalTypeValue ] raises IncompatibleLayout but: AnonymousClassInstaller make: [ :builder | builder superclass: NBExternalTypeValue; layoutClass: ByteLayout ] doesn't. A simple fix is to take the same layout class than the superclass by default instead of FixedLayout, isn't it? For example with lazy initialization: SlotClassBuilder>>#layoutClass ^ layoutClass ifNil: [ layoutClass := superclass layout class ]
https://pharo.fogbugz.com/f/cases/12488/Can-not-create-newAnonymousSubclass-...
On 16 Jan 2014, at 16:55, Torsten Bergmann <astares@gmx.de> wrote:
When loading PunQLite [1] in recent Pharo3.0 Latest update: #30700 I get an exception (IncompatibleLayoutConflict).
It all boils down to the single expression:
(NBExternalTypeValue ofType: 'NBInt64')
from an initialize method which raises this. When I try in Pharo3.0 Latest update: #30579 it works.
How can this be fixed? Is there something missing from the latest NB integration?
Thx T.
On 17 January 2014 10:09, Camille Teruel <camille.teruel@gmail.com> wrote:
On 16 janv. 2014, at 16:58, Marcus Denker <marcus.denker@inria.fr> wrote:
Hello,
I was looking into that, the first (maybe only) reason is that the new class builder can not make anonymous subclasses of classes with ByteLayout
Is that really a bug? Should it really be possible to subclass a class that has a byte layout with a class that has a fixed layout?
i don't know and i don't care. Why i should care about such details in NB while all i want is to create simple anonymous subclass?
Because: AnonymousClassInstaller make: [ :builder | builder superclass: NBExternalTypeValue ] raises IncompatibleLayout but: AnonymousClassInstaller make: [ :builder | builder superclass: NBExternalTypeValue; layoutClass: ByteLayout ] doesn't.
A simple fix is to take the same layout class than the superclass by
default instead of FixedLayout, isn't it? For example with lazy initialization:
SlotClassBuilder>>#layoutClass ^ layoutClass ifNil: [ layoutClass := superclass layout class ]
i don't understand what is difference between 'fixed' and 'same as superclass' layout, and i am not sure i want to understand it. I want to be freed from knowing such details when doing something as simple as creating anonymous subclass. P.S. If you think it will work, feel free to post it. -- Best regards, Igor Stasenko.
On 17 Jan 2014, at 11:13, Igor Stasenko <siguctua@gmail.com> wrote:
On 17 January 2014 10:09, Camille Teruel <camille.teruel@gmail.com> wrote:
On 16 janv. 2014, at 16:58, Marcus Denker <marcus.denker@inria.fr> wrote:
Hello,
I was looking into that, the first (maybe only) reason is that the new class builder can not make anonymous subclasses of classes with ByteLayout
Is that really a bug? Should it really be possible to subclass a class that has a byte layout with a class that has a fixed layout?
i don't know and i don't care. Why i should care about such details in NB while all i want is to create simple anonymous subclass?
Because: AnonymousClassInstaller make: [ :builder | builder superclass: NBExternalTypeValue ] raises IncompatibleLayout but: AnonymousClassInstaller make: [ :builder | builder superclass: NBExternalTypeValue; layoutClass: ByteLayout ] doesn't. A simple fix is to take the same layout class than the superclass by default instead of FixedLayout, isn't it? For example with lazy initialization:
SlotClassBuilder>>#layoutClass ^ layoutClass ifNil: [ layoutClass := superclass layout class ]
i don't understand what is difference between 'fixed' and 'same as superclass' layout, and i am not sure i want to understand it. I want to be freed from knowing such details when doing something as simple as creating anonymous subclass.
This is a bug⦠But the fun thing is: I always explain to people that adding a second better subsystem but then not using it everywhere is not good. And we found another case! A bug in the new class builder that we would have found 5 months ago had we used the new one and not the old one in this case. Marcus
On 17 janv. 2014, at 11:13, Igor Stasenko <siguctua@gmail.com> wrote:
On 17 January 2014 10:09, Camille Teruel <camille.teruel@gmail.com> wrote:
On 16 janv. 2014, at 16:58, Marcus Denker <marcus.denker@inria.fr> wrote:
Hello,
I was looking into that, the first (maybe only) reason is that the new class builder can not make anonymous subclasses of classes with ByteLayout
Is that really a bug? Should it really be possible to subclass a class that has a byte layout with a class that has a fixed layout?
i don't know and i don't care. Why i should care about such details in NB while all i want is to create simple anonymous subclass?
Because: AnonymousClassInstaller make: [ :builder | builder superclass: NBExternalTypeValue ] raises IncompatibleLayout but: AnonymousClassInstaller make: [ :builder | builder superclass: NBExternalTypeValue; layoutClass: ByteLayout ] doesn't. A simple fix is to take the same layout class than the superclass by default instead of FixedLayout, isn't it? For example with lazy initialization:
SlotClassBuilder>>#layoutClass ^ layoutClass ifNil: [ layoutClass := superclass layout class ]
i don't understand what is difference between 'fixed' and 'same as superclass' layout, and i am not sure i want to understand it. I want to be freed from knowing such details when doing something as simple as creating anonymous subclass.
P.S. If you think it will work, feel free to post it.
It works and it's commited. Waiting for the monkey and reviews: https://pharo.fogbugz.com/f/cases/12488/Can-not-create-newAnonymousSubclass-...
-- Best regards, Igor Stasenko.
Camille wrote:
It works and it's commited.Â
Thanks! Still there is a problem: (NBExternalTypeValue ofType: 'NBInt64'). in a Pharo3.0 Latest update: #30703 (with the fix integrated) throws now an #DNU because the new anonymous subclass of NBExternalTypeValue class does not understand #rebuildFieldAccessors NBExternalTypeValue(class)>>valueType: sends #rebuildFieldAccessors but there is no such method in this hierarchy. But there is NBExternalStructure>>rebuildFieldAccessors and NBExternalTypeValue(class)>>installAccessors. Maybe a leftover from refactoring? Thx Torsten
On 17 January 2014 20:13, Torsten Bergmann <astares@gmx.de> wrote:
Camille wrote:
It works and it's commited.
Thanks! Still there is a problem:
(NBExternalTypeValue ofType: 'NBInt64').
in a Pharo3.0 Latest update: #30703 (with the fix integrated) throws now an #DNU because the new anonymous subclass of NBExternalTypeValue class does not understand #rebuildFieldAccessors
NBExternalTypeValue(class)>>valueType: sends #rebuildFieldAccessors but there is no such method in this hierarchy.
But there is NBExternalStructure>>rebuildFieldAccessors and NBExternalTypeValue(class)>>installAccessors.
Maybe a leftover from refactoring?
fix in inbox https://pharo.fogbugz.com/f/cases/12674/Fix-NBExternalTypeValue-initializati...
Thx Torsten
-- Best regards, Igor Stasenko.
Thanks Igor! :) After trying in in a fresh Pharo3.0 Latest update: #30703 I loaded slice 12674 the test for NB are green and (NBExternalTypeValue ofType: 'NBInt64'). now finally works. With this now "PUnQLite" package can be loaded again in Pharo 3.0 without errors:   Gofer new url: 'http://smalltalkhub.com/mc/MasashiUmezawa/PunQLite/main'; package: 'ConfigurationOfPunQLite'; load. (Smalltalk at: #ConfigurationOfPunQLite) load The examples from https://github.com/mumez/PunQLite work, EXCEPT one: "Import from files" db := PqDatabase open: 'mczCache.db'. (FileSystem workingDirectory / 'package-cache') files do: [:each | (db importAt: each basename fromFile: each pathString) ifTrue: [db commitTransaction]. ]. db keys inspect. db close. which first gives an "PqCursor" error and when run for a second time leads to a hard VM CRASH (on Windows 8). Anyone able to reproduce? Note that one requires UnQLite library to reproduce which is prebuilt here: https://github.com/mumez/PunQLite/tree/master/binary I guess it is somewhere in #importAt:fromFile: which uses memory mapped files... Bye T.  Gesendet: Freitag, 17. Januar 2014 um 20:55 Uhr Von: "Igor Stasenko" <siguctua@gmail.com> An: "Pharo Development List" <pharo-dev@lists.pharo.org> Betreff: Re: [Pharo-dev] IncompatibleLayoutConflict with NativeBoost in recent #30700   On 17 January 2014 20:13, Torsten Bergmann <astares@gmx.de> wrote: Camille wrote:
It works and it's commited.  Thanks! Still there is a problem:
 (NBExternalTypeValue ofType: 'NBInt64'). in a Pharo3.0 Latest update: #30703 (with the fix integrated) throws now an #DNU because the new anonymous subclass of NBExternalTypeValue class does not understand #rebuildFieldAccessors NBExternalTypeValue(class)>>valueType: sends #rebuildFieldAccessors but there is no such method in this hierarchy. But there is NBExternalStructure>>rebuildFieldAccessors and NBExternalTypeValue(class)>>installAccessors. Maybe a leftover from refactoring?   fix in inbox https://pharo.fogbugz.com/f/cases/12674/Fix-NBExternalTypeValue-initialization[https://pharo.fogbugz.com/f/cases/12674/Fix-NBExternalTypeValue-initialization]  Thx Torsten  -- Best regards, Igor Stasenko.
On 17 January 2014 21:22, Torsten Bergmann <astares@gmx.de> wrote:
Thanks Igor! :)
After trying in in a fresh Pharo3.0 Latest update: #30703 I loaded slice 12674 the test for NB are green and
(NBExternalTypeValue ofType: 'NBInt64').
now finally works. With this now "PUnQLite" package can be loaded again in Pharo 3.0 without errors:
Gofer new url: 'http://smalltalkhub.com/mc/MasashiUmezawa/PunQLite/main'; package: 'ConfigurationOfPunQLite'; load. (Smalltalk at: #ConfigurationOfPunQLite) load
The examples from https://github.com/mumez/PunQLite work, EXCEPT one:
"Import from files" db := PqDatabase open: 'mczCache.db'. (FileSystem workingDirectory / 'package-cache') files do: [:each | (db importAt: each basename fromFile: each pathString) ifTrue: [db commitTransaction]. ]. db keys inspect. db close.
which first gives an "PqCursor" error and when run for a second time leads to a hard VM CRASH (on Windows 8). Anyone able to reproduce?
Note that one requires UnQLite library to reproduce which is prebuilt here:
https://github.com/mumez/PunQLite/tree/master/binary
I guess it is somewhere in #importAt:fromFile: which uses memory mapped files...
If you will stuck for real, feel free to send me a .zip file containing everything prepared vm+image+dll+doit in workspace to reproduce it, so i can take a look. No guarantees i will be able to find anything, however ;)
Bye T.
-- Best regards, Igor Stasenko.
-- Best regards, Igor Stasenko.
Igor wrote
send me a .zip file containing everything prepared vm+image+dll+doit in workspace to reproduce it, so i can take a look.
Thanks Igor for the offer! Meanwhile Masashi Umezawa created a fix already and uploaded a new version to MetaRepoForPharo30. I tried in Pharo3.0 Latest update: #30707 and also this example works. Really cool - now Pharo30 has yet another NoSQL option available! Nice for small deployments. Have fun T.
participants (4)
-
Camille Teruel -
Igor Stasenko -
Marcus Denker -
Torsten Bergmann