3.16 P016 dpDisconnect within callback makes manager crash

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
Search

Post Reply
3 posts • Page 1 of 1
dvribeira
Posts: 24
Joined: Mon Mar 18, 2019 10:53 am

3.16 P016 dpDisconnect within callback makes manager crash

Post by dvribeira » Thu Jan 16, 2020 4:30 pm

Dear all,

After seeing the following entry in the release notes, section "Solved problems" of WinCC OA 3.16 P016
69554: Calling dpDisconnect() during the callback function of a
dpConnect() could cause a manager to crash.
I tried the following code, since I would be interested in being able to disconnect from callbacks:

Code: Select all

main () {
    dpConnect("myCB", some_dp);
}

void myCB(const string &source_dp, const time &value) {
    dpDisconnect("myCB", some_dp);
    DebugTN("called myCB");
}
If you execute that as a control manager (replacing some_dp by a valid DP in both main and myCB) it will crash unless you comment out the dpDisconnect. So either the problem is not solved, or I am misunderstanding the entry in the release notes.

Kind regards and happy 2020,
Daniel

dvribeira
Posts: 24
Joined: Mon Mar 18, 2019 10:53 am

Re: 3.16 P016 dpDisconnect within callback makes manager crash

Post by dvribeira » Fri Jan 17, 2020 9:33 am

For further information, I know I had in the code dpDisconnects within callbacks working properly, so I did some further tests:
If in the previous code, we replace

Code: Select all

dpConnect("myCB", some_dp);
by

Code: Select all

dpConnect("myCB", false, some_dp);
And run it, then the CB is not called back immediately, then if we change the value of the DP, the dpDisconnect is called without crashing and he Debug line is executed as well without problems.

So I guess there is a race condition there... I did not further test if this happens only if you execute the dpDisconnect on a first call (with answer parameter being true or omitted) or if it happens as well on a fast enough DP change triggering the CB too fast.

Kind regards,
Daniel

User avatar
leoknipp
Posts: 2245
Joined: Tue Aug 24, 2010 5:28 pm

Re: 3.16 P016 dpDisconnect within callback makes manager crash

Post by leoknipp » Tue Jan 21, 2020 9:54 am

Thanks for the information.
I tested it and I can reproduce the problem.

Best Regards
Leopold Knipp
Senior Support Specialist

Post Reply
3 posts • Page 1 of 1