[Oberon] Re (2): Clipboard in Oberon subsystem of A2.

peter at easthope.ca peter at easthope.ca
Sun Jan 14 18:16:19 CET 2024


Bernhard & all,

Happy New Year to you also.

From:	Bernhard Treutwein <bernhard at wildwein.de>
Date:	Sun, 14 Jan 2024 12:42:38 +0100
> maybe it is tracing to the command line from where it was started, 
> if it was started from a command line ...

Helpful tip.  The orginating console has no Trace output but shows 
failure of ASSERT in Machine.Acquire.  The Trap report notes i = 2.
So I infer that ASSERT(taken[2] # Unix.ThrThis( )) fails.

	(** Acquire a spin-lock. *)
	PROCEDURE  Acquire*( level: SIGNED32 );   (* non reentrant lock *)
	VAR i: INTEGER;
	BEGIN
		Trace.String("Unix.Machine.Acquire() invoked from Clipboard.TakeSelection."); Trace.Ln();
		Unix.MtxLock( mtx[level] );
		IF StrongChecks THEN
			ASSERT(taken[level] = NIL);
			taken[level] := Unix.ThrThis( );
			FOR i := 0 TO level-1 DO
				ASSERT(taken[i] # Unix.ThrThis( )); (*! lock order *)
			END;
		END;
	END Acquire;

Beginning of the console report.

LinuxA2 Gen. 64-bit, rev.9799   2024/01/14  08:45

Trap 5.8  (ASSERT failed)

SP = 00007F6D79C31A90 FP = 00007F6D79C31AB0 PC = 0000000008061BDB 

RAX = 00007F6D79C33700 RBX = 0000000008062860 RCX = 0000000000000000 RDX = 00007F6D7E868360 
RSI = 00007F6D79C33700 RDI = 0000000008062870 R8 = 00007F6D123A98C0 R9 = 00007F6D5C00F840 
R10 = 0000000000000000 R11 = 0000000000200282 R12 = 00007F6D7A10504E R13 = 00007F6D7A10504F 
R14 = 00007F6D79C32FC0 R15 = 00007F6D5C09D520 

Process:   62 run 0 000007F6D123A97D0:Oberon-System.OberonRunner NIL {0}

StackTraceBack:
Machine.Acquire:288 pc=0000000008061BDB fp=00007F6D79C31AB0 crc=65B37D0E
  level= [@16] 3
  i= [@-12] 2
  @hiddenIRVar0= [@-16] 2
Heaps.NewRec:202 pc=000000000806C9F1 fp=00007F6D79C31B10 crc=07B5C2AF
  p= [@32] -> [@00007F6D79C31B48] 0000000000000000 NIL
  tag= [@24] 00007F6D10701A48
  isRealtime= [@16] false
  size= [@-16] 56[0000000000000038]
  blockSize= [@-24] 128[0000000000000080]
  recordBlockAdr= [@-32] 0000000000000000
  dataBlockAdr= [@-40] 0000000000000000
  recordBlock= [@-48] 0000000000000000 NIL
  dataBlock= [@-56] 0000000000000000 NIL
  typeDesc= [@-64] 00007F6D10701A48 (NIL)
Texts.Write:306 pc=00007F6D106FE98A fp=00007F6D79C31B70 crc=BD10AEB2
  W= [@24] -> [@00007F6D109ED720] ...(Oberon-Texts.Writer)
  ch= [@16] M
  p= [@-16] 00007F6D109EEF40 (Oberon-Texts.PieceDesc)
  q= [@-24] 0000000000000000 NIL
  @hiddenIRVar0= [@-32] 0000000000000000 NIL
  @hiddenIRVar1= [@-40] 0000000000000000 NIL
  ...

Unix.MtxLock( mtx[level] ) doesn't work properly?  I don't understand 
the significance of level, mtx[level], Unix.MtxLock( mtx[level] ), 
taken[level] and Unix.ThrThis( ).

Incidentally, the console is recorded in the working directory in 
AOS.nnnnn.Log.  When I carelessly close the console before reading it, 
can still read the Log.

Thanks for the reply,                           ... P.L.

-- 
VoIP:   +1 604 670 0140
work: https://en.wikibooks.org/wiki/User:PeterEasthope



More information about the Oberon mailing list