Branch: refs/heads/Cog
Home: https://github.com/OpenSmalltalk/opensmalltalk-vm
Commit: ac49591e3c3a2f30c5492023c992d9ef75105872
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/ac49591e3c3a2f30c5…
Author: Nicolas Cellier <nicolas.cellier.aka.nice(a)gmail.com>
Date: 2017-05-25 (Thu, 25 May 2017)
Changed paths:
M platforms/Cross/plugins/FilePlugin/FilePlugin.h
M platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c
Log Message:
-----------
Cosmetic changes
- unify style: char* x -> char *x
- rename misleading sqFileNameIndex -> sqFileName
- rename oldName -> sqOldName because we have to distinguish squeak names and c names
- remove dead code #if 0
- call setFile with NULL rather than 0 to avoid making a pointer from integer warning
Commit: c1db1eb40b73373b4e4fe6541cda74c8c742edc7
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/c1db1eb40b73373b4e…
Author: Nicolas Cellier <nicolas.cellier.aka.nice(a)gmail.com>
Date: 2017-05-25 (Thu, 25 May 2017)
Changed paths:
M platforms/Cross/plugins/FilePlugin/FilePlugin.h
M platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c
M platforms/win32/plugins/FilePlugin/sqWin32FilePrims.c
Log Message:
-----------
Fix possible race condition in unix FilePlugin sqFileOpen
>From original post of Monty
http://forum.world.st/Please-review-and-merge-A-commit-to-fix-race-conditio…
This commit fixes race conditions in sqFilePluginBasicPrims.c's sqFileOpen() and adds sqFileOpenNew() to support a new primitive to open only new files for IO atomically using open() with O_CREAT|O_EXCL and the equivalent on Windows, failing if they already exist. This will hopefully eventually replace any in-image code that tests for a file's existence before opening it for writing and creation/truncation, a classic race condition.
sqFileOpen() issues:
Look at the current implementation. It tries fopen() with "r+b", reading/writing of an existing file, then if that fails, with "w+b", reading/writing of a new or truncated file. If the file is created and modified elsewhere between the first and second fopen(), you get unintentional truncation with potential data loss. There's also a minor race condition involving the setting of Mac file characteristics. The fix is replacing use of fopen() with the more general sys call open() and fdopen() after and proper error checking throughout.
Commit: 64a159ba324702316c4c74961118061a9e4fffed
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/64a159ba324702316c…
Author: Nicolas Cellier <nicolas.cellier.aka.nice(a)gmail.com>
Date: 2017-05-26 (Fri, 26 May 2017)
Changed paths:
M platforms/Cross/plugins/FilePlugin/FilePlugin.h
M platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c
M platforms/win32/plugins/FilePlugin/sqWin32FilePrims.c
Log Message:
-----------
Merge pull request #140 from OpenSmalltalk/monty_fix_fopen_race
Monty fix fopen race
Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/f1dfe3c34335...64…
Nicolas Cellier uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2221.mcz
==================== Summary ====================
Name: VMMaker.oscog-nice.2221
Author: nice
Time: 26 May 2017, 11:43:00.704119 am
UUID: 4f7ecc89-b477-43bf-b794-d7c39e4fcbd0
Ancestors: VMMaker.oscog-nice.2220
Fix the method for getting the stack pointer in Win64 ABI.
The generated ceCaptureCStackPointers must account for the 32 bytes reserved for saving the 4 register parameters which are allocated whatever the real number of parameters.
=============== Diff against VMMaker.oscog-nice.2220 ===============
Item was changed:
----- Method: CogX64Compiler>>leafCallStackPointerDelta (in category 'abi') -----
leafCallStackPointerDelta
"Answer the delta from the stack pointer after a call to the stack pointer
immediately prior to the call. This is used to compute the stack pointer
immediately prior to call from within a leaf routine, which in turn is used
+ to capture the c stack pointer to use in trampolines back into the C run-time.
+ In Win64 ABI, also count the stack reserved for saving 4 register arguments."
+ ^SysV
+ ifTrue: [8]
+ ifFalse: [8 + 32]!
- to capture the c stack pointer to use in trampolines back into the C run-time."
- ^8!
Hi Folks,
Satellogic was featured today at Nature News!
http://www.nature.com/news/earth-observing-companies-push-for-more-advanced…
I helped design and build the hyperspectral cameras in our satellites
Fresco and Batata. And I wrote the geometric and spectral processing
software for that image. This is not completely off topic, though: The
geometric software (image rectification and correction), the most
complex part of the processing, was written by me in Cuis Smalltalk, and
runs in a Cuis Smalltalk + OpenCL application.
Please share my joy today!
--
Juan Vuletich
www.cuis-smalltalk.orghttps://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
@JuanVuletich
Branch: refs/heads/monty_fix_fopen_race
Home: https://github.com/OpenSmalltalk/opensmalltalk-vm
Commit: ac49591e3c3a2f30c5492023c992d9ef75105872
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/ac49591e3c3a2f30c5…
Author: Nicolas Cellier <nicolas.cellier.aka.nice(a)gmail.com>
Date: 2017-05-25 (Thu, 25 May 2017)
Changed paths:
M platforms/Cross/plugins/FilePlugin/FilePlugin.h
M platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c
Log Message:
-----------
Cosmetic changes
- unify style: char* x -> char *x
- rename misleading sqFileNameIndex -> sqFileName
- rename oldName -> sqOldName because we have to distinguish squeak names and c names
- remove dead code #if 0
- call setFile with NULL rather than 0 to avoid making a pointer from integer warning
Commit: c1db1eb40b73373b4e4fe6541cda74c8c742edc7
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/c1db1eb40b73373b4e…
Author: Nicolas Cellier <nicolas.cellier.aka.nice(a)gmail.com>
Date: 2017-05-25 (Thu, 25 May 2017)
Changed paths:
M platforms/Cross/plugins/FilePlugin/FilePlugin.h
M platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c
M platforms/win32/plugins/FilePlugin/sqWin32FilePrims.c
Log Message:
-----------
Fix possible race condition in unix FilePlugin sqFileOpen
>From original post of Monty
http://forum.world.st/Please-review-and-merge-A-commit-to-fix-race-conditio…
This commit fixes race conditions in sqFilePluginBasicPrims.c's sqFileOpen() and adds sqFileOpenNew() to support a new primitive to open only new files for IO atomically using open() with O_CREAT|O_EXCL and the equivalent on Windows, failing if they already exist. This will hopefully eventually replace any in-image code that tests for a file's existence before opening it for writing and creation/truncation, a classic race condition.
sqFileOpen() issues:
Look at the current implementation. It tries fopen() with "r+b", reading/writing of an existing file, then if that fails, with "w+b", reading/writing of a new or truncated file. If the file is created and modified elsewhere between the first and second fopen(), you get unintentional truncation with potential data loss. There's also a minor race condition involving the setting of Mac file characteristics. The fix is replacing use of fopen() with the more general sys call open() and fdopen() after and proper error checking throughout.
Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/ac49591e3c3a^...c…
Nicolas Cellier uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2220.mcz
==================== Summary ====================
Name: VMMaker.oscog-nice.2220
Author: nice
Time: 24 May 2017, 7:19:44.72644 pm
UUID: 7e5591ac-8f9a-4828-81ba-247f3457ce4f
Ancestors: VMMaker.oscog-cb.2219
Fix display pixel reversal (for debug).
Modern implementation of displayBits is (void *).
We can't calculate an offset (dispalyBits + n) because we don't know the size of void! At least it fails on MSVC compiler.
So it's necessary to convert it to char *, int *, or just sqInt.
While at it, as calculated, the range is a pixel range (assumed on the first display line) not a word range, but this range will be rounded to a whole word boundary.
The formulation now explicitely uses word indices, not word indices disguised in byte offsets.
It should avoid bad alignment cases where word(byte)StartIndex could eventually not be a proper multiple of 4.
It should also now work for any depth.
It might overflow for a pixel range highBit > 26 if sqInt were only 32 bits, that is over 64 million pixel width, but since our screens are not yet that wide, and will never be that wide in a 32 bits addressable space, we're safe.
=============== Diff against VMMaker.oscog-cb.2219 ===============
Item was changed:
----- Method: StackInterpreter>>reverseDisplayFrom:to: (in category 'I/O primitive support') -----
reverseDisplayFrom: startIndex to: endIndex
+ "Reverse the given range of Display pixels, rounded to whole word boundary.
+ Used to give feedback during VM activities such as garbage collection when debugging.
- "Reverse the given range of Display words (at different bit depths, this will reverse different numbers
- of pixels). Used to give feedback during VM activities such as garbage collection when debugging.
It is assumed that the given word range falls entirely within the first line of the Display."
+
| wordStartIndex wordEndIndex primFailCodeValue |
(displayBits = 0 or: [(objectMemory isImmediate: displayBits asInteger) or: [displayDepth = 0]]) ifTrue: [^nil].
+ wordStartIndex := (startIndex max: 0) * displayDepth // 32.
+ wordEndIndex := (endIndex min: displayWidth) * displayDepth // 32.
+ wordStartIndex * 4 to: wordEndIndex * 4 do:
+ [:byteOffset | | reversed |
+ reversed := (objectMemory long32At: displayBits asInteger + byteOffset) bitXor: 16rFFFFFFFF.
+ objectMemory long32At: displayBits asInteger + byteOffset put: reversed].
- wordStartIndex := startIndex * (displayDepth // 8).
- wordEndIndex := endIndex * (displayDepth // 8) min: displayWidth * (displayDepth // 8).
- displayBits + wordStartIndex to: displayBits + wordEndIndex by: 4 do:
- [:ptr | | reversed |
- reversed := (objectMemory long32At: ptr) bitXor: 16rFFFFFFFF.
- objectMemory long32At: ptr put: reversed].
primFailCodeValue := primFailCode.
self initPrimCall.
self updateDisplayLeft: 0 Top: 0 Right: displayWidth Bottom: 1.
self ioForceDisplayUpdate.
primFailCode := primFailCodeValue!
Branch: refs/heads/Cog
Home: https://github.com/OpenSmalltalk/opensmalltalk-vm
Commit: 24bea92739c825b642bf8dc60690ef48df23503d
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/24bea92739c825b642…
Author: Nicolas Cellier <nicolas.cellier.aka.nice(a)gmail.com>
Date: 2017-05-23 (Tue, 23 May 2017)
Changed paths:
M platforms/win32/plugins/SoundPlugin/sqWin32Sound.c
Log Message:
-----------
Fix compilation of SoundPlugin on Windows
interpreterProxy must be defined before used!
Commit: 235b21415025322f336f2df59addc4fb9c804869
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/235b21415025322f33…
Author: Nicolas Cellier <nicolas.cellier.aka.nice(a)gmail.com>
Date: 2017-05-23 (Tue, 23 May 2017)
Changed paths:
M platforms/win32/plugins/SoundPlugin/sqWin32Sound.c
Log Message:
-----------
Fix compilation warning void function returning a value
Commit: 9c10bf5278167f890d04a06bcfe49981ef17d7db
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/9c10bf5278167f890d…
Author: Nicolas Cellier <nicolas.cellier.aka.nice(a)gmail.com>
Date: 2017-05-23 (Tue, 23 May 2017)
Changed paths:
M platforms/win32/plugins/SocketPlugin/sqWin32NewNet.c
Log Message:
-----------
Fix getsockopt for MSVC
the len parameter must be a socket_len because it is a size_t on linux/cygwin (thus 64 bits) and int on MSVC (thus 32 bits)
Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/fb29a2325113...9c…
On 5/23/17, Hari Balaraman via Cuis-dev <cuis-dev(a)cuis-smalltalk.org> wrote:
> Congratulations ! Go Juan!
+1
Hannes
> Hari
>
>> On May 23, 2017, at 11:47 AM, Juan Vuletich via Cuis-dev
>> <cuis-dev(a)cuis-smalltalk.org> wrote:
>>
>> Hi Folks,
>>
>> Satellogic was featured today at Nature News!
>> http://www.nature.com/news/earth-observing-companies-push-for-more-advanced…
>>
>> I helped design and build the hyperspectral cameras in our satellites
>> Fresco and Batata. And I wrote the geometric and spectral processing
>> software for that image. This is not completely off topic, though: The
>> geometric software (image rectification and correction), the most complex
>> part of the processing, was written by me in Cuis Smalltalk, and runs in a
>> Cuis Smalltalk + OpenCL application.
>>
>> Please share my joy today!
>>
>> --
>> Juan Vuletich
>> www.cuis-smalltalk.org
>> https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
>> @JuanVuletich
>>
>>
>>
>> _______________________________________________
>> Cuis-dev mailing list
>> Cuis-dev(a)cuis-smalltalk.org
>> http://cuis-smalltalk.org/mailman/listinfo/cuis-dev_cuis-smalltalk.org
>
> _______________________________________________
> Cuis-dev mailing list
> Cuis-dev(a)cuis-smalltalk.org
> http://cuis-smalltalk.org/mailman/listinfo/cuis-dev_cuis-smalltalk.org
>