Hi.
I have encountered reproducible segfault when running my Squeak trunk builds. The segfault occurs with the current latest build (634e4e3) as well as the rather old version used by smalltalkCI (010c20e) on at least macOS 12 and Ubuntu 20.04.
Here's a link to the failing workflow: https://github.com/theseion/Fuel/runs/4036958123?check_suite_focus=true
To reproduce, run the following:
```bash
git clone git@github.com:theseion/fuel.git
git clone git@github.com:hpi-swa/smalltalkCI.git
smalltalkCI/run.sh -s Squeak64-trunk fuel/.tests.ston
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/601
Hi all,
I think this is not a new issue, but I am experiencing it with increasing frequency on my Win 10 machine: When instantiating SqueakSSL, primitiveCreate fails. I don't see an error in the console so I cannot tell more details about the error. Sometimes restarting my image helps, but right now, it does not. Other images running with the same VM (202010232046) can still access the internet via SSL.
Maybe it plays a role that the affected image puts the plugin much more under stress by always holding at least one open connection to a server.
Is this a known problem? Are there any workarounds?
Looking forward to a fix,
Christoph
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/554
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.3097.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.3097
Author: eem
Time: 26 October 2021, 12:58:51.993673 pm
UUID: 811f869f-630c-4d34-9a4b-beb526c9f771
Ancestors: VMMaker.oscog-eem.3096
Spur Slang: improve a couple of comments.
=============== Diff against VMMaker.oscog-eem.3096 ===============
Item was changed:
----- Method: CCodeGenerator>>accessorDepthForMethod: (in category 'spur primitive compilation') -----
accessorDepthForMethod: method "TMethod"
"Compute the depth the method traverses object structure, assuming it is a primitive.
+ This is in support of Spur's lazy become. A primitive may fail in argument validation
+ because it encounters a forwarder. The primitive failure code needs to know to what
+ depth it must follow arguments to find forwarders, so that if any are found, they can
+ be followed and the primitive retried.
- This is in support of Spur's lazy become. A primitive may fail because it may encounter
- a forwarder. The primitive failure code needs to know to what depth it must follow
- arguments to find and forwarders and, if any are found, retry the primitive.
This method determines that depth. It starts by collecting references to the stack and
then follows these through assignments to variables and use of accessor methods
such as fetchPointer:ofObject:. For example
| obj field |
obj := self stackTop.
field := objectMemory fetchPointer: 1 ofObject: obj.
self storePointer: 1 ofObject: field withValue: (self stackValue: 1)
has depth 2, since field is accessed, and field is an element of obj.
The information is cached since it needs to be computed *before* inlining."
^accessorDepthCache
at: method smalltalkSelector
ifAbsentPut:
[beganInlining
ifTrue:
[(method export
or: [vmClass notNil or: [vmClass primitiveTable includes: method smalltalkSelector]])
ifTrue: [-1]
ifFalse: [self error: 'it is too late to compute accessor depths!!']]
ifFalse:
[((method definingClass includesSelector: method smalltalkSelector) ifTrue:
[(method definingClass >> method smalltalkSelector) pragmaAt: #accessorDepth:])
ifNotNil: [:pragma| pragma arguments first]
ifNil:
["Deal with the
primitiveFoo
objectMemory hasSpurMemoryManagerAPI
ifTrue: [self primitiveFooSpur]
ifFalse: [self primitiveFooV3]
cliché"
method extractSpurPrimitiveSelector
ifNotNil:
[:actualSelector| | subMethod |
(subMethod := self methodNamed: actualSelector) ifNil:
[subMethod := self compileToTMethodSelector: actualSelector in: method definingClass].
self accessorDepthForMethod: subMethod]
ifNil: [self accessorDepthForMethod: method interpreterClass: (vmClass ifNil: [StackInterpreter])]]]]!
Item was changed:
----- Method: CCodeGenerator>>accessorDepthForMethod:interpreterClass: (in category 'spur primitive compilation') -----
accessorDepthForMethod: method interpreterClass: interpreterClass
"Answer the maximal length of access paths from arguments through objects, in the method,
+ assuming it is a primitive. This is in support of Spur's lazy become. A primitive may fail in
+ argument validation because it encounters a forwarder. The primitive failure code needs to
+ know to what depth it must follow arguments to find forwarders, so that if any are found,
+ they can be followed and the primitive retried. This method computes that depth.
+ It starts by collecting references to the stack and then follows these through assignments
+ to variables and use of accessor methods such as fetchPointer:ofObject:.
- assuming it is a primitive. This is in support of Spur's lazy become. A primitive may fail because
- it may encounter a forwarder. The primitive failure code needs to know to what depth it must
- follow arguments to follow forwarders and, if any are found and followed, retry the primitive.
- This method determines that depth. It starts by collecting references to the stack and then follows
- these through assignments to variables and use of accessor methods such as fetchPointer:ofObject:.
For example
| obj field |
obj := self stackTop.
field := objectMemory fetchPointer: 1 ofObject: obj.
self storePointer: 1 ofObject: field withValue: (self stackValue: 1)
has depth 2, since field is accessed, and field is an element of obj."
| chains |
chains := self accessorsAndAssignmentsForMethod: method
actuals: (self actualsForMethod: method)
depth: 0
interpreterClass: interpreterClass
into: [:roots :accessors :assignments|
self transitiveClosureOfAccessorChainRoots: roots accessors: accessors assignments: assignments].
"Now compute the maximal length and subtract 1. The depth for a stack access is 0.
The depth of an access to an object taken from the stack is 1, etc. And the depth for no access is -1."
^(chains
inject: 0
into: [:maximumLength :chain| maximumLength max: (self accessorDepthForChain: chain)]) - 1!
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.3096.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.3096
Author: eem
Time: 26 October 2021, 12:49:38.474321 pm
UUID: 0bc94f9b-c941-4df4-976d-2f4cbef41379
Ancestors: VMMaker.oscog-eem.3095
Spur Slang: fix a bug in computing accessor depth chains. If a primitive contains different assignments to the same variable (e.g. a primitive which has different forms for var args such as PSharePlugin>>primitivePostKeyboardEvent as of 10/26/2021) then the simple test would consider an assignment to the same variable as an extension. Fixed with a simple filter, adding the unless: block to the anySatisfy: over expressions.
=============== Diff against VMMaker.oscog-eem.3095 ===============
Item was changed:
----- Method: CCodeGenerator>>transitiveClosureOfAccessorChainRoots:accessors:assignments: (in category 'spur primitive compilation') -----
transitiveClosureOfAccessorChainRoots: roots accessors: accessors assignments: assignments
"Compute the transitive closure of accessor and assignment expressions from the roots.
Start from the stack accesses (the roots)."
| chains chainSets expressions extended extendedChains |
chains := OrderedCollection new.
roots do:
[:root|
chains
addAll: (assignments
select: [:assignment| assignment expression isSameAs: root]
thenCollect: [:assignment| {assignment}]);
addAll: (accessors
select: [:accessor| accessor anySatisfy: [:subnode| subnode isSameAs: root]]
thenCollect: [:accessor| {accessor}])].
chains isEmpty ifTrue:
[^roots collect: [:root| {root}]].
"chainSets are the visited sets for each chain root. For example, in primiitveSpurStringReplace
objectMemory storeByte: i ofObject: array withValue: (objectMemory fetchByte: srcDelta + i ofObject: repl)
is reachable both from
array := self stackValue: 4
and from
repl := self stackValue: 1.
If there is only a single visited set we will compute only one of these paths."
chainSets := Dictionary new.
chains do:
[:tuple| chainSets at: tuple first put: (Set with: tuple first)].
(expressions := Set new)
addAll: accessors;
addAll: assignments.
[extended := false.
extendedChains := OrderedCollection new: chains size * 2.
chains do:
[:chain| | visited |
visited := chainSets at: chain first.
chain last isAssignment
ifTrue: "extend with any and all new references to the variable at the end of the chain."
[| tip |
tip := chain last variable.
+ (expressions select: [:expr|
+ (visited includes: expr) not
+ and: [expr
+ anySatisfy: [:node| tip isSameAs: node]
+ unless: [:node| node isAssignment and: [node variable isSameAs: tip]]]])
- (expressions select: [:expr| (visited includes: expr) not and: [expr anySatisfy: [:node| tip isSameAs: node]]])
ifEmpty: [extendedChains addLast: chain]
ifNotEmpty:
[:refs|
extendedChains addAll: ((visited addAll: refs) collect: [:ref| chain, {ref}]).
extended := true]]
ifFalse:
[extendedChains addLast: chain]].
extended] whileTrue:
[chains := extendedChains].
^extendedChains!
Branch: refs/heads/Cog
Home: https://github.com/OpenSmalltalk/opensmalltalk-vm
Commit: 634e4e3c8556a72d54f43beefc3069c60e594a21
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/634e4e3c8556a72d54…
Author: Eliot Miranda <eliot.miranda(a)gmail.com>
Date: 2021-10-23 (Sat, 23 Oct 2021)
Changed paths:
M src/spur32.cog/cogit.h
M src/spur32.cog/cogitARMv5.c
M src/spur32.cog/cogitIA32.c
M src/spur32.cog/cointerp.c
M src/spur32.cog/cointerp.h
M src/spur32.cog/gcc3x-cointerp.c
M src/spur32.sista/cogit.h
M src/spur32.sista/cogitARMv5.c
M src/spur32.sista/cogitIA32.c
M src/spur32.sista/cointerp.c
M src/spur32.sista/cointerp.h
M src/spur32.sista/gcc3x-cointerp.c
M src/spur64.cog/cogit.h
M src/spur64.cog/cogitARMv8.c
M src/spur64.cog/cogitX64SysV.c
M src/spur64.cog/cogitX64WIN64.c
M src/spur64.cog/cointerp.c
M src/spur64.cog/cointerp.h
M src/spur64.cog/gcc3x-cointerp.c
M src/spur64.sista/cogit.h
M src/spur64.sista/cogitARMv8.c
M src/spur64.sista/cogitX64SysV.c
M src/spur64.sista/cogitX64WIN64.c
M src/spur64.sista/cointerp.c
M src/spur64.sista/cointerp.h
M src/spur64.sista/gcc3x-cointerp.c
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.3095
CoInterpreter: Add ShortIntegerArray/SoundBuffer>>at:[put:] to the set of
primitives run on the Smalltalk stack.
Hi all,
I believe that Cog for Squeak should work on MacOS ARM 64, right?
opensmalltalk-vm/building/macos64ARMv8/squeak.cog.spur at Cog ·
OpenSmalltalk/opensmalltalk-vm (github.com)
[https://github.com/OpenSmalltalk/opensmalltalk-vm/tree/Cog/building/macos64…]
The files seem to be there and have not been changed for a few months.
Has anyone genuflected in the direction of Cupertinio and Apple Park
and bought one?
Does it work?
How well does it work?
Oh and this is just for info, please don't feel like I'm putting
pressure. I just can't test it myself....
Thanks.
bruce
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.3094.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.3094
Author: eem
Time: 18 October 2021, 4:13:04.230908 pm
UUID: 88e65fe6-60c5-46f2-99b1-fa014fde6d7a
Ancestors: VMMaker.oscog-eem.3093
CoInterpreterMT & StackInterpreter must agree on the defs of DisownVMForFFICall & DisownVMForThreading.
=============== Diff against VMMaker.oscog-eem.3093 ===============
Item was changed:
----- Method: CoInterpreterMT class>>initializeSchedulerIndices (in category 'initialization') -----
initializeSchedulerIndices
super initializeSchedulerIndices.
"Class Process"
"The thread id of a process is either nil or a SmallInteger that defines how a process binds to threads.
If nil, the process may run on any thread.
The least significant bit of threadId is a flag. The most significant bits are a threadId.
If the threadId is nil the process can run on any thread.
If the flag (least significant bit) is set then
If the threadId is positive the process can only be run on the thread with that thread Id.
If the threadId is negative the process must not be run on the thread with that thread Id.
If the flag (least significant bit) is not set then
the thread id will not be negative and if non-zero is the id of the thread the process is currenty running on
The flag is probably a mistake..."
"In part, what's really going on here is an attempt to deal with threading on Mac. Events can only be delivered
on the GUi thread. To avoid blocking and/or crashing the VM by making a blocking (e.g. FFI) call on the GUI
thread we want a nice way of preventing a process from running on the GUI thread. We can then use a process
whose threadId precludes running on the GUI thread to make blocking calls. The alternative, of arranging that
events are delivered to a thread the VM does not run on, is problematic; it cannot support event callbacks."
"So if we simplify, and threadId is only instructive to the VM, (i.e. can say ''run on a given thread'', or ''don't run
on a given thread'', and ''don't care; run on any thread'') and does not necessarily hold the threadId of the thread
the process is currenty bound to, how do we locate the threadId for a process temporarily affined to a thread for
the duration of an FFI call? Note that a process *must* be bound to a thread for the duration of a threaded call
(or foreign callback) so that return occurs on the correct thread. We can use the least significant bit to mean
''temporarily affined'', but we need to support ''don't run on this thread''. We could use bit fields (yuck); we
could allocate a two field object and assign it to threadId when setting a process to not run on a given thread.
This isn't so bad; use negative values to mean ''don't run on this thread'', and positive values to mean ''run on this thread''.
Split the smallest SmallInteger (32-bit, 1 bit sign, 2-bit tags, leaving 29//2) into two 14 bit fields. The least significant
14 bits are the thread id the receiver is temporarily affined to. The most significant 14 bits are the thread id of the
thread the proess is either bound to or excluded from. If zero, the process is agnostic. See CogThreadManager>>#maxNumThreads"
ThreadIdIndex := 4.
ThreadIdShift := 14. "could be 30 in 64-bits"
"disown result/own argument flags"
OwnVMForeignThreadFlag := 1.
VMAlreadyOwnedHenceDoNotDisown := 2.
ProcessUnaffinedOnDisown := 4.
"& defined in StackInterpreter are..."
+ DisownVMForFFICall := 16.
+ DisownVMForThreading := 32.
+ DisownFlagsShift := DisownVMForThreading highBit!
- DisownVMForFFICall := 8.
- DisownVMForThreading := 16.
- DisownFlagsShift := 5!