Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002149 [Squeak] System major always 11-02-05 10:37 11-03-05 20:20
Reporter renggli View Status public  
Assigned To
Priority normal Resolution open Platform
Status new   OS
Projection none   OS Version
ETA none Fixed in Version Product Version 3.7
  Product Build all versions of squeak
Summary 0002149: Accessing source-code is not thread-save
Description If two processes concurrently access the source code of a method they might get an invalid string that cannot be compiled. This leads to a wide range of different bugs, the one most often visible is a syntax that pops up within the image (see attached screen-shot). This is especially annoying if Squeak is used within a server environment.
Steps To Reproduce See attached test.
Additional Information
Attached Files  syntax-error.png [^] (7,785 bytes) 11-02-05 10:37
 SourceCodeAccessTest.st [^] (1,491 bytes) 11-02-05 11:01

- Relationships

- Notes
(0003021 - 450 - 450 - 450 - 450 - 450 - 450)
renggli
11-02-05 11:26

Ahh, I just happened to experience another prove of this particular problem: When having the process-browser open, auto update turned on, and having selected a particular process, this bug is observable again: browse around within your image, if you are 'lucky' you can see the code-browser actually load a incomplete method OR (what is more likely) the process browser will show a syntax-error morph as stated above when trying to display the stack.
 
(0003022 - 734 - 758 - 758 - 758 - 758 - 758)
tim
11-02-05 19:11

This isn't particularly related to source code though; more a general problem with the whole file accessing system. Unfortunately, Squeak uses one primitive to position the 'current pointer' for an open file and another to read x bytes from the current pointer. Obviously if multiple threads are working on the same file there is a reasonable chance that at some time the position and read/write will interleave and screw up your day.

The same problem is there in many low level OS libraries - Squeak just copied the model in the ANSI C stdio.h standard. I always did think it was pretty stupid. A read/write(file, pos, numbytes) is much safer.

It's one of the things that needs to be tackled by the File Team. Yet another....
 
(0003023 - 248 - 333 - 333 - 333 - 333 - 333)
tim
11-02-05 19:11

From Craig (latta@netjam.org)

    Tim writes:

> A read/write(file, pos, numbytes) is much safer.

    The filesystem support in Flow[1] does this, for example. Flow provides a complete replacement for the current filesystem framework, by the way.
 
(0003026 - 88 - 88 - 88 - 88 - 88 - 88)
sam
11-03-05 20:20

On platforms where mmap() is available, it would be easy to implement such a method set.
 

- Issue History
Date Modified Username Field Change
11-02-05 10:37 renggli New Issue
11-02-05 10:37 renggli File Added: syntax-error.png
11-02-05 10:53 renggli Issue Monitored: renggli
11-02-05 11:01 renggli File Added: SourceCodeAccessTest.st
11-02-05 11:26 renggli Note Added: 0003021
11-02-05 19:11 tim Note Added: 0003022
11-02-05 19:11 tim Note Added: 0003023
11-03-05 20:20 sam Note Added: 0003026
12-10-05 15:32 pmm Issue Monitored: pmm


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
54 total queries executed.
35 unique queries executed.
Powered by Mantis Bugtracker