Debug error using VS CODE
Posted: 26 May 2023, 07:50
Hello,
After compiling my 1.7.9 version C++ SDK using VS CODE, I running the example program "server_lesson01d" in the TERMINAL provided by VS CODE like:
"user@wpserver-Precision-5820-Tower:~/share/UA/sdk/build/examples/server_gettingstarted/lesson01$ ./server_lesson01d",
but the program crashed with message:
"server_lesson01d: /home/user/share/UA/sdk/src/uabase/uabasecpp/uaplatformlayer.cpp:372: static int UaPlatformLayer::init(): Assertion `(((uStatus) & 0xC0000000) == 0x00000000)' failed.Abandon (core dumped)".
and A dialog box pops up with message “Unable to open 'raise.c': Unable to read file '/build/glibc-OTsEL5/glibc-2.27/sysdeps/unix/sysv/linux/raise.c' (Error: Unable to resolve non-existing file '/build/glibc-OTsEL5/glibc-2.27/sysdeps/unix/sysv/linux/raise.c').”
However I running the example program in the Terminal provided by Ubuntu, it works well.
Then I debug the program using Debugger provided by VS CODE, the message above still appears, and the CALL STACK show like this:
libc.so.6!__GI_raise(int sig) (/build/glibc-OTsEL5/glibc-2.27/sysdeps/unix/sysv/linux/raise.c:51)
libc.so.6!__GI_abort() (/build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:79)
libc.so.6!__assert_fail_base(const char * fmt, const char * assertion, const char * file, unsigned int line, const char * function) (/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:92)
libc.so.6!__GI___assert_fail(const char * assertion, const char * file, unsigned int line, const char * function) (/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:101)
UaPlatformLayer::init() (/home/user/share/UA/sdk/src/uabase/uabasecpp/uaplatformlayer.cpp:372)
OpcServerMain(const char * szAppPath) (/home/user/share/UA/sdk/examples/server_gettingstarted/lesson01/servermain.cpp:49)
main() (/home/user/share/UA/sdk/examples/server_gettingstarted/lesson01/servermain.cpp:141)
Do you know how to fix this?
After compiling my 1.7.9 version C++ SDK using VS CODE, I running the example program "server_lesson01d" in the TERMINAL provided by VS CODE like:
"user@wpserver-Precision-5820-Tower:~/share/UA/sdk/build/examples/server_gettingstarted/lesson01$ ./server_lesson01d",
but the program crashed with message:
"server_lesson01d: /home/user/share/UA/sdk/src/uabase/uabasecpp/uaplatformlayer.cpp:372: static int UaPlatformLayer::init(): Assertion `(((uStatus) & 0xC0000000) == 0x00000000)' failed.Abandon (core dumped)".
and A dialog box pops up with message “Unable to open 'raise.c': Unable to read file '/build/glibc-OTsEL5/glibc-2.27/sysdeps/unix/sysv/linux/raise.c' (Error: Unable to resolve non-existing file '/build/glibc-OTsEL5/glibc-2.27/sysdeps/unix/sysv/linux/raise.c').”
However I running the example program in the Terminal provided by Ubuntu, it works well.
Then I debug the program using Debugger provided by VS CODE, the message above still appears, and the CALL STACK show like this:
libc.so.6!__GI_raise(int sig) (/build/glibc-OTsEL5/glibc-2.27/sysdeps/unix/sysv/linux/raise.c:51)
libc.so.6!__GI_abort() (/build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:79)
libc.so.6!__assert_fail_base(const char * fmt, const char * assertion, const char * file, unsigned int line, const char * function) (/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:92)
libc.so.6!__GI___assert_fail(const char * assertion, const char * file, unsigned int line, const char * function) (/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:101)
UaPlatformLayer::init() (/home/user/share/UA/sdk/src/uabase/uabasecpp/uaplatformlayer.cpp:372)
OpcServerMain(const char * szAppPath) (/home/user/share/UA/sdk/examples/server_gettingstarted/lesson01/servermain.cpp:49)
main() (/home/user/share/UA/sdk/examples/server_gettingstarted/lesson01/servermain.cpp:141)
Do you know how to fix this?