CheckSynchronize problems in 2.0
Original Reporter info from Mantis: FPCCore
-
Reporter name: FPC core team
Original Reporter info from Mantis: FPCCore
- Reporter name: FPC core team
Description:
The attached program can be compiled with FPC 2.0, and then executed with or without arguments. The argument itself is not relevant. If one is given, it triggers an additional CheckSynchronize() call. I've tested this program with FPC 2.0 in windows NT and Linux, and with Kylix3 on Linux.
Several problems can be observed. First, without the extra CheckSynchronize() call, the line saying "Ending MyThread.Execute" is omitted. This happens in both Windows and Linux FPC programs.
Other problems detected only under Linux...
Tester.Terminated() method, the Thread.OnTerminate event handler, is not called when the program is invoked without the extra checkSynchronize() call. This happens also in the Kylix version and it is not a bug, but the Linux FPC program doesn't call this method at all (it would need another extra checkSynchronize() call, but is not implemented by my test).
Another funny behavior is that the extra CheckSynchronize() call triggers another call to count(), so the last program output shows the number 11 instead of 10 as the higest count!
And the last one: when there are pending synchronize calls, the program fails with a runtime error.
Program compiled with FPC 2.0 on Windows NT
===========================================
D:>testsyn2
Starting Tester.run
Starting MyThread.Execute
1
2
3
4
5
6
7
8
9
10
Ending Tester.run
D:>testsyn2 extra
Starting Tester.run
Starting MyThread.Execute
1
2
3
4
5
6
7
8
9
10
Ending MyThread.Execute
Tester.Terminated invoked
Ending Tester.run
Program compiled with Kylix 3 on Linux
======================================
[~/Pascal/test2.0]$ ./testsyn2
Starting Tester.run
Starting MyThread.Execute
1
2
3
4
5
6
7
8
9
10
Ending Tester.run
Ending MyThread.Execute
[~/Pascal/test2.0]$ ./testsyn2 extra
Starting Tester.run
Starting MyThread.Execute
1
2
3
4
5
6
7
8
9
10
Ending MyThread.Execute
Tester.Terminated invoked
Ending Tester.run
Program compiled with FPC 2.0 on Linux
======================================
[~/Pascal/test2.0]$ ./testsyn2
Starting Tester.run
Starting MyThread.Execute
1
2
3
4
5
6
7
8
9
10
Ending Tester.run
Runtime error 6 at $0805D44A
$0805D44A
$08057419
$0806CF39
$08073110
$080541EF
$0805425E
$08054430
$080485F8
[~/Pascal/test2.0]$ ./testsyn2 extra
Starting Tester.run
Starting MyThread.Execute
1
2
3
4
5
6
7
8
9
10
11
Ending MyThread.Execute
Ending Tester.run
Runtime error 6 at $0805D44A
$0805D44A
$08057419
$0806CF39
$08073110
$080541EF
$0805425E
$08054430
$080485F8
Additional information:
Reporter: Pedro Lopez-Cabanillas
EMail: plcl at telefonica dot net
Mantis conversion info:
- Mantis ID: 5940
- OS: Linux