gabr42 / gabr42/OmniThreadLibrary

CreateTask in Task group with Unobserved function call fails

Open
#24 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Pascal
Stars
513
Forks
147
PR merge metrics
No merged PRs in 30d

Description

Reported by Saskathex, Nov 11, 2014

Following code produces on certain machines an error. The error happens sometimes but not all the times.

```
TaskGroup := CreateTaskGroup;
try
for I := 0 to 2 do
CreateTask (TestTask, Format ('TestTask %d', [I]))
.SetParameter ('Number', I)
.Unbserved
.Join (TaskGroup);

TaskGroup.RunAll;
```

Starting the tasks inside the Task Group Fails with the following stack trace:

```
OtlEventMonitor:221 (OtlEventMonitor.TOmniEventMonitor.Destroy) Access violation at address 0000000002060A36 in module 'ABC.exe'. Read of address 0000000000000000
[0000000002060A36] OtlEventMonitor.TOmniEventMonitor.Destroy (Line 221, "OtlEventMonitor.pas")
[0000000076D21278] KiUserExceptionDispatcher
[0000000002060A36] OtlEventMonitor.TOmniEventMonitor.Destroy (Line 221, "OtlEventMonitor.pas")
[000000000205E2DF] OtlTaskControl.TOmniTaskControlEventMonitor.Create (Line 3348, "OtlTaskControl.pas")
[0000000002061BE6] OtlEventMonitor.TOmniEventMonitorPool.Allocate (Line 414, "OtlEventMonitor.pas")
[000000000205E55D] OtlTaskControl.TOmniTaskControlEventMonitorPool.Allocate (Line 3379, "OtlTaskControl.pas")
[000000000205A114] OtlTaskControl.TOmniTaskControl.CreateInternalMonitor (Line 2491, "OtlTaskControl.pas")
[000000000205CD54] OtlTaskControl.TOmniTaskControl.Unobserved (Line 3045, "OtlTaskControl.pas")
```

Using Version 3.03b on an Windows Server 2008R2 64bit.

Removing the Unobserved function call works for us!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.