Hi guys, Maybe it is too late and I am not seeing something obvious...so another look is really appreciated. If I do:
(CompiledMethod allInstances select: [:each | each trailer kind = #VarLengthSourcePointer] ) first ---> (CodeLoader class>>#initialize "a CompiledMethod(311951360)") But then: (CodeLoader class >> #initialize) trailer kind ----> #SourcePointer WHYYY?? why it is answering #SourcePointer instead of #VarLengthSourcePointer ?? grrr how can that be possible??? It happens the same to each of the CompiledMethods I select as #VarLengthSourcePointer. When I then ask the #kind they always answer #SourcePointer instead of #VarLengthSourcePointer thanks in advance, -- Mariano http://marianopeck.wordpress.com |
On 9 May 2011 00:52, Mariano Martinez Peck <[hidden email]> wrote:
> Hi guys, Maybe it is too late and I am not seeing something obvious...so > another look is really appreciated. If I do: > > (CompiledMethod allInstances select: [:each | each trailer kind = > #VarLengthSourcePointer] ) first > ---> (CodeLoader class>>#initialize "a CompiledMethod(311951360)") > > But then: > > (CodeLoader class >> #initialize) trailer kind > ----> #SourcePointer > > WHYYY?? why it is answering #SourcePointer instead of > #VarLengthSourcePointer ?? > > grrr how can that be possible??? It happens the same to each of the > CompiledMethods I select as #VarLengthSourcePointer. When I then ask the > #kind they always answer #SourcePointer instead of #VarLengthSourcePointer > Because it is absolutely normal if they using different source pointer. > thanks in advance, > > -- > Mariano > http://marianopeck.wordpress.com > > -- Best regards, Igor Stasenko AKA sig. |
On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <[hidden email]> wrote:
I didn't understand your question. Yes, it is exactly the same CompiledMethod. Look, if I do: (CompiledMethod allInstances select: [:each | each trailer kind = #VarLengthSourcePointer] ) first I get ---> (CodeLoader class>>#initialize "a CompiledMethod(311951360)") So...it means that such CompiledMethod answers #VarLengthSourcePointer when send "trailer kind". Ok? But immediatly after, if I ask the trailer kind to the SAME compiled method: (CodeLoader class >> #initialize) trailer kind I get ----> #SourcePointer WHYYY?? why it is answering #SourcePointer instead of #VarLengthSourcePointer ??
-- Mariano http://marianopeck.wordpress.com |
He's asking if they ARE the same (CodeLoader class >> #initialize) == (CompiledMethod allInstances select: [:each | each trailer kind = #VarLengthSourcePointer] ) first) ? Just because the CompiledMethds class and selector matches so its printstring will be 'SomeClass>>#someSelector', does not necessarily mean it is the one currently installed in the method dictionary. Cheers, Henry |
In reply to this post by Mariano Martinez Peck
On 9 May 2011 09:36, Mariano Martinez Peck <[hidden email]> wrote:
> > > On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <[hidden email]> wrote: >> >> On 9 May 2011 00:52, Mariano Martinez Peck <[hidden email]> wrote: >> > Hi guys, Maybe it is too late and I am not seeing something obvious...so >> > another look is really appreciated. If I do: >> > >> > (CompiledMethod allInstances select: [:each | each trailer kind = >> > #VarLengthSourcePointer] ) first >> > ---> (CodeLoader class>>#initialize "a CompiledMethod(311951360)") >> > >> > But then: >> > >> > (CodeLoader class >> #initialize) trailer kind >> > ----> #SourcePointer >> > >> > WHYYY?? why it is answering #SourcePointer instead of >> > #VarLengthSourcePointer ?? >> > >> > grrr how can that be possible??? It happens the same to each of the >> > CompiledMethods I select as #VarLengthSourcePointer. When I then ask >> > the >> > #kind they always answer #SourcePointer instead of >> > #VarLengthSourcePointer >> > >> is it same compiled methods? >> Because it is absolutely normal if they using different source pointer. >> > > I didn't understand your question. Yes, it is exactly the same > CompiledMethod. > Look, if I do: > > (CompiledMethod allInstances select: [:each | each trailer kind = > #VarLengthSourcePointer] ) first > > I get > ---> (CodeLoader class>>#initialize "a CompiledMethod(311951360)") > > So...it means that such CompiledMethod answers #VarLengthSourcePointer when > send "trailer kind". Ok? > > But immediatly after, if I ask the trailer kind to the SAME compiled method: > > (CodeLoader class >> #initialize) trailer kind > > I get > ----> #SourcePointer > > WHYYY?? why it is answering #SourcePointer instead of > #VarLengthSourcePointer ?? > (CompiledMethod allInstances select: [:each | each trailer kind = #VarLengthSourcePointer] ) first == (CodeLoader class>>#initialize ) answers false. Which means that there are two instances of CompiledMethod. One is installed into a class, and another hangs somewhere.. -- Best regards, Igor Stasenko AKA sig. |
In reply to this post by Henrik Sperre Johansen
On 9 May 2011 10:03, Henrik Sperre Johansen
<[hidden email]> wrote: > On 09.05.2011 09:36, Mariano Martinez Peck wrote: > > On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <[hidden email]> wrote: >> >> On 9 May 2011 00:52, Mariano Martinez Peck <[hidden email]> wrote: >> > Hi guys, Maybe it is too late and I am not seeing something obvious...so >> > another look is really appreciated. If I do: >> > >> > (CompiledMethod allInstances select: [:each | each trailer kind = >> > #VarLengthSourcePointer] ) first >> > ---> (CodeLoader class>>#initialize "a CompiledMethod(311951360)") >> > >> > But then: >> > >> > (CodeLoader class >> #initialize) trailer kind >> > ----> #SourcePointer >> > >> > WHYYY?? why it is answering #SourcePointer instead of >> > #VarLengthSourcePointer ?? >> > >> > grrr how can that be possible??? It happens the same to each of the >> > CompiledMethods I select as #VarLengthSourcePointer. When I then ask >> > the >> > #kind they always answer #SourcePointer instead of >> > #VarLengthSourcePointer >> > >> is it same compiled methods? >> Because it is absolutely normal if they using different source pointer. >> > > I didn't understand your question. Yes, it is exactly the same > CompiledMethod. > > He's asking if they ARE the same > > (CodeLoader class >> #initialize) == (CompiledMethod allInstances select: > [:each | each trailer kind = #VarLengthSourcePointer] ) first) ? yeah.. and in my image these are not the same. So, a better question to ask, is why there are multiple instances of same method hanging in image :) > > Just because the CompiledMethds class and selector matches so its > printstring will be 'SomeClass>>#someSelector', does not necessarily mean it > is the one currently installed in the method dictionary. > > Cheers, > Henry > > -- Best regards, Igor Stasenko AKA sig. |
On 9 May 2011 10:06, Igor Stasenko <[hidden email]> wrote:
> On 9 May 2011 10:03, Henrik Sperre Johansen > <[hidden email]> wrote: >> On 09.05.2011 09:36, Mariano Martinez Peck wrote: >> >> On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <[hidden email]> wrote: >>> >>> On 9 May 2011 00:52, Mariano Martinez Peck <[hidden email]> wrote: >>> > Hi guys, Maybe it is too late and I am not seeing something obvious...so >>> > another look is really appreciated. If I do: >>> > >>> > (CompiledMethod allInstances select: [:each | each trailer kind = >>> > #VarLengthSourcePointer] ) first >>> > ---> (CodeLoader class>>#initialize "a CompiledMethod(311951360)") >>> > >>> > But then: >>> > >>> > (CodeLoader class >> #initialize) trailer kind >>> > ----> #SourcePointer >>> > >>> > WHYYY?? why it is answering #SourcePointer instead of >>> > #VarLengthSourcePointer ?? >>> > >>> > grrr how can that be possible??? It happens the same to each of the >>> > CompiledMethods I select as #VarLengthSourcePointer. When I then ask >>> > the >>> > #kind they always answer #SourcePointer instead of >>> > #VarLengthSourcePointer >>> > >>> is it same compiled methods? >>> Because it is absolutely normal if they using different source pointer. >>> >> >> I didn't understand your question. Yes, it is exactly the same >> CompiledMethod. >> >> He's asking if they ARE the same >> >> (CodeLoader class >> #initialize) == (CompiledMethod allInstances select: >> [:each | each trailer kind = #VarLengthSourcePointer] ) first) ? > > yeah.. and in my image these are not the same. > So, a better question to ask, is why there are multiple instances of > same method hanging in image :) > oh.. to be correct.. by saying 'multiple instances of same method' i meant that a multiple instances of CompiledMethod , which having same (class + selector). But since only one can be installed at method dictionary using given selector, i wonder what others doing in image. >> >> Just because the CompiledMethds class and selector matches so its >> printstring will be 'SomeClass>>#someSelector', does not necessarily mean it >> is the one currently installed in the method dictionary. >> >> Cheers, >> Henry >> >> > > > > -- > Best regards, > Igor Stasenko AKA sig. > -- Best regards, Igor Stasenko AKA sig. |
On Mon, May 9, 2011 at 10:10 AM, Igor Stasenko <[hidden email]> wrote:
Thanks guys. Good catch! Igor, I am trying with any PharoDev 1.3 from Hudson: https://pharo-ic.lille.inria.fr/hudson/view/Pharo/job/Pharo%201.3/ I will try to explore pointers....
-- Mariano http://marianopeck.wordpress.com |
In reply to this post by Mariano Martinez Peck
Hi Mariano,
you should try these two things before repeating yourself: (CompiledMethod allInstances select: [:each | each trailer kind = #VarLengthSourcePointer] ) first trailer kind. | temp | temp := (CompiledMethod allInstances select: [:each | each trailer kind = #VarLengthSourcePointer] ) first. temp == (temp methodClass >> temp selector) It may be possible that CompiledMethod>>printString is lying to you... Nicolas 2011/5/9 Mariano Martinez Peck <[hidden email]>: > > > On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <[hidden email]> wrote: >> >> On 9 May 2011 00:52, Mariano Martinez Peck <[hidden email]> wrote: >> > Hi guys, Maybe it is too late and I am not seeing something obvious...so >> > another look is really appreciated. If I do: >> > >> > (CompiledMethod allInstances select: [:each | each trailer kind = >> > #VarLengthSourcePointer] ) first >> > ---> (CodeLoader class>>#initialize "a CompiledMethod(311951360)") >> > >> > But then: >> > >> > (CodeLoader class >> #initialize) trailer kind >> > ----> #SourcePointer >> > >> > WHYYY?? why it is answering #SourcePointer instead of >> > #VarLengthSourcePointer ?? >> > >> > grrr how can that be possible??? It happens the same to each of the >> > CompiledMethods I select as #VarLengthSourcePointer. When I then ask >> > the >> > #kind they always answer #SourcePointer instead of >> > #VarLengthSourcePointer >> > >> is it same compiled methods? >> Because it is absolutely normal if they using different source pointer. >> > > I didn't understand your question. Yes, it is exactly the same > CompiledMethod. > Look, if I do: > > (CompiledMethod allInstances select: [:each | each trailer kind = > #VarLengthSourcePointer] ) first > > I get > ---> (CodeLoader class>>#initialize "a CompiledMethod(311951360)") > > So...it means that such CompiledMethod answers #VarLengthSourcePointer when > send "trailer kind". Ok? > > But immediatly after, if I ask the trailer kind to the SAME compiled method: > > (CodeLoader class >> #initialize) trailer kind > > I get > ----> #SourcePointer > > WHYYY?? why it is answering #SourcePointer instead of > #VarLengthSourcePointer ?? > >> >> > thanks in advance, >> > >> > -- >> > Mariano >> > http://marianopeck.wordpress.com >> > >> > >> >> >> >> -- >> Best regards, >> Igor Stasenko AKA sig. >> > > > > -- > Mariano > http://marianopeck.wordpress.com > > |
On Mon, May 9, 2011 at 10:27 AM, Nicolas Cellier <[hidden email]> wrote: Hi Mariano, Thanks Nicolas. Yes, in fact all of you were right. They are not the same CM instance. They are different. It is wierd that they are only present in Pharo1.3: ((CompiledMethod allInstances select: [:each | each trailer kind = #VarLengthSourcePointer] ) ) size ->>> 11 And in Pharo 1.2, cero and and 1.1.1, 2. I am trying to inspect pointers to them to see who is pointing to them...but I cannot find anything :( I will continue.... thanks It may be possible that CompiledMethod>>printString is lying to you... -- Mariano http://marianopeck.wordpress.com |
On Mon, May 9, 2011 at 10:53 AM, Mariano Martinez Peck <[hidden email]> wrote:
More data: there are only these kind of compiled methods in the dev image. Not in core. In addition, if I do: ScriptLoader new cleanUpForRelease, then inspect ((CompiledMethod allInstances select: [:each | each trailer kind = #VarLengthSourcePointer] ) ) and then I click on the first element in the inspector.... VM CRASH!!! with both, InterpreterVM and CogVM. I can see the difference in the trailer of the CMs (I attach screenshot), but still cannot find who is pointing to that weird instances :( grrr... thanks for the help
-- Mariano http://marianopeck.wordpress.com Screen shot 2011-05-09 at 11.06.26 AM.png (198K) Download Attachment |
the one to the left seems like broken. it not ends with return self.
On 9 May 2011 11:22, Mariano Martinez Peck <[hidden email]> wrote: > > > On Mon, May 9, 2011 at 10:53 AM, Mariano Martinez Peck > <[hidden email]> wrote: >> >> >> On Mon, May 9, 2011 at 10:27 AM, Nicolas Cellier >> <[hidden email]> wrote: >>> >>> Hi Mariano, >>> you should try these two things before repeating yourself: >>> >>> (CompiledMethod allInstances select: [:each | each trailer kind = >>> #VarLengthSourcePointer] ) first trailer kind. >>> >>> | temp | >>> temp := (CompiledMethod allInstances select: [:each | each trailer >>> kind = #VarLengthSourcePointer] ) first. >>> temp == (temp methodClass >> temp selector) >>> >> >> Thanks Nicolas. Yes, in fact all of you were right. They are not the same >> CM instance. They are different. >> It is wierd that they are only present in Pharo1.3: >> >> >> ((CompiledMethod allInstances select: [:each | each trailer kind = >> #VarLengthSourcePointer] ) ) size >> ->>> 11 >> >> And in Pharo 1.2, cero and and 1.1.1, 2. >> >> I am trying to inspect pointers to them to see who is pointing to >> them...but I cannot find anything :( >> >> I will continue.... >> > > More data: there are only these kind of compiled methods in the dev image. > Not in core. > > In addition, if I do: ScriptLoader new cleanUpForRelease, then inspect > ((CompiledMethod allInstances select: [:each | each trailer kind = > #VarLengthSourcePointer] ) ) > > and then I click on the first element in the inspector.... VM CRASH!!! with > both, InterpreterVM and CogVM. > > I can see the difference in the trailer of the CMs (I attach screenshot), > but still cannot find who is pointing to that weird instances :( > > grrr... thanks for the help > > > >> >> thanks >> >> >> >>> It may be possible that CompiledMethod>>printString is lying to you... >>> >>> Nicolas >>> >>> 2011/5/9 Mariano Martinez Peck <[hidden email]>: >>> > >>> > >>> > On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <[hidden email]> >>> > wrote: >>> >> >>> >> On 9 May 2011 00:52, Mariano Martinez Peck <[hidden email]> >>> >> wrote: >>> >> > Hi guys, Maybe it is too late and I am not seeing something >>> >> > obvious...so >>> >> > another look is really appreciated. If I do: >>> >> > >>> >> > (CompiledMethod allInstances select: [:each | each trailer kind = >>> >> > #VarLengthSourcePointer] ) first >>> >> > ---> (CodeLoader class>>#initialize "a CompiledMethod(311951360)") >>> >> > >>> >> > But then: >>> >> > >>> >> > (CodeLoader class >> #initialize) trailer kind >>> >> > ----> #SourcePointer >>> >> > >>> >> > WHYYY?? why it is answering #SourcePointer instead of >>> >> > #VarLengthSourcePointer ?? >>> >> > >>> >> > grrr how can that be possible??? It happens the same to each of the >>> >> > CompiledMethods I select as #VarLengthSourcePointer. When I then >>> >> > ask >>> >> > the >>> >> > #kind they always answer #SourcePointer instead of >>> >> > #VarLengthSourcePointer >>> >> > >>> >> is it same compiled methods? >>> >> Because it is absolutely normal if they using different source >>> >> pointer. >>> >> >>> > >>> > I didn't understand your question. Yes, it is exactly the same >>> > CompiledMethod. >>> > Look, if I do: >>> > >>> > (CompiledMethod allInstances select: [:each | each trailer kind = >>> > #VarLengthSourcePointer] ) first >>> > >>> > I get >>> > ---> (CodeLoader class>>#initialize "a CompiledMethod(311951360)") >>> > >>> > So...it means that such CompiledMethod answers #VarLengthSourcePointer >>> > when >>> > send "trailer kind". Ok? >>> > >>> > But immediatly after, if I ask the trailer kind to the SAME compiled >>> > method: >>> > >>> > (CodeLoader class >> #initialize) trailer kind >>> > >>> > I get >>> > ----> #SourcePointer >>> > >>> > WHYYY?? why it is answering #SourcePointer instead of >>> > #VarLengthSourcePointer ?? >>> > >>> >> >>> >> > thanks in advance, >>> >> > >>> >> > -- >>> >> > Mariano >>> >> > http://marianopeck.wordpress.com >>> >> > >>> >> > >>> >> >>> >> >>> >> >>> >> -- >>> >> Best regards, >>> >> Igor Stasenko AKA sig. >>> >> >>> > >>> > >>> > >>> > -- >>> > Mariano >>> > http://marianopeck.wordpress.com >>> > >>> > >>> >> >> >> >> -- >> Mariano >> http://marianopeck.wordpress.com >> > > > > -- > Mariano > http://marianopeck.wordpress.com > > -- Best regards, Igor Stasenko AKA sig. |
On Mon, May 9, 2011 at 12:48 PM, Igor Stasenko <[hidden email]> wrote: the one to the left seems like broken. it not ends with return self. yes, exactly. That one on the left is the one that trailer kind answers #VarLengthSourcePointer the right is the correct one. You can also notice that the one of the left in addition to not having the last bytecode (self return), it has only 2 bytes for the trailer. Anyway, regardless of how such CM could have been generated, I CANNOT find who is pointing to them. They appear only in PharoDev and I cannot find any pattern between them :( :(
-- Mariano http://marianopeck.wordpress.com |
Ok, the problem is the following. Check my screenshot of the previous mail. Left is incorrect, right is correct.
As you can notice, the "correct" CompiledMethod finishes with a bytecode "return self" and number 78. This bytecode is missing in the "incorrect" CM. And, the first byte in method trailer in the incorrect CM is 120. Guess what? 16r78 -> 120. So...the incorrect CM interpret that byte as trailer instead of bytecode. Now, if you ask to the incorrect CM: "trailer data", you get, of course, 120. If you see sourcePointer: ptr self clear. data := ptr. "see if we can encode pointer using 4-byte trailer" kind := (ptr between: 16r1000000 and: 16r4FFFFFF) ifTrue: [ #SourcePointer ] ifFalse: [ #VarLengthSourcePointer ]. You can guess that ptr is 120, hence it sets #VarLengthSourcePointer Now...two problem bugs: 1) how can these CM be generated???? Compiler bug? 2) where are they kept that I cannot garbage collect them ?? Cheers Mariano On Mon, May 9, 2011 at 2:50 PM, Mariano Martinez Peck <[hidden email]> wrote:
-- Mariano http://marianopeck.wordpress.com |
Another that....all those incorrect compiled method has the same: they miss the bytecode 120 (self return), and they ALL have the same last byte: 32.
what that 32 can be? I don't know...
On Mon, May 9, 2011 at 3:27 PM, Mariano Martinez Peck <[hidden email]> wrote: Ok, the problem is the following. Check my screenshot of the previous mail. Left is incorrect, right is correct. -- Mariano http://marianopeck.wordpress.com |
On 9 May 2011 16:01, Mariano Martinez Peck <[hidden email]> wrote:
> Another that....all those incorrect compiled method has the same: they miss > the bytecode 120 (self return), and they ALL have the same last byte: 32. > what that 32 can be? I don't know... > This is indicating a trailer kind: ((CompiledMethod allInstances select: [:each | each trailer kind = #VarLengthSourcePointer] ) ) first trailer kindAsByte 32 32 stands for #VarLengthSourcePointer trailer. And i have plenty of methods with #VarLengthSourcePointer in my image ((CompiledMethod allInstances select: [:each | each trailer kind = #VarLengthSourcePointer] ) ) size 4387 because my .changes file go over 32Mb "limit". Now to check what is going on, we should run a following: methods := ((CompiledMethod allInstances select: [:each | each trailer kind = #VarLengthSourcePointer] ) ). methods := methods select: [:m | m isInstalled ]. "we don't care about not-installed ones" and for installed we should verify that after compilation it from source code, it ends up with same bytecode as in currently installed method. | methods | methods := ((CompiledMethod allInstances select: [:each | each trailer kind = #VarLengthSourcePointer] ) ). methods := methods select: [:m | | cls | cls := m methodClass. cls isObsolete not and: [ (cls compiledMethodAt: m selector) == m ] ]. methods select: [:m | | m2 | m2 := m methodNode generate. ((m initialPC = m2 initialPC and: [m endPC = m2 endPC ]) and: [ (m initialPC to: m endPC) allSatisfy: [:i | (m at: i) = (m2 at: i)] ]) not ]. In my image the result of doit is empty array. Note that endPC is calculating based on trailer data. So if trailer is not correct, it would affect the comparison. So, it could fail if source code pointer is not valid or endPC calculation is wrong. But for all methods it is correct. -- Best regards, Igor Stasenko AKA sig. |
On Mon, May 9, 2011 at 5:06 PM, Igor Stasenko <[hidden email]> wrote:
ahaaaa!! I didn't know that ;)
So...when the .changes file is over 32 bits, the default trailer is #VarLengthSourcePointer ? BTW, do you know how can I create a CompiledMethod for testing with this kind of trailer ?
No, non of the methods is installed. So that script answers an empty array. and for installed we should verify that after compilation it from source code, Thanks for the help. In fact, since non of them is installed, I also have that array empty. The problem is the code (like mine) that does CompiledMethod allInstances directly...without filtering by #isInstalled. Depending on what they do it can even be a crash (as it happened to me). So I would like to still know: 1) while those fucking CMs are not GCed 2) how they can be generated. I have spent the whole day and I couldn't :( I am more interested in 1) Notice that I didn't do anything weird. I just took the default Pharo1.3 image. Thanks Igor for your help. -- Mariano http://marianopeck.wordpress.com |
BTW...closing all windows, doing GC, no limit pf 32 mb .changes....is it normal to have 60 CompiledMethod instances NOT installed and NOT with selector #DoIt ???
if true...why ? where are they stored? Thanks in advance Mariano On Mon, May 9, 2011 at 5:20 PM, Mariano Martinez Peck <[hidden email]> wrote:
-- Mariano http://marianopeck.wordpress.com |
In reply to this post by Mariano Martinez Peck
On May 9, 2011, at 6:18 PM, Mariano Martinez Peck wrote: > BTW...closing all windows, doing GC, no limit pf 32 mb .changes....is it normal to have 60 CompiledMethod instances NOT installed and NOT with selector #DoIt ??? > > if true...why ? where are they stored? > I think changesets are (or at least used to) hold on to old compiledMethods. Marcus -- Marcus Denker -- http://www.marcusdenker.de INRIA Lille -- Nord Europe. Team RMoD. |
Some block closure generally hold onto CompiledMethod.
Nicolas 2011/5/9 Marcus Denker <[hidden email]>: > > On May 9, 2011, at 6:18 PM, Mariano Martinez Peck wrote: > >> BTW...closing all windows, doing GC, no limit pf 32 mb .changes....is it normal to have 60 CompiledMethod instances NOT installed and NOT with selector #DoIt ??? >> >> if true...why ? where are they stored? >> > > I think changesets are (or at least used to) hold on to old compiledMethods. > > Marcus > > > -- > Marcus Denker -- http://www.marcusdenker.de > INRIA Lille -- Nord Europe. Team RMoD. > > > |
Free forum by Nabble | Edit this page |