Category: Squeak Internals

  • Recovering from Frozen Images in Squeak

    Recovering from Frozen Images in Squeak

    When developing complex systems, encountering errors that leave your project in a frozen state can bring much sadness and consternation. For developers working with Squeak/Smalltalk, a frozen image refers to a situation where the system becomes unresponsive. This can happen due to various issues, including deadlocks, infinite loops, or recursive operations in Smalltalk code, which can cause the VM to freeze, hang, or lock up.

    A recent discussion in the Squeak community highlighted how one such incident, caused by a stuck semaphore during an image load, turned into an opportunity for both recovery and valuable practices in safeguarding against future mishaps. You can explore the full conversation in the Squeak-dev mailing list thread (here).

    The Problem: Semaphore Deadlock in the Image File

    In this case, a developer encountered an issue while attempting to draw in multiple background threads, using a chain of semaphores to manage the UI thread. After resolving an error in one of the background threads, the drawing process was resumed. However, it was found that the image would fail to load. Instead of opening, the image became unresponsive and effectively “frozen.” It had likely become stuck due to a semaphore waiting for a signal that would never come. This left the image unresponsive and effectively unusable – or so it would have seemed.

    Recovery Options: DoItFirst and Debugging

    The good news is that there are several options available for recovering from such failures.

    For developers dealing with frozen images at startup, Squeak provides a mechanism called DoItFirst. This is a class that is processed at the very beginning of the image startup sequence, allowing developers to inject custom code or actions before the main system fully loads. By using command-line arguments like --debug, it is possible to force the image to enter the debugger at the earliest point in the startup process, allowing issues to be diagnosed and fixed before the image fully loads.

    Additionally, for situations where the issue is well-understood, the --doit option allows Smalltalk expressions to be passed and executed before any problematic behavior occurs, giving developers a chance to resolve issues before they impact the image during loading.

    Another option is to open the Virtual Machine (VM) in a debugger. In the specific case of a stuck semaphore, you can set a breakpoint in interpret. Run the VM until it reaches interpret a second time (the first invocation does some initialization). At this point, you can use printAllProcesses to locate the stuck process. This should display the semaphore the process is waiting on. Once identified, you can invoke synchronousSignal with that semaphore to unstick it and restore functionality without losing significant progress. While this technique can specifically handle a stuck semaphore, it could also be helpful for other cases of system hangs or unresponsiveness.

    The Importance of Backups and Versioning

    While debugging and recovery tools are invaluable, it is clear that prevention is equally important. Routine backups and effective versioning are essential practices that can mitigate the risks associated with frozen images and other failures. One practice that proved helpful in this case was maintaining regular system backups, which made it possible to quickly restore a previous version of the image with minimal data loss. However, more granular versioning, especially in environments with frequent risky changes, would provide an additional layer of safety.

    Specifically, incremental versioning of the image can be a lifesaver when things go wrong. By saving a new version of the image each time a meaningful step in development is reached, developers can create a clear history of their work. This allows them to revert to earlier versions of the image if issues arise, minimizing the impact of failed changes and speeding up the recovery process. Incremental image saves help ensure that even if an image becomes frozen or corrupted, a previous, stable version can be restored with minimal effort.

    The Robustness of Squeak: Multiple Recovery Options

    One of the key takeaways from this experience is how robust Squeak is in terms of recovery options. Even when a frozen image occurs or the system becomes unresponsive, Squeak offers multiple layers of recovery mechanisms. Whether using DoItFirst to inject custom code during startup or interacting with the VM through a debugger to manually resolve issues with semaphores, there are a variety of ways to recover from errors and get back on track.

    Additionally, Squeak’s development environment is designed to be highly flexible, encouraging experimentation while ensuring that recovery is always possible. One of the key advantages of Squeak is that all the code executed or saved during development is stored in the .changes file. This makes it possible to recover from almost any issue, as the system is built to retain all your code. Even if an image becomes frozen or corrupted, the code itself is never truly lost. With the resources mentioned in this article, developers can restore their environment and continue their work. In Squeak, code is safe; no matter what happens to the image, your code can always be recovered.

    Conclusion

    In conclusion, while Squeak’s development environment offers tools to recover from serious errors, the most effective defense is good preventive practice: maintain regular backups, version your work consistently, and always be mindful of the unexpected.

    For more detailed information on using DoItFirst to debug and recover your Squeak image, visit the DoItFirst Swiki page (here). If you encounter issues like crashes or freezes in Squeak, there are various levels of potential failure to consider, and helpful guidance is available in the What to do if Squeak crashes or freezes resource (here), which offers insight into diagnosing and resolving different types of system freezes or crashes.

    Have a great time with Smalltalk and keep on Squeaking!

  • Squeak Turns 20!

    Please Donate to Squeak!

    Craig Latta writes:

    Hi all–

    Happy 20th birthday to us! It was twenty years ago that Dan Ingalls and the rest of Alan Kay’s team announced Squeak to the world. You really changed things with this run at the fence. 🙂  Thanks again!

     

     


    Back to the Future

    The Story of Squeak, A Practical Smalltalk Written in Itself

    by

    Dan Ingalls Ted Kaehler John Maloney Scott Wallace Alan Kay

     

     

  • Spur Memory Manager Object Format Explained

    spur_gear

     

    Clément Béra just posted an excellent article explaining the new Spur Object format.  Definitely worth a read!

    Eliot Miranda has also mentioned that Spur is coming to life in Newspeak as we speak and then Squeak 5.0.

    Find out more about the Squeak VM called Cog and the new memory manager called Spur at Eliot’s Cog Blog.

  • Dynamic Languages Symposium (DLS) 2008 – Call For Papers

    Cern

    Call For Papers

    *** Dynamic Languages Symposium (DLS) 2008 ***

    July 8, 2008 (Tuesday)

    Co-located with ECOOP 2008, Paphos, Cyprus

    Sponsored by ACM SIGPLAN

    http://www.swa.hpi.uni-potsdam.de/dls/dls08/

    ——————————-
    IMPORTANT DATES
    ——————————-
    Submission deadline: April 25, 2008 (hard deadline) Author notification: May 23, 2008 Camera-ready copy due: June 6, 2008 DLS 2008: July 8, 2008

    ——————————-
    ABOUT DLS
    ——————————-
    The Dynamic Languages Symposium (DLS) at ECOOP 2008 in Paphos, Cyprus, is a forum for discussion of dynamic languages, their implementation and application. While mature dynamic languages including Smalltalk, Lisp, Scheme, Self, Prolog, and APL continue to grow and inspire new converts, a new generation of dynamic scripting languages such as Python, Ruby, PHP, Tcl, and JavaScript are successful in a wide range of applications.

    DLS provides a place for researchers and practitioners to come together and share their knowledge, experience, and ideas for future research and development.

    DLS 2008 invites high quality papers reporting original research, innovative contributions or experience related to dynamic languages, their implementation and application. Accepted Papers will be published in the ACM Digital Library.

    ——————————-
    TOPICS OF INTEREST
    ——————————-
    Areas of interest include but are not limited to:

    – Innovative language features and implementation techniques
    – Development and platform support, tools
    – Interesting applications
    – Domain-oriented programming
    – Very late binding, dynamic composition, and runtime adaptation
    – Reflection and meta-programming
    – Software evolution
    – Language symbiosis and multi-paradigm languages
    – Dynamic optimization
    – Hardware support
    – Experience reports and case studies
    – Educational approaches and perspectives
    – Object-oriented, aspect-oriented, and context-oriented programming

    ——————————-
    SUBMISSION GUIDELINES
    ——————————-
    We invite original contributions that neither have been published previously nor are under review by other refereed events or publications. Research papers should describe work that advances the current state of the art. Experience papers should be of broad interest and should describe insights gained from substantive practical applications. The program committee will evaluate each contributed paper based on its relevance, significance, clarity, and originality.

    Papers are to be submitted electronically at http://www.swa.hpi.uni-potsdam.de/dls/dls08/ in PDF format. Submissions must not exceed 12 pages and need to use the ACM format, templates for which can be found at http://www.acm.org/sigs/pubs/proceed/template.html.

    ——————————-
    PROCEEDINGS
    ——————————-
    Accepted Papers will be published in the ACM Digital Library.

    ——————————-
    PROGRAM COMMITTEE
    ——————————-

    Chair: Johan Brichau (Université catholique de Louvain, Belgium)

    Joe Armstrong (Ericsson AB, Sweden) Pierre Cointe (École des Mines de Nantes, France)William R. Cook (University of Texas at Austin, USA) Pascal Costanza (Vrije Universiteit Brussel, Belgium) Wolfgang De Meuter (Vrije Universiteit Brussel, Belgium) Maja D’Hondt (IMEC, Belgium) Robert Hirschfeld (Hasso-Plattner InstitĂĽt, Germany) Roberto Ierusalimschy (PUC-Rio, Brazil) Andy Kellens (Vrije Universiteit Brussel, Belgium) Michele Lanza (University of Lugano, Switzerland) Michael Leuschel (University of DĂĽsseldorf, Germany) Oscar Nierstrasz (University of Berne, Switzerland) Kent Pitman (PTC, USA) Lynne Shaw (CheckFree Investment Services, USA) David Ungar (Sun Microsystems, USA) Peter Van Roy (UniversitĂ© catholique de Louvain, Belgium) Martin von Löwis (Hasso-Plattner InstitĂĽt, Germany) Daniel Weinreb (ITA Software, USA)

  • Self-Sustaining Systems *Call for Papers*

    s3
    Workshop on Self-sustaining Systems (S3) 2008
    May 15-16, 2008
    Potsdam, Germany
    http://www.swa.hpi.uni-potsdam.de/s3/

    Call for papers:

    The Workshop on Self-sustaining Systems (S3) is a forum for discussion of topics relating to computer systems and languages that are able to bootstrap, implement, modify, and maintain themselves. One property of these systems is that their implementation is based on small but powerful abstractions; examples include (amongst others) Squeak/Smalltalk, COLA, Klein/Self, PyPy/Python, Rubinius/Ruby, and Lisp. Such systems are the engines of their own replacement, giving researchers and developers great power to experiment with, and explore future directions from within, their own small language kernels.

    S3 will be take place May 15-16, 2008 at the Hasso-Plattner-Institute in Potsdam, Germany. It is an exciting opportunity for researchers and practitioners interested in self-sustaining systems to meet and share their knowledge, experience, and ideas for future research and development.

    — Invited talk:

    Ian Piumarta: Late-bound Object Lambda Architectures (Viewpoints Research Institute, USA)

    — Submissions and proceedings:

    S3 invites submissions of high-quality papers reporting original research, or describing innovative contributions to, or experience with, self-sustaining systems, their implementation, and their application. Papers that depart significantly from established ideas and practices are particularly welcome.

    Submissions must not have been published previously and must not be under review for any another refereed event or publication. The program committee will evaluate each contributed paper based on its relevance, significance, clarity, and originality. Revised papers will be published as post-proceedings in the Springer LNCS series.

    Papers should be submitted electronically via EasyChair at
    http://www.easychair.org/conferences/?conf=s3 in PDF format.
    Submissions must be written in English (the official language of the
    workshop) and must not exceed 20 pages. They should use the LNCS format, templates for which are available at http://www.springer.de/comp/lncs/authors.html.

    — Venue:

    Hasso-Plattner-Institut (Potsdam, Germany)

    — Important dates:

    Submission of papers: February 15, 2008
    Author notification: April 11, 2008
    Revised papers due: April 25, 2008

    S3 workshop: May 15-16, 2008

    Final papers for LNCS post-proceedings due: June 6, 2008

    — Chairs:

    * Robert Hirschfeld (Hasso-Plattner-Institut Potsdam, Germany)
    * Kim Rose (Viewpoints Research Institute, USA)

    — Program committee:

    * Johan Brichau, Universite Catholique de Louvain, Belgium
    * Pascal Costanza, Vrije Universiteit Brussel, Belgium
    * Wolfgang De Meuter, Vrije Universiteit Brussel, Belgium
    * Stephane Ducasse, INRIA Lille, France
    * Michael Haupt, Hasso-Plattner-Institut, Germany
    * Robert Hirschfeld, Hasso-Plattner-Institut, Germany
    * Dan Ingalls, Sun Microsystems Laboratories, USA
    * Martin von Lšwis, Hasso-Plattner-Institut, Germany
    * Hidehiko Masuhara, University of Tokyo, Japan
    * Ian Piumarta, Viewpoints Research Institute, USA
    * David Ungar, IBM, USA

    — Registration fees:

    Early (until April 18, 2008)
    * Regular participants: EUR 160
    * Students: EUR 80

    Late (after April 18, 2008)
    * Regular participants: EUR 170
    * Students: EUR 90

  • To Pipe Or Not To Pipe

    The squeak-dev mailing list is currently fired up with a debate that will be of great interest for students of the theory of language design – and for students of the politics of language design!

    It started with a question by Fabio Filasieno wondering why Squeak doesn’t have a “pipe” construct to the language to allow the result of a message-send to be the recipient of the next message, thus removing the need for parentheses, so

    ((1 to: 100) select: [ :each | each odd ] ) sum.

    becomes

    1 to: 100 | select: [ :each | each odd ] | sum.

    The debate has continued for days, including topics such as:

    Is piping the right term?
    What characters could be used without confusion?
    Should a proliferation of parentheses should be seen as a ‘code smell’, so the algorithm is the thing to fix, rather than the syntax?
    Why not just use an “asPipe” message which would alter the operation of the cascades to give this without changing the language?
    Is the benefit of this change enough to make it worth changing the syntax of Smalltalk?
    Do languages that don’t change stagnate?
    Was the brace syntax a step too far?
    What’s the EBNF for Smalltalk? (This got a definitive answer [for 2.7])
    What are the differences between Smalltalk, Lisp and Perl approaches (with Randal Schwartz revealing himself to be a long-time Smalltalker)?

    Alan Kay has also contributed some remarks on the early development of Smalltalk, and possible future directions.

    Follow the discussion:
    Fabio’s original email
    The harvesting thread
    or look for any of the myriad threads with “pipe” in the title.

  • New Squeak UI Enhancements Released

    https://i0.wp.com/farm2.static.flickr.com/1120/1213406097_08eab7697e.jpg

    Gary Chambers released new UI Enhancements for Squeak. You can now access these changes from the Squeak Source Repository or through Package Universes. You can read more by following the following threads here and here. Also check out the new UI team. Our thanks to Gary and the UI Team!!

  • Squeak Tale

    Squeak Tale

    A history of Squeak that is still being written, the following is a Squeak Tale by Göran Krampe.

    Let me tell you a story…

    I was around… when King Dan ruled the Land of the Mice, his court the “SqC” was strong and the stream was flowing smoothly. It was a glorious and joyous time and I were there to see sir PWS, sir Comanche and princess Swiki being born as children of Socket. The wizard Morphic was still young and agile at that time…

    Things were well, but not everyone were happy in the Land of the Mice – the population grew quickly and only the fortunate ones to enter the castle Image could have their fields fully prosper and not wither and die in the harsh outbacks of the Internet. (more…)

  • Supporting Seaside, OR Mapping vs. OODBMS

    Seaside

    Cincom recently reiterated their support for Seaside. Not long ago Gemstone announced something similar. What will these two commercial companies lend to Seaside?

    It is certainly true that Seaside will benefit from additional resources. Resources devoted to documentation, compatibility, and testing will help the community. Working on new solutions for persistence is a great idea, and having different options to solve your persistence requirements can only help developers. (more…)