Serious problems with Pragma's

222 views
Skip to first unread message

Jan van de Sandt

unread,
Oct 24, 2011, 6:47:49 AM10/24/11
to va-sma...@googlegroups.com
Hello,
 
We have deveopled some functionality that uses the new Pragma feature of VA Smalltalk 8.5.
 
But now we run into problems:
  • When you change the superclass of a class that contains one or more Pragma definitions you get a debugger.
  • When you load an application wich contains Pragma definitions into a new image the Pragma information is not found. The Pragma>>allNamed... methods all return an empty collection. After recompiling a method the Pragma information is available again.
Am I doing somthing wrong or are there still some bugs in the Pragma support of VA Smalltalk?
 
Jan.

Jan van de Sandt

unread,
Oct 25, 2011, 10:09:33 AM10/25/11
to VA Smalltalk
Today I discovered another pretty serious problem :-(

Packaging an application that contains methods with Pragma's also
fails. The method EsRomerImageDumper(EsDumper)>>#compactMethods:
raises the error 'Shared bytecodes with different literals size'

Has anyone successfully used Pragma's in a packaged VA Smalltalk
application ?

Jan.

On 24 okt, 12:47, Jan van de Sandt <jvdsa...@gmail.com> wrote:
> Hello,
>
> We have deveopled some functionality that uses the new Pragma feature of VA
> Smalltalk 8.5.
>
> But now we run into problems:
>
>    - When you change the superclass of a class that contains one or more
>    Pragma definitions you get a debugger.
>    - When you load an application wich contains Pragma definitions into a

Adriaan van Os

unread,
Oct 27, 2011, 8:12:02 AM10/27/11
to va-sma...@googlegroups.com
We're running into the same packaging problem here.

I have little pragma wish list as well:
  • find pragmas just by name (not by name and class)
  • find pragmas by name and class including all subclasses
  • browse result found pragmas in code browser in stead of array inspector
  • include pragmas in results when searching for senders of selector
Cheers,
Adriaan.

Sebastian Heidbrink

unread,
Oct 27, 2011, 9:21:40 AM10/27/11
to va-sma...@googlegroups.com
Hi Adriaan,

good list so far.

I would like to add one little addition.

- Proper Pragma initialization with filed-in sources.

Currently you need to change and save methods after file-In. Only this way imported Pragmas get porperly recognized by VAST.

Regards,
Sebastian
--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/fRvq5Eww3zAJ.
To post to this group, send email to va-sma...@googlegroups.com.
To unsubscribe from this group, send email to va-smalltalk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.

John O'Keefe

unread,
Oct 27, 2011, 4:58:35 PM10/27/11
to va-sma...@googlegroups.com
Jan -
 
I have opened Case 48916 for this packaging problem.  Am I correct that you are packaging your code into ICs?
 
John

Jan van de Sandt

unread,
Oct 27, 2011, 5:25:05 PM10/27/11
to va-sma...@googlegroups.com
Hello John,

Thanks for taking a look at this issue. We were using the regular packaging procedure without ICs.

Note that there are more problems with Pragma's than just the packaging process. See my first mail.

Jan.


--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/MfMqkBV4JFkJ.

John O'Keefe

unread,
Oct 29, 2011, 2:06:13 PM10/29/11
to va-sma...@googlegroups.com
Jan -
 
I am having difficulty reproducing your problems.
 
1) For changing the superclass of a class containing a pragma, is it any change to the superclass or only some specific change? Can you capure the walkback and attach it?
 
2) For losing the pragma on loading an application, can you inspect one of the methods containing a pragma before you recompile it (i.e., (AClass>>#aMethodWithPragma) inspect)) and attach a sreen capture of the inspector window?
 
John

Sebastian Heidbrink

unread,
Oct 29, 2011, 2:24:10 PM10/29/11
to va-sma...@googlegroups.com
Hi John,

I just exported a Pharo port from one of my manager.dat's to the new
mgr85.dat.

Loading the application failed due to an exception in
Behavior>>#variableAssociationAt: varName using: systemDictionary
ifAbsent: absentBlock
varName was an ESAtom (coming from the Pragma) which doen't understand
asPoolKey and asClassPoolKey.

talking about superclasses. Once I change a superclass, then none of the
Pragmas in the sub classes methods can be found any more.
I need to edit those methods and save them to have a proper behavior again.

Hope this helps a little.

Sebastian

> --
> You received this message because you are subscribed to the Google
> Groups "VA Smalltalk" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/va-smalltalk/-/W0DD4ULOnWMJ.

Jan van de Sandt

unread,
Oct 31, 2011, 5:41:36 AM10/31/11
to va-sma...@googlegroups.com
Hello,

On Sat, Oct 29, 2011 at 8:06 PM, John O'Keefe <john_...@instantiations.com> wrote:
Jan -
 
I am having difficulty reproducing your problems.
 
1) For changing the superclass of a class containing a pragma, is it any change to the superclass or only some specific change? Can you capure the walkback and attach it?
 
Steps to reproduce:
1: Define ClassA, a subclass of Object
2. Define ClassB, a subclass of ClassA
3: Add a method with a pragma to ClassB
4: Change the superclass of ClassB to Object
5: A debugger appears, see attached text file.
 
 
2) For losing the pragma on loading an application, can you inspect one of the methods containing a pragma before you recompile it (i.e., (AClass>>#aMethodWithPragma) inspect)) and attach a sreen capture of the inspector window?
Ok
 
 
John

pragma-superclasschange-stack.txt
method-with-pragma.PNG

John O'Keefe

unread,
Oct 31, 2011, 3:56:46 PM10/31/11
to va-sma...@googlegroups.com
Jan -
 
Thanks, that helps.  When you originally said 'change the superclass of a class that contains one or more Pragma definitions', I thought you meant edit the superclass in some way, but now I see that you meant switch to a different superclass.
 
John

John O'Keefe

unread,
Nov 1, 2011, 2:07:27 PM11/1/11
to va-sma...@googlegroups.com
Jan -
 
The attached filein should fix the problem of changing the superclass of a class whose methods containing pragmas.
 
Let me know if it works for you.
 
Regards,  John
rebindVariablesInusing.st

John O'Keefe

unread,
Nov 1, 2011, 2:16:07 PM11/1/11
to va-sma...@googlegroups.com
I've opened Case 48936 for the problem of 'Walkback when changing the superclass of a class containing Pragma definitions'.

Jan van de Sandt

unread,
Nov 2, 2011, 4:47:46 AM11/2/11
to va-sma...@googlegroups.com
Hello John,

Yes, this filein solves the superclass issue.

Regards,
Jan.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/xcxyJE6vRvcJ.

John O'Keefe

unread,
Nov 2, 2011, 6:10:45 PM11/2/11
to va-sma...@googlegroups.com
Sebastian -

I posted a filein for Jan to fix his "walkback when changing superclass of a
class that defines a Pragma". This filein *should* fix both you application
load problem and your missing Pragmas problem. Please let me know if it
does.

John

--
View this message in context: http://forum.world.st/Serious-problems-with-Pragma-s-tp3932732p3983470.html
Sent from the Instantiations mailing list archive at Nabble.com.

Jan van de Sandt

unread,
Nov 3, 2011, 6:30:30 AM11/3/11
to va-sma...@googlegroups.com
Hello John,

Your fix solved the "walkback when changing superclass ..." problem. But NOT the load problem. When I load an application with Pragma's, the pragma information is still not found. Only after changing the method(s) the Pragma information reappears.

Jan.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.

John O'Keefe

unread,
Nov 9, 2011, 12:05:32 PM11/9/11
to va-sma...@googlegroups.com
Sebastian -
 
I'm having trouble reproducing you Pragma filein problem.  I have created a class with one instance method:
 
 foo
   <bar>
   ^ self
 
I file the class out, delete the class from the image, and file the class back in.  Inspecting the CompiledMethod shows that the proper Pragma is there.
 
Perhaps the test needs to be more complex? Can you post a testcase that demonstrates the failure?
 
Thanks,  John

Sebastian Heidbrink

unread,
Nov 9, 2011, 12:15:54 PM11/9/11
to va-sma...@googlegroups.com
Hi John,

I planned to check out your fix tomorrow and I'll try to find the Pharo
export file, I had trouble with.
I'll send it to you directly.

I'm sorry that my feedback takes that long this time.

Sebastian

> --
> You received this message because you are subscribed to the Google
> Groups "VA Smalltalk" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/va-smalltalk/-/2qIcra7hIu0J.

SebastianHC

unread,
Nov 10, 2011, 7:14:15 PM11/10/11
to va-sma...@googlegroups.com
Hi John,

I just tested the filein you provided.

In my case it works, regardings the superclass "changing",too.

Thanks a lot!
Sebastian


--
View this message in context: http://forum.world.st/Serious-problems-with-Pragma-s-tp3932732p4029992.html

John O'Keefe

unread,
Dec 20, 2011, 4:34:45 PM12/20/11
to va-sma...@googlegroups.com

On Monday, October 24, 2011 6:47:49 AM UTC-4, Jan van de Sandt wrote:
  • When you load an application wich contains Pragma definitions into a new image the Pragma information is not found. The Pragma>>allNamed... methods all return an empty collection. After recompiling a method the Pragma information is available again.
I have sent a patch for this problem to Jan -- once he verifies that it works in his environment, I will post the patch here.
 
John

John O'Keefe

unread,
Dec 20, 2011, 4:37:31 PM12/20/11
to va-sma...@googlegroups.com
This problem has the same root cause as:
  • When you load an application wich contains Pragma definitions into a new image the Pragma information is not found. The Pragma>>allNamed... methods all return an empty collection. After recompiling a method the Pragma information is available again.
I have just sent Jan a patch and I'm awaiting his validation of the patch before I post it here.
 
John

John O'Keefe

unread,
Jan 5, 2012, 9:58:55 AM1/5/12
to va-sma...@googlegroups.com
This was an interesting problem to track down and the answer ended up not being in the packager at all.

The attached zip file contains 3 fileins. The effect of applying the fileins is to change the way Pragmas are stored in CompiledMethods. 

The old way of handling Pragmas was to store an Association (##EsPragmas -> #( pragma1 pragma2 etc. ) as a literal in the CompiledMethod. This caused problems both with storing the method in the manager (the Association was always ##EsPragmas -> (nil) when a method with Pragmas was retrieved from the manager!!) and with packaging. The Association was not really needed -- there is a flag on the CompiledMethod that serves the same purpose (see CompiledMethod>>#hasPragmas) -- it was a leftover from our early experimental Pragma implementation (before there was a flag on CompiledMethod).

The change is to never create the Association, but simply store the Array containing the Pragmas as the last literal. The code that retrieves Pragmas (see CompiledMethod>>#pragmas) will handle an Association if it finds one, but since Associations are no longer being created and any methods with Pragmas that is stored in the manager has nil for its stored Pragmas, this is just a bit of a safety net that will probably never get exercised except in my testcases.
 
Fix will be in V8.5.1.
 
John
case48916.zip
Reply all
Reply to author
Forward
0 new messages