[Pharo-project] Problem with CompiledMethodTrailer
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 <marianopeck@gmail.com> 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.
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 <siguctua@gmail.com> wrote:
On 9 May 2011 00:52, Mariano Martinez Peck <marianopeck@gmail.com> 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 09.05.2011 09:36, Mariano Martinez Peck wrote:
On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <siguctua@gmail.com <mailto:siguctua@gmail.com>> wrote:
On 9 May 2011 00:52, Mariano Martinez Peck <marianopeck@gmail.com <mailto:marianopeck@gmail.com>> 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) ? 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
On 9 May 2011 10:03, Henrik Sperre Johansen <henrik.s.johansen@veloxit.no> wrote:
On 09.05.2011 09:36, Mariano Martinez Peck wrote:
On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <siguctua@gmail.com> wrote:
On 9 May 2011 00:52, Mariano Martinez Peck <marianopeck@gmail.com> 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 <siguctua@gmail.com> wrote:
On 9 May 2011 10:03, Henrik Sperre Johansen <henrik.s.johansen@veloxit.no> wrote:
On 09.05.2011 09:36, Mariano Martinez Peck wrote:
On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <siguctua@gmail.com> wrote:
On 9 May 2011 00:52, Mariano Martinez Peck <marianopeck@gmail.com> 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 <siguctua@gmail.com> wrote:
On 9 May 2011 10:06, Igor Stasenko <siguctua@gmail.com> wrote:
On 9 May 2011 10:03, Henrik Sperre Johansen <henrik.s.johansen@veloxit.no> wrote:
On 09.05.2011 09:36, Mariano Martinez Peck wrote:
On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <siguctua@gmail.com> wrote:
On 9 May 2011 00:52, Mariano Martinez Peck <marianopeck@gmail.com>
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.
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....
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.
-- Mariano http://marianopeck.wordpress.com
On 9 May 2011 09:36, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <siguctua@gmail.com> wrote:
On 9 May 2011 00:52, Mariano Martinez Peck <marianopeck@gmail.com> 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 ??
Its not the same. Look: (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.
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 <marianopeck@gmail.com>:
On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <siguctua@gmail.com> wrote:
On 9 May 2011 00:52, Mariano Martinez Peck <marianopeck@gmail.com> 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 < nicolas.cellier.aka.nice@gmail.com> 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.... thanks It may be possible that CompiledMethod>>printString is lying to you...
Nicolas
2011/5/9 Mariano Martinez Peck <marianopeck@gmail.com>:
On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <siguctua@gmail.com>
wrote:
On 9 May 2011 00:52, Mariano Martinez Peck <marianopeck@gmail.com>
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
On Mon, May 9, 2011 at 10:53 AM, Mariano Martinez Peck < marianopeck@gmail.com> wrote:
On Mon, May 9, 2011 at 10:27 AM, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> 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 <marianopeck@gmail.com>:
On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <siguctua@gmail.com>
wrote:
On 9 May 2011 00:52, Mariano Martinez Peck <marianopeck@gmail.com>
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
the one to the left seems like broken. it not ends with return self. On 9 May 2011 11:22, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Mon, May 9, 2011 at 10:53 AM, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Mon, May 9, 2011 at 10:27 AM, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> 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 <marianopeck@gmail.com>:
On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <siguctua@gmail.com> wrote:
On 9 May 2011 00:52, Mariano Martinez Peck <marianopeck@gmail.com> 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 <siguctua@gmail.com> 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 :( :( On 9 May 2011 11:22, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Mon, May 9, 2011 at 10:53 AM, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Mon, May 9, 2011 at 10:27 AM, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> 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 <marianopeck@gmail.com>:
On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <siguctua@gmail.com> wrote:
On 9 May 2011 00:52, Mariano Martinez Peck <marianopeck@gmail.com> 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.
-- 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 <marianopeck@gmail.com
wrote:
On Mon, May 9, 2011 at 12:48 PM, Igor Stasenko <siguctua@gmail.com> 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 :(
:(
On 9 May 2011 11:22, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Mon, May 9, 2011 at 10:53 AM, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Mon, May 9, 2011 at 10:27 AM, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> 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 <marianopeck@gmail.com>:
On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <siguctua@gmail.com> wrote:
On 9 May 2011 00:52, Mariano Martinez Peck <marianopeck@gmail.com> 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.
-- Mariano http://marianopeck.wordpress.com
-- 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 <marianopeck@gmail.com
wrote:
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 < marianopeck@gmail.com> wrote:
On Mon, May 9, 2011 at 12:48 PM, Igor Stasenko <siguctua@gmail.com>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 :(
:(
On 9 May 2011 11:22, Mariano Martinez Peck <marianopeck@gmail.com>
wrote:
On Mon, May 9, 2011 at 10:53 AM, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Mon, May 9, 2011 at 10:27 AM, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> 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 <marianopeck@gmail.com>:
On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <siguctua@gmail.com> wrote:
On 9 May 2011 00:52, Mariano Martinez Peck <marianopeck@gmail.com
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.
-- Mariano http://marianopeck.wordpress.com
-- Mariano http://marianopeck.wordpress.com
-- Mariano http://marianopeck.wordpress.com
On 9 May 2011 16:01, Mariano Martinez Peck <marianopeck@gmail.com> 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 <siguctua@gmail.com> wrote:
On 9 May 2011 16:01, Mariano Martinez Peck <marianopeck@gmail.com> 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.
ahaaaa!! I didn't know that ;)
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".
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 ?
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"
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, 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.
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 <marianopeck@gmail.com
wrote:
On Mon, May 9, 2011 at 5:06 PM, Igor Stasenko <siguctua@gmail.com> 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:
On 9 May 2011 16:01, Mariano Martinez Peck <marianopeck@gmail.com> wrote: 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.
ahaaaa!! I didn't know that ;)
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".
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 ?
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"
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, 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.
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
-- Mariano http://marianopeck.wordpress.com
On 9 May 2011 17:20, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Mon, May 9, 2011 at 5:06 PM, Igor Stasenko <siguctua@gmail.com> wrote:
On 9 May 2011 16:01, Mariano Martinez Peck <marianopeck@gmail.com> 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.
ahaaaa!! I didn't know that ;)
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".
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 ?
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"
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, 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.
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.
you could take any method and just do #copyWithTrailerBytes: with any trailer you would like to test. You can also look at CompiledMethodTrailerTest for examples (see #testEncoding). As for finding pointers.. have you tried to use pointer finder? :) (it means i can't help with it more than you already know).
Thanks Igor for your help.
-- Mariano http://marianopeck.wordpress.com
-- Best regards, Igor Stasenko AKA sig.
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
Notice that I didn't do anything weird. I just took the default Pharo1.3 image.
you could take any method and just do #copyWithTrailerBytes: with any trailer you would like to test.
Thanks. I don't understand how I can create a trailer with tempNames. Actually, I don't understand what string to pass as tempNames. In your #testEmbeddingTempNames you do: code := 'testEmbeddingSourceCode | trailer newTrailer code | trailer := CompiledMethodTrailer new. trailer sourceCode: code. newTrailer := trailer testEncoding. self assert: (newTrailer sourceCode = code).'. trailer tempNames: code. But I am not sure if that's correct. What does it means? that as temp names I send the full source code? I tried and doesn't work. And then, I read the following method which says something about writing the tempNames with a particular way: schematicTempNamesString "Answer the temp names for the current method node in a form that captures temp structure. The temps at each method and block scope level occur space-separated, with any indirect temps enclosed in parentheses. Each block level is enclosed in square brackets. e.g. 'method level temps (indirect temp)[block args and temps (indirect)]' This representation can be reconstituted into a blockExtentsToTempsMap by a CompiledMethod that has been copied with the schematicTempNamesString." You can also look at CompiledMethodTrailerTest for examples (see
#testEncoding).
As for finding pointers.. have you tried to use pointer finder? :) (it means i can't help with it more than you already know).
Yeah, I tried it. But maybe I am not seeing something :( If you want to try it by yourself, just take any Pharo1.3 image like: https://pharo-ic.lille.inria.fr/hudson/view/Pharo/job/Pharo%201.3/128/artifa... And explore any of the pointers of ((CompiledMethod allInstances select: [:each | each trailer kind = #VarLengthSourcePointer] ) ) thanks for the effort Mariano
Thanks Igor for your help.
-- Mariano http://marianopeck.wordpress.com
-- Best regards, Igor Stasenko AKA sig.
-- Mariano http://marianopeck.wordpress.com
participants (4)
-
Henrik Sperre Johansen -
Igor Stasenko -
Mariano Martinez Peck -
Nicolas Cellier