Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion for repeated callbacks with UA_MULTITHREADING=100 #4123

Open
basyskom-jvoe opened this issue Jan 14, 2021 · 3 comments
Open

Assertion for repeated callbacks with UA_MULTITHREADING=100 #4123

basyskom-jvoe opened this issue Jan 14, 2021 · 3 comments

Comments

@basyskom-jvoe
Copy link
Contributor

basyskom-jvoe commented Jan 14, 2021

Description

Servers built with open62541 1.2 with UA_MULTITHREADING=100 terminate sporadically with the following message:
/home/jvoe/open62541/src/server/ua_server.c:670: serverExecuteRepeatedCallback: Assertion `server->serviceMutexCounter == 0' failed.

Background Information / Reproduction Steps

Build the open62541 1.2 branch with the following CMake options

cmake -DUA_ENABLE_ENCRYPTION:BOOL="1" -DUA_NAMESPACE_ZERO:STRING="FULL" -DUA_ENABLE_AMALGAMATION:BOOL="0" -DUA_ENABLE_SUBSCRIPTIONS_EVENTS:BOOL="1" -DUA_ENABLE_ENCRYPTION_OPENSSL:BOOL="1" -DUA_MULTITHREADING:STRING="100"

and link it to a server with one active repeated callback.

Checklist

Please provide the following information:

[X ] open62541 Version (release number or git tag): 1.2 (e401ddf)

@basyskom-jvoe basyskom-jvoe changed the title Assertion for repeated callbacks Assertion for repeated callbacks with UA_MULTITHREADING=100 Jan 14, 2021
@rexsum
Copy link

rexsum commented Jan 14, 2021

This issue looks similar to the one that I reported yesterday (issue: 4119). it looks like code was pushed that is causing these multi-threading assert errors to suddenly start showing up. I'd like for whomever it is that reviews these issues to be aware that this is a problem that needs to be addressed.

@jpfr
Copy link
Member

jpfr commented Jan 17, 2021

Please provide a backtrace from a debugger.
Should be easy to fix then.

@basyskom-jvoe
Copy link
Contributor Author

basyskom-jvoe commented Jan 22, 2021

The error seems to occur less often when a debugger is attached. Finally, after a few hours, it happened:

#1  0x00007ffff681403a in __GI_abort () at abort.c:89
#2  0x00007ffff680abe7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x8d4040 "server->serviceMutexCounter == 0", 
    file=file@entry=0x8d3e60 "/home/jvoe/open62541/src/server/ua_server.c", line=line@entry=670, 
    function=function@entry=0x8d41d0 <__PRETTY_FUNCTION__.18338> "serverExecuteRepeatedCallback") at assert.c:92
#3  0x00007ffff680ac92 in __GI___assert_fail (assertion=0x8d4040 "server->serviceMutexCounter == 0", file=0x8d3e60 "/home/jvoe/open62541/src/server/ua_server.c", 
    line=670, function=0x8d41d0 <__PRETTY_FUNCTION__.18338> "serverExecuteRepeatedCallback") at assert.c:101
#4  0x00000000004af190 in serverExecuteRepeatedCallback (server=0xc1fb90, cb=0x881a1e <publishCallback>, callbackApplication=0xc1fb90, data=0x1410010)
    at /home/jvoe/open62541/src/server/ua_server.c:670
#5  0x00000000008962c2 in UA_Timer_process (t=0xc200e8, nowMonotonic=6150398231133, executionCallback=0x4af14b <serverExecuteRepeatedCallback>, 
    executionApplication=0xc1fb90) at /home/jvoe/open62541/src/ua_timer.c:207
#6  0x00000000004af1e6 in UA_Server_run_iterate (server=0xc1fb90, waitInternal=true) at /home/jvoe/open62541/src/server/ua_server.c:678
#7  0x00000000004af489 in UA_Server_run (server=0xc1fb90, running=0xbcc814 <running>) at /home/jvoe/open62541/src/server/ua_server.c:773
#8  0x0000000000484808 in MyServer::run(bool volatile*) ()
#9  0x000000000044b661 in main ()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants