titan.core issueshttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues2023-05-16T10:53:28Zhttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/697gcc 4.8 compatibility issue2023-05-16T10:53:28ZGábor Szalaigcc 4.8 compatibility issue## Summary
(C++) Communication.cc
In file included from /usr/include/c++/4.8/unordered_map:35:0,
from Fd_And_Timeout_User.hh:27,
from Communication.cc:47:
/usr/include/c++/4.8/bits/c++0x_warning.h...## Summary
(C++) Communication.cc
In file included from /usr/include/c++/4.8/unordered_map:35:0,
from Fd_And_Timeout_User.hh:27,
from Communication.cc:47:
/usr/include/c++/4.8/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the \
^
In file included from Communication.cc:47:0:
Fd_And_Timeout_User.hh:125:10: error: 'unordered_map' in namespace 'std' does not name a type
static std::unordered_map<int,Data> items;
^
Fd_And_Timeout_User.hh: In static member function 'static boolean FdMap::findInItems(int)':
Fd_And_Timeout_User.hh:112:12: error: 'items' was not declared in this scope
return items.find(fd)!=items.end();
^
/cc @aknappqwt @mmagyariGábor SzalaiGábor Szalaihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/696Extension additions of a SEQUENCE/SET are not set to optional2023-09-06T12:59:16ZAdam KnappExtension additions of a SEQUENCE/SET are not set to optional## Summary
According to the ASN.1 standard, "All fields in extension additions of a SEQUENCE type or a SET type shall be transformed to optional fields". This behavior is missing currently.
Originates from this forum post: https://www....## Summary
According to the ASN.1 standard, "All fields in extension additions of a SEQUENCE type or a SET type shall be transformed to optional fields". This behavior is missing currently.
Originates from this forum post: https://www.eclipse.org/forums/index.php/t/1112865/
## Titan version
All
## Platform details (OS type and version)
All
/cc @aknappqwt @mmagyariBotond BaranyiBotond Baranyihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/694Template initialization error2023-11-15T09:57:11ZLenard NagyTemplate initialization error## Summary
Original Titan Forum article:
https://www.eclipse.org/forums/index.php/t/1112705/
## Steps and/or TTCN-3 code to reproduce
[proba.ttcn](/uploads/2ce1c6fbbf9f5d026872aab8755fdd7e/proba.ttcn)
## What is the current bug behav...## Summary
Original Titan Forum article:
https://www.eclipse.org/forums/index.php/t/1112705/
## Steps and/or TTCN-3 code to reproduce
[proba.ttcn](/uploads/2ce1c6fbbf9f5d026872aab8755fdd7e/proba.ttcn)
## What is the current bug behavior?
Compiler crash
## Titan version
8.3.0
/cc @aknappqwt @mmagyariBotond BaranyiBotond Baranyihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/692xsd2ttcn: include doesn't copy import statements2023-05-16T10:53:32ZBotond Baranyixsd2ttcn: include doesn't copy import statementsWhen generating code for an 'include' statement from an XSD, the xsd2ttcn tool doesn't copy 'import' statements from the included schema. This is needed, since the elements/types in the included schema may depend on other types from the ...When generating code for an 'include' statement from an XSD, the xsd2ttcn tool doesn't copy 'import' statements from the included schema. This is needed, since the elements/types in the included schema may depend on other types from the imported schema.
/cc @aknappqwt @mmagyariBotond BaranyiBotond Baranyihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/690ttcn3 connect() on port triggering kernel OOM killer on component2023-05-16T10:53:34ZPau Espin Pedrolttcn3 connect() on port triggering kernel OOM killer on component## Summary
At osmocom we have a set of testsuites in TTCN3 which tests several telecommunications nodes in this repository [1]. Most tetsuite are run nightly with a prepared containerized setup under docker available at [2].
The PGW_Te...## Summary
At osmocom we have a set of testsuites in TTCN3 which tests several telecommunications nodes in this repository [1]. Most tetsuite are run nightly with a prepared containerized setup under docker available at [2].
The PGW_Tests setup (docker-playground.git/ttcn3-pgw-test/) starts a open5gs core network (specifically UPF and SMF) and tests creating 256 GTPv2 concurrent sessions against it (TC_createSession_ping4_256), launching 256 ping commands on one tun dev per conn. TTCN3 emulates OCS and PFC (Gx, Gy interface) as well as SGW (GTP). The most relevant code can be found at [3].
[1] https://gitea.osmocom.org/ttcn3/osmo-ttcn3-hacks
[2] https://gitea.osmocom.org/osmocom/docker-playground
[3] https://gitea.osmocom.org/ttcn3/osmo-ttcn3-hacks/src/branch/master/pgw/PGW_Tests.ttcn
In TTCN3, we have 1 component per GTP session, each in turn has ports connected to a Gx DIAMETER Gx and Gy DIAMETER components through component ports.
## Steps and/or TTCN-3 code to reproduce
Today, the PGW_Tests testsuite started to fail within a specific test: TC_createSession_ping4_256
Looking at the logs it seems the first 3-4 GTP sessions (ttcn3 components) are created fine and everything works fine, but at around the 4th-5th one it fails due to one component detecting a peer component closed the unix socket uses to intercommunicate with it (I also attah full merged log of all components during the failing test run[PGW_Tests.TC_createSession_ping4_256.pcap.gz](/uploads/97a31b296bf98c17556bf9118c0b09a1/PGW_Tests.TC_createSession_ping4_256.pcap.gz)[PGW_Tests.TC_createSession_ping4_256.merged.gz](/uploads/021bae01b9158ba54a7929c86110f144/PGW_Tests.TC_createSession_ping4_256.merged.gz)):
```
17:00:55.894883 22 - Connection of port DIAMETER to TC_createSession_ping4_256(4):DIAMETER_CLIENT was closed unexpectedly by the peer.
17:00:55.894983 19 PGW_Tests.ttcn:85 Connection of port DIAMETER_PROC to TC_createSession_ping4_256(4):DIAMETER_PROC was closed unexpectedly by the peer.
17:00:55.895109 16 PGW_Tests.ttcn:85 Connection of port DIAMETER_PROC to TC_createSession_ping4_256(4):DIAMETER_PROC was closed unexpectedly by the peer.
17:00:55.895114 13 PGW_Tests.ttcn:85 Connection of port DIAMETER_PROC to TC_createSession_ping4_256(4):DIAMETER_PROC was closed unexpectedly by the peer.
17:00:55.895215 10 PGW_Tests.ttcn:85 Connection of port DIAMETER_PROC to TC_createSession_ping4_256(4):DIAMETER_PROC was closed unexpectedly by the peer.
17:00:55.895219 7 PGW_Tests.ttcn:85 Connection of port DIAMETER_PROC to TC_createSession_ping4_256(4):DIAMETER_PROC was closed unexpectedly by the peer.
17:00:55.895260 22 - Port DIAMETER was disconnected from TC_createSession_ping4_256(4):DIAMETER_CLIENT.
17:00:55.895350 19 PGW_Tests.ttcn:85 Port DIAMETER_PROC was disconnected from TC_createSession_ping4_256(4):DIAMETER_PROC.
17:00:55.895386 mtc PGW_Tests.ttcn:275 Connection of port Gx_PROC to TC_createSession_ping4_256(4):DIAMETER_PROC was closed unexpectedly by the peer.
17:00:55.895423 16 PGW_Tests.ttcn:85 Port DIAMETER_PROC was disconnected from TC_createSession_ping4_256(4):DIAMETER_PROC.
17:00:55.895427 13 PGW_Tests.ttcn:85 Port DIAMETER_PROC was disconnected from TC_createSession_ping4_256(4):DIAMETER_PROC.
17:00:55.895509 10 PGW_Tests.ttcn:85 Port DIAMETER_PROC was disconnected from TC_createSession_ping4_256(4):DIAMETER_PROC.
17:00:55.895511 7 PGW_Tests.ttcn:85 Port DIAMETER_PROC was disconnected from TC_createSession_ping4_256(4):DIAMETER_PROC.
17:00:55.895743 mtc PGW_Tests.ttcn:275 Port Gx_PROC was disconnected from TC_createSession_ping4_256(4):DIAMETER_PROC.
17:00:55.896229 19 PGW_Tests.ttcn:85 Connection of port DIAMETER to TC_createSession_ping4_256(4):DIAMETER_CLIENT was reset by the peer.
17:00:55.896294 16 PGW_Tests.ttcn:85 Connection of port DIAMETER to TC_createSession_ping4_256(4):DIAMETER_CLIENT was closed unexpectedly by the peer.
17:00:55.896298 13 PGW_Tests.ttcn:85 Connection of port DIAMETER to TC_createSession_ping4_256(4):DIAMETER_CLIENT was closed unexpectedly by the peer.
17:00:55.896378 10 PGW_Tests.ttcn:85 Connection of port DIAMETER to TC_createSession_ping4_256(4):DIAMETER_CLIENT was closed unexpectedly by the peer.
17:00:55.896509 19 PGW_Tests.ttcn:85 Warning: The last outgoing messages on port DIAMETER may be lost.
17:00:55.896530 7 PGW_Tests.ttcn:85 Connection of port DIAMETER to TC_createSession_ping4_256(4):DIAMETER_CLIENT was closed unexpectedly by the peer.
17:00:55.896582 16 PGW_Tests.ttcn:85 Port DIAMETER was disconnected from TC_createSession_ping4_256(4):DIAMETER_CLIENT.
17:00:55.896586 13 PGW_Tests.ttcn:85 Port DIAMETER was disconnected from TC_createSession_ping4_256(4):DIAMETER_CLIENT.
17:00:55.896601 mtc PGW_Tests.ttcn:275 Connection of port Gx_UNIT to TC_createSession_ping4_256(4):DIAMETER_UNIT was closed unexpectedly by the peer.
17:00:55.896640 10 PGW_Tests.ttcn:85 Port DIAMETER was disconnected from TC_createSession_ping4_256(4):DIAMETER_CLIENT.
17:00:55.896762 7 PGW_Tests.ttcn:85 Port DIAMETER was disconnected from TC_createSession_ping4_256(4):DIAMETER_CLIENT.
17:00:55.896827 19 PGW_Tests.ttcn:85 Port DIAMETER was disconnected from TC_createSession_ping4_256(4):DIAMETER_CLIENT.
17:00:55.896851 mtc PGW_Tests.ttcn:275 Port Gx_UNIT was disconnected from TC_createSession_ping4_256(4):DIAMETER_UNIT.
17:00:55.897238 mtc PGW_Tests.ttcn:275 Dynamic test case error: Error message was received from MC: Establishment of port connection 4:DIAMETER_PROC - 22:DIAMETER_PROC failed because test component 4 has terminated during connection setup.
```
So looking at the TTCN3 logs (attached), I can compare the previous 3-4 created sessions with the last failing one, and it seems the "closed unexpectedly" happens while the port of the component is in the process of being connected() to the remote port (not yet completed).
When those errors show up, I get following output in "dmesg":
```
[28567.554950] __vm_enough_memory: pid: 233484, comm: PGW_Tests, no enough memory for the allocation
[28567.555002] __vm_enough_memory: pid: 233484, comm: PGW_Tests, no enough memory for the allocation
[28567.555066] __vm_enough_memory: pid: 233484, comm: PGW_Tests, no enough memory for the allocation
```
That's due to sysctl vm.overcommit_memory being 0 in my system (https://www.kernel.org/doc/html/latest/mm/overcommit-accounting.html). Disabling it (sysctl -w vm.overcommit_memory=1) makes it trigger the OOM killer every time I run the test, which kills the "PGW_Tests" binary containing the compiled TTCN3.
So I then run the "ttcn3_start" binary under "strace -ff -o /data/strace.log" to find out more. I get lots of strace.log, one per component (process). I grep for "unexpectedly" to find out the failing component, and look around to find out what's going on. According to the code, this happens because the unix socket recv() is returning 0. strace confirms that:
```
set_robust_list(0x7f9141acdee0, 24) = 0
close(3) = 0
epoll_create(16) = 3
close(4) = 0
epoll_ctl(3, EPOLL_CTL_DEL, 4, 0x7ffc6c88dd5c) = -1 EBADF (Bad file descriptor)
fcntl(4, F_GETFD) = -1 EBADF (Bad file descriptor)
close(6) = 0
openat(AT_FDCWD, "PGW_Tests-TC_createSession_ping4_256-7b8d6c76ffd5-22.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = 4
lseek(4, 0, SEEK_END) = 0
fcntl(4, F_GETFD) = 0
fcntl(4, F_SETFD, FD_CLOEXEC) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
fstat(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
write(4, "17:00:54.715547 - Warning: A plu"..., 110) = 110
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:54.715905 - TTCN-3 Paralle"..., 235) = 235
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:54.716072 - TTCN Logger v2"..., 289) = 289
socket(AF_UNIX, SOCK_STREAM, 0) = 6
connect(6, {sa_family=AF_UNIX, sun_path="/tmp/ttcn3-mctr-33961"}, 110) = 0
fcntl(6, F_GETFD) = 0
fcntl(6, F_SETFD, FD_CLOEXEC) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 6, {EPOLLIN, {u32=6, u64=6}}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:54.716422 - Connected to M"..., 35) = 35
sendto(6, "\2\4\26", 3, 0, NULL, 0) = 3
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:54.716616 - Initializing v"..., 152) = 152
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:54.717908 - Port DIAMETER "..., 45) = 45
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:54.718042 - Port DIAMETER_"..., 50) = 50
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:54.718148 - Port DIAMETER_"..., 52) = 52
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:54.718230 - Component type"..., 81) = 81
epoll_wait(3, [{EPOLLIN, {u32=6, u64=6}}], 64, -1) = 1
recvfrom(6, "\200T\r\10DIAMETER\4\32TC_createSession_p"..., 1000, 0, NULL, NULL) = 86
socket(AF_UNIX, SOCK_STREAM, 0) = 7
connect(7, {sa_family=AF_UNIX, sun_path="/tmp/ttcn3-portconn-c554be55"}, 110) = 0 //<--- "/tmp/ttcn3-portconn-c554be55", fd=7
fcntl(7, F_GETFD) = 0
fcntl(7, F_SETFD, FD_CLOEXEC) = 0
fcntl(7, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(7, F_SETFL, O_RDWR|O_NONBLOCK) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 7, {EPOLLIN, {u32=7, u64=7}}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:54.718682 - Port DIAMETER "..., 141) = 141
epoll_wait(3, [{EPOLLIN|EPOLLHUP, {u32=7, u64=7}}], 64, -1) = 1 //<----- POLLED FOR READ!
recvfrom(7, "", 1000, 0, NULL, NULL) = 0 //<-------- recv() returns 0!!!!!! peer closed!
sendto(6, "\33\20\10DIAMETER\4\17DIAMETER_CLIENT", 28, 0, NULL, 0) = 28
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:55.894883 - Connection of "..., 132) = 132
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:55.895260 - Port DIAMETER "..., 101) = 101
epoll_ctl(3, EPOLL_CTL_DEL, 7, 0x7ffc6c88ddec) = 0
close(7) = 0
epoll_wait(3, [{EPOLLIN, {u32=6, u64=6}}], 64, -1) = 1
recvfrom(6, "\1\26", 1000, 0, NULL, NULL) = 2
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:55.904796 - Kill was reque"..., 68) = 68
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:55.905412 - Terminating co"..., 77) = 77
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:55.906088 - Port DIAMETER "..., 45) = 45
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:55.906693 - Port DIAMETER_"..., 50) = 50
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:55.907299 - Port DIAMETER_"..., 52) = 52
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:55.907881 - Component type"..., 122) = 122
sendto(6, "\3\27\0\0", 4, 0, NULL, 0) = 4
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:55.908685 - Final verdict "..., 45) = 45
sendto(6, "&\1\0\206\237\370\346G\267\273\r0\32Final verdict of PT"..., 39, 0, NULL, 0) = 39
shutdown(6, SHUT_WR) = 0
recvfrom(6, "", 1024, 0, NULL, NULL) = 0
close(6) = 0
epoll_ctl(3, EPOLL_CTL_DEL, 6, 0x7ffc6c88dafc) = -1 EBADF (Bad file descriptor)
fcntl(6, F_GETFD) = -1 EBADF (Bad file descriptor)
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:55.958218 - Disconnected f"..., 40) = 40
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:55.958534 - TTCN-3 Paralle"..., 59) = 59
rt_sigaction(SIGPIPE, NULL, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f913d896d60}, 8) = 0
rt_sigaction(SIGPIPE, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f913d896d60}, NULL, 8) = 0
close(4) = 0
munmap(0x7f9141aae000, 32880) = 0
close(3) = 0
exit_group(0) = ?
+++ exited with 0 +++
```
So, the peer component is closing its socket, why? probably because it's crashing and the kernel is closing resources. Since the unix socket path is know from the above ("/tmp/ttcn3-portconn-c554be55"), we can easily identify the peer over all the other strace logs. Here it is (I attach the full file too[strace.log.46.gz](/uploads/75378688f6b57a50c5d5c688c9e38150/strace.log.46.gz)):
```
// This shows it's the component running DIAMETER_Emulation.main():
write(4, "17:00:53.675978 DIAMETER_Emulati"..., 133) = 133
sendto(6, "\200e\1\0\206\237\370\346E\251\241\n-\200XCreated Expect[0]"..., 103, 0, NULL, 0) = 103
[...]
// unix socket to which the component exiting with "unexepctedly closed by peer" is connecting:
socket(AF_UNIX, SOCK_STREAM, 0) = 11
getpid() = 46
bind(11, {sa_family=AF_UNIX, sun_path="/tmp/ttcn3-portconn-c554be55"}, 110) = 0
listen(11, 0) = 0
fcntl(11, F_GETFD) = 0
fcntl(11, F_SETFD, FD_CLOEXEC) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 11, {EPOLLIN, {u32=11, u64=11}}) = 0
sendto(6, "9\f\17DIAMETER_CLIENT\26\10DIAMETER\2\34/t"..., 58, 0, NULL, 0) = 58
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:54.717919 DIAMETER_Emulati"..., 183) = 183
[...]
//peer connects to us:
epoll_wait(3, [{EPOLLIN, {u32=11, u64=11}}], 64, -1) = 1
accept(11, NULL, NULL) = 22
fcntl(22, F_GETFD) = 0
fcntl(22, F_SETFD, FD_CLOEXEC) = 0
fcntl(22, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(22, F_SETFL, O_RDWR|O_NONBLOCK) = 0
epoll_ctl(3, EPOLL_CTL_DEL, 11, 0x7ffc6c88cb3c) = 0
getsockname(11, {sa_family=AF_UNIX, sun_path="/tmp/ttcn3-portconn-c554be55"}, [110->31]) = 0
unlink("/tmp/ttcn3-portconn-c554be55") = 0
close(11) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 22, {EPOLLIN, {u32=22, u64=22}}) = 0
sendto(6, "\33\r\17DIAMETER_CLIENT\26\10DIAMETER", 28, 0, NULL, 0) = 28
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:54.727273 DIAMETER_Emulati"..., 139) = 139
epoll_wait(3, [{EPOLLIN, {u32=6, u64=6}}], 64, -1) = 1
recvfrom(6, ":\f\rDIAMETER_PROC\26\32TC_createSessi"..., 1000, 0, NULL, NULL) = 59
socket(AF_UNIX, SOCK_STREAM, 0) = 11
getpid() = 46
bind(11, {sa_family=AF_UNIX, sun_path="/tmp/ttcn3-portconn-df4eb11c"}, 110) = 0 //<---- HERE ANOTHER SOCKET WITH DIFFERENT PATH IS CREATED
listen(11, 0) = 0
fcntl(11, F_GETFD) = 0
fcntl(11, F_SETFD, FD_CLOEXEC) = 0
mmap(NULL, 17179869184, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory) //<----- HERE MEM ALLOC OF 16GB!!!!!!! IT FAILS!!!!
brk(0x563e6dfce000) = 0x563a6dfbc000
mmap(NULL, 17180004352, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
futex(0x7f9141b5f1e0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=118, ...}) = 0
write(4, "17:00:54.732595 - Fatal error. A"..., 51) = 51 //<----- FAILURE TO ALLOC TRIGGERS TC_Error, ABORTS PROGRAM
sendto(6, ",\1\0\206\237\370\346F\254\3333\6 Fatal error. Aborti"..., 45, 0, NULL, 0) = 45
rt_sigaction(SIGPIPE, NULL, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f913d896d60}, 8) = 0
rt_sigaction(SIGPIPE, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f913d896d60}, NULL, 8) = 0
close(4) = 0
munmap(0x7f9141aae000, 32880) = 0
close(3) = 0
sendto(6, "\30\20\rDIAMETER_UNIT\1\7Gx_UNIT", 25, 0, NULL, 0) = 25
epoll_ctl(-1, EPOLL_CTL_DEL, 7, 0x7ffc6c88d6dc) = -1 EBADF (Bad file descriptor)
fcntl(7, F_GETFD) = 0x1 (flags FD_CLOEXEC)
write(2, "terminate called after throwing "..., 48) = 48
write(2, "TC_Error", 8) = 8
write(2, "'\n", 2) = 2
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
getpid() = 46
gettid() = 46
tgkill(46, 46, SIGABRT) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=46, si_uid=0} ---
```
So allegadely according to logs and strace output, this mem allocation of 16GB (interestingly happens to be the memory on my system) which crashes the program happens when in PORT::connect_listen_unix_stream(), AFTER set_close_on_exec() is called (see strace) and before anything else is logged, which potentially means during calls to any of PORT::add_connection(), TTCN_Communication::send_connect_listen_ack_unix_stream() or TTCN_Logger::log_port_misc().
## What is the current bug behavior?
A TTCN3 component crashes trying to allocate all the memory in my system and obviously fails to do so, crashing.
## What is the expected correct behavior?
The TTCN3 component should not be attempting that big allocation of memory.
## Relevant logs and/or screenshots
Attached as explained above.
## Possible fixes
Couldn't find a fix for this.
## Titan version
titan.core version: 8.3.0
## Platform details (OS type and version)
linux: Linux 6.1.12-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 14 Feb 2023 22:08:08 +0000 x86_64 GNU/Linux
/cc @aknappqwt @mmagyariGábor SzalaiGábor Szalaihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/689Type compatibility issue for union templates2023-05-16T10:53:36ZBotond BaranyiType compatibility issue for union templates## Summary
Conversion between two templates of two different union types, that are compatible with each other, fails at runtime (RT2 only).
This issue was originally posted on the Eclipse forums: https://www.eclipse.org/forums/index.php...## Summary
Conversion between two templates of two different union types, that are compatible with each other, fails at runtime (RT2 only).
This issue was originally posted on the Eclipse forums: https://www.eclipse.org/forums/index.php/t/1112510/
## Steps and/or TTCN-3 code to reproduce
See example in the forum post.
## What is the current bug behavior?
Dynamic test case error during conversion.
## What is the expected correct behavior?
Successful conversion.
## Relevant logs and/or screenshots
See forum post.
## Possible fixes
Update the union template conversion function generator.
## Titan version
8.3.0
## Platform details (OS type and version)
Any
/cc @aknappqwt @mmagyariBotond BaranyiBotond Baranyihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/688ASN.1 Information Objects parsing error2023-05-16T10:53:38ZDenis FilatovASN.1 Information Objects parsing error## Summary
The ASN.1 compiler doesn't support the _complex_ information objects like
```
Pdu ::= SEQUENCE {
id EXT-TYPE.&extId({Variants}),
content SEQUENCE OF EXT-TYPE.&ExtContent({Variants}{@.id})
}
```
## Steps and/or TTCN...## Summary
The ASN.1 compiler doesn't support the _complex_ information objects like
```
Pdu ::= SEQUENCE {
id EXT-TYPE.&extId({Variants}),
content SEQUENCE OF EXT-TYPE.&ExtContent({Variants}{@.id})
}
```
## Steps and/or TTCN-3 code to reproduce
```
ttcn3_compiler -A test.asn
```
### test.asn:
```
ModuleTestEmpty DEFINITIONS AUTOMATIC TAGS ::= BEGIN
IMPORTS ;
Pdu ::= SEQUENCE {
id EXT-TYPE.&extId({Variants}),
content SEQUENCE OF EXT-TYPE.&ExtContent({Variants}{@.id})
}
EXT-TYPE ::= CLASS {
&extId VarId,
&ExtContent
} WITH SYNTAX {&ExtContent IDENTIFIED BY &extId}
Variants EXT-TYPE ::= {
{NULL IDENTIFIED BY v1},
...
}
VarId ::= INTEGER(0..255)
END
```
[test.asn](/uploads/79f1a9276672df941b8f4481b9fb7cd5/test.asn)
## What is the current bug behavior?
```
ttcn3_compiler.exe -A test.asn
Notify: Parsing ASN.1 module `test.asn'...
Notify: Checking modules...
test.asn: In ASN.1 module `ModuleTestEmpty':
test.asn:5: In type assignment `Pdu':
test.asn:7: In constraint #1 of type `open type':
test.asn:7: error: Type `@ModuleTestEmpty.Pdu.content' is not a SEQUENCE, SET of CHOICE type.
Notify: Error found in the input module. Code will not be generated.
```
## What is the expected correct behavior?
Code should be generated
## Relevant logs and/or screenshots
See above
## Titan version
```
TTCN-3 and ASN.1 Compiler for the TTCN-3 Test Executor
Version: 8.3.0
Build date: Jan 26 2023 09:02:42
Compiled with: GCC 11.3.0
Using OpenSSL 1.1.1s 1 Nov 2022
Commit id: a4679583a
```
## Platform details (OS type and version)
Windows 10+Cygwin)
/cc @aknappqwt @mmagyariBotond BaranyiBotond Baranyihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/687initialization of @lazy and @fuzzy variables can be done by functions having ...2023-11-15T09:57:22ZLevente Erősinitialization of @lazy and @fuzzy variables can be done by functions having inout and out parameters## Summary
The condition in the title is not allowed according to Restriction e) in Section 11.1 of the TTCN-3 standard. Titan however, allows this.
## Steps and/or TTCN-3 code to reproduce
```
function noinoutps() return integer{
v...## Summary
The condition in the title is not allowed according to Restriction e) in Section 11.1 of the TTCN-3 standard. Titan however, allows this.
## Steps and/or TTCN-3 code to reproduce
```
function noinoutps() return integer{
var integer i:=2;
var integer j;
inoutps(i,j);
return 2;
}
function inoutps(inout integer i, out integer j) return integer{
j:=i;
i:=3;
return 3;
}
testcase fuzzy_lazy_ass() runs on ct_empty{
var integer i:=2;
var integer j;
var @lazy integer lv;
@try{
lv := inoutps(i,j);
}@catch(msg){
setverdict(pass);
}
var @lazy integer lv2 := noinoutps();
i:=2;
var @fuzzy integer fv;
@try{
fv := inoutps(i,j);
}@catch(msg){
setverdict(pass);
}
var @fuzzy integer fv2 := noinoutps();
}
```
## What is the current bug behavior?
The testcase has a none verdict.
## What is the expected correct behavior?
The testcase shall have a pass verdict (due to the problematic initializations -- with inoutps running into an error). That is, using ```inoutps(i,j)``` for initializing variables lv and fv shall cause an error.
## Relevant logs and/or screenshots
## Possible fixes
## Titan version
8.1.0
## Platform details (OS type and version)
Microsoft Windows 10 Enterprise 10.0.19042
/cc @aknappqwt @mmagyariBotond BaranyiBotond Baranyihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/686@lazy and @fuzzy modifiers are not working properly in Titan2023-11-15T09:57:27ZLevente Erős@lazy and @fuzzy modifiers are not working properly in Titan## Summary
According to Section 11.0 of the TTCN-3 standard a lazy variable shall be evaluated when it is first referenced after its value assignment, and shall keep its value until its next value assignment. A fuzzy variable shall be e...## Summary
According to Section 11.0 of the TTCN-3 standard a lazy variable shall be evaluated when it is first referenced after its value assignment, and shall keep its value until its next value assignment. A fuzzy variable shall be evaluated each time it is referenced after its value assignment. Titan however, evaluates lazy and fuzzy variables right at their value assignments.
## Steps and/or TTCN-3 code to reproduce
```
module variables {
type component ct_empty{}
testcase lazyeval() runs on ct_empty{
var integer i := 5;
var @lazy integer l := i;
i := 6;
if(l==6){setverdict(pass);}else{setverdict(fail);}
i := 7;
if(l==6){setverdict(pass);}else{setverdict(fail);}
var float n := 1.0;
var float d := 0.0;
var @lazy float f := n/d;
//shall not cause error as it's not evaluated
}
testcase fuzzyeval() runs on ct_empty{
var integer i := 5;
var @fuzzy integer l := i;
i := 6;
if(l==6){setverdict(pass);}else{setverdict(fail);}
i := 7;
if(l==7){setverdict(pass);}else{setverdict(fail);}
var @fuzzy integer v_fuzzy := 1;
var integer v_var;
var boolean v_condition := true;
if (v_condition) {
var integer v_local := 0;
v_fuzzy := v_local;
v_local := 10;
}
if(v_fuzzy==10){setverdict(pass);}else{setverdict(fail);}
}
control{
execute(lazyeval());
execute(fuzzyeval());
}
}
```
## What is the current bug behavior?
lazy test case causes error (and would not pass without the division by zero). The fuzzy test case fails too.
## What is the expected correct behavior?
Both test cases shall pass
## Relevant logs and/or screenshots
## Possible fixes
## Titan version
8.1.0
## Platform details (OS type and version)
Microsoft Windows 10 Enterprise 10.0.19042
/cc @aknappqwt @mmagyarihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/685Referencing null field does not result in error2023-11-15T09:57:33ZLevente ErősReferencing null field does not result in error## Summary
According to point c) of Section 10 of the TTCN-3 standard, referencing a null field value using dot or index notation shall result in an error. Titan however, does not work accordingly.
## Steps and/or TTCN-3 code to reprod...## Summary
According to point c) of Section 10 of the TTCN-3 standard, referencing a null field value using dot or index notation shall result in an error. Titan however, does not work accordingly.
## Steps and/or TTCN-3 code to reproduce
```
type record defrecord{
default f
}
type record of default defvector;
const defrecord cdr := {null}
const defvector cdv := {null, null}
testcase null_field_constant() runs on ct_empty{
log(cdr.f);
log(cdv[0]);
setverdict(pass);
}
```
## What is the current bug behavior?
Test case passes.
## What is the expected correct behavior?
Test case shall run into an error.
## Relevant logs and/or screenshots
2023/Jan/27 06:39:24.007471 USER - null
2023/Jan/27 06:39:24.007533 USER - null
## Possible fixes
## Titan version
8.1.0
## Platform details (OS type and version)
Microsoft Windows 10 Enterprise 10.0.19042
/cc @aknappqwt @mmagyarihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/684Compiler does not work if workspace path contains spaces.2023-01-27T08:12:58ZLevente ErősCompiler does not work if workspace path contains spaces.## Summary
If you set your workspace to a path containing a space, the compiler does not work.
## Steps and/or TTCN-3 code to reproduce
Set your workspace to a path containing a space, for instance ```C:\Users\lee\MUNKA_NOBACKUP\_SWAT...## Summary
If you set your workspace to a path containing a space, the compiler does not work.
## Steps and/or TTCN-3 code to reproduce
Set your workspace to a path containing a space, for instance ```C:\Users\lee\MUNKA_NOBACKUP\_SWAT\TITAN\test wsp```. (Don't worry, I do have backup, a manual, daily one, because of this exact reason -- the automatically synced folders on my machine have spaces in their paths.)
Then create any compilable TTCN-3 module, for example:
```
module asdf {
control{
log("A");
}
}
```
Then compile.
## What is the current bug behavior?
Compilation fails.
## What is the expected correct behavior?
Compilation succeeds.
## Relevant logs and/or screenshots
```
**************************************************************
2023-01-26_10:59:43: starting to build asdf
**************************************************************
sh -c make dep
Makefile:137: warning: overriding recipe for target '/cygdrive/c/Users/lee/MUNKA_NOBACKUP/_SWAT/TITAN/test'
Makefile:130: warning: ignoring old recipe for target '/cygdrive/c/Users/lee/MUNKA_NOBACKUP/_SWAT/TITAN/test'
/home/lee/git/titan.core/Install/bin/compiler \
../src/asdf.ttcn - ../src/asdf.ttcn
Notify: Parsing TTCN-3 module `../src/asdf.ttcn'...
Notify: Checking modules...
Notify: Generating code...
Notify: File `asdf.cc' was updated.
Notify: 1 file was updated.
touch compile
makedepend -DWIN32 -I. -I/home/lee/git/titan.core/Install/include -I. -DMAKEDEPEND_RUN asdf.cc
makedepend: warning: asdf.cc (reading /home/lee/git/titan.core/Install/include/Types.h, line 37): cannot find include file "stddef.h"
not in ./stddef.h
not in /home/lee/git/titan.core/Install/include/stddef.h
not in ./stddef.h
not in /usr/include/stddef.h
makedepend: warning: asdf.cc (reading /home/lee/git/titan.core/Install/include/Vector.hh, line 21): cannot find include file "stddef.h"
not in ./stddef.h
not in /home/lee/git/titan.core/Install/include/stddef.h
not in ./stddef.h
not in /usr/include/stddef.h
makedepend: warning: asdf.cc (reading /home/lee/git/titan.core/Install/include/JSON_Tokenizer.hh, line 18): cannot find include file "cstddef"
not in ./cstddef
not in /home/lee/git/titan.core/Install/include/cstddef
not in ./cstddef
not in /usr/include/cstddef
makedepend: warning: asdf.cc (reading /usr/include/sys/cdefs.h, line 47): cannot find include file "stddef.h"
not in ./stddef.h
not in /home/lee/git/titan.core/Install/include/stddef.h
not in ./stddef.h
not in /usr/include/stddef.h
makedepend: warning: asdf.cc (reading /usr/include/stdio.h, line 36): cannot find include file "stddef.h"
not in ./stddef.h
not in /home/lee/git/titan.core/Install/include/stddef.h
not in ./stddef.h
not in /usr/include/stddef.h
makedepend: warning: asdf.cc (reading /usr/include/stdio.h, line 40): cannot find include file "stdarg.h"
not in ./stdarg.h
not in /home/lee/git/titan.core/Install/include/stdarg.h
not in ./stdarg.h
not in /usr/include/stdarg.h
makedepend: warning: asdf.cc (reading /usr/include/sys/reent.h, line 14): cannot find include file "stddef.h"
not in ./stddef.h
not in /home/lee/git/titan.core/Install/include/stddef.h
not in ./stddef.h
not in /usr/include/stddef.h
makedepend: warning: asdf.cc (reading /usr/include/sys/_types.h, line 24): cannot find include file "stddef.h"
not in ./stddef.h
not in /home/lee/git/titan.core/Install/include/stddef.h
not in ./stddef.h
not in /usr/include/stddef.h
makedepend: warning: asdf.cc (reading /usr/include/stdlib.h, line 16): cannot find include file "stddef.h"
not in ./stddef.h
not in /home/lee/git/titan.core/Install/include/stddef.h
not in ./stddef.h
not in /usr/include/stddef.h
makedepend: warning: asdf.cc (reading /home/lee/git/titan.core/Install/include/Logger.hh, line 28): cannot find include file "stdarg.h"
not in ./stdarg.h
not in /home/lee/git/titan.core/Install/include/stdarg.h
not in ./stdarg.h
not in /usr/include/stdarg.h
makedepend: warning: asdf.cc (reading /usr/include/time.h, line 16): cannot find include file "stddef.h"
not in ./stddef.h
not in /home/lee/git/titan.core/Install/include/stddef.h
not in ./stddef.h
not in /usr/include/stddef.h
makedepend: warning: asdf.cc (reading /home/lee/git/titan.core/Install/include/Param_Types.hh, line 20): cannot find include file "stddef.h"
not in ./stddef.h
not in /home/lee/git/titan.core/Install/include/stddef.h
not in ./stddef.h
not in /usr/include/stddef.h
makedepend: warning: asdf.cc (reading /home/lee/git/titan.core/Install/include/memory.h, line 18): cannot find include file "stddef.h"
not in ./stddef.h
not in /home/lee/git/titan.core/Install/include/stddef.h
not in ./stddef.h
not in /usr/include/stddef.h
makedepend: warning: asdf.cc (reading /home/lee/git/titan.core/Install/include/memory.h, line 19): cannot find include file "stdarg.h"
not in ./stdarg.h
not in /home/lee/git/titan.core/Install/include/stdarg.h
not in ./stdarg.h
not in /usr/include/stdarg.h
makedepend: warning: asdf.cc (reading /home/lee/git/titan.core/Install/include/Param_Types.hh, line 25): cannot find include file "cstdio"
not in ./cstdio
not in /home/lee/git/titan.core/Install/include/cstdio
not in ./cstdio
not in /usr/include/cstdio
makedepend: warning: asdf.cc (reading /home/lee/git/titan.core/Install/include/XER.hh, line 20): cannot find include file "stddef.h"
not in ./stddef.h
not in /home/lee/git/titan.core/Install/include/stddef.h
not in ./stddef.h
not in /usr/include/stddef.h
makedepend: warning: asdf.cc (reading /usr/include/string.h, line 17): cannot find include file "stddef.h"
not in ./stddef.h
not in /home/lee/git/titan.core/Install/include/stddef.h
not in ./stddef.h
not in /usr/include/stddef.h
makedepend: warning: asdf.cc (reading /home/lee/git/titan.core/Install/include/Port.hh, line 27): cannot find include file "stddef.h"
not in ./stddef.h
not in /home/lee/git/titan.core/Install/include/stddef.h
not in ./stddef.h
not in /usr/include/stddef.h
makedepend: warning: asdf.cc (reading /usr/include/sys/_intsup.h), line 71: #error "Unable to determine type definition of intptr_t"
makedepend: warning: asdf.cc (reading /usr/include/sys/_intsup.h), line 78: #error "Unable to determine type definition of int32_t"
makedepend: warning: asdf.cc (reading /usr/include/stdint.h), line 170: #error required type int_least8_t missing
makedepend: warning: asdf.cc (reading /usr/include/stdint.h), line 192: #error required type int_least16_t missing
makedepend: warning: asdf.cc (reading /usr/include/stdint.h), line 226: #error required type int_least32_t missing
"/usr/include/stdint.h":364: defined(__WCHAR_UNSIGNED__) || (L'\0' - 1 > 0)
^--- expecting )
"/usr/include/stdint.h":375: defined(__WCHAR_UNSIGNED__) || (L'\0' - 1 > 0)
^--- expecting )
makedepend: warning: asdf.cc (reading /home/lee/git/titan.core/Install/include/OOP.hh, line 18): cannot find include file "functional"
not in ./functional
not in /home/lee/git/titan.core/Install/include/functional
not in ./functional
not in /usr/include/functional
Operation finished successfully.
sh -c make all -j 8
Makefile:137: warning: overriding recipe for target '/cygdrive/c/Users/lee/MUNKA_NOBACKUP/_SWAT/TITAN/test'
Makefile:130: warning: ignoring old recipe for target '/cygdrive/c/Users/lee/MUNKA_NOBACKUP/_SWAT/TITAN/test'
g++ -c -DWIN32 -I. -I/home/lee/git/titan.core/Install/include -I. -Wall -O2 -o asdf.o asdf.cc
ar -r /cygdrive/c/Users/lee/MUNKA_NOBACKUP/_SWAT/TITAN/test wsp/asdf/bin/asdf.a asdf.o
g++ -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc -o wsp/asdf/bin/asdf.exe asdf.o \
-L/home/lee/git/titan.core/Install/lib -L/home/lee/git/titan.core/Install/lib -L/home/lee/git/titan.core/Install/lib \
-lttcn3-parallel -lcrypto \
-lxml2 \
|| if [ -f /home/lee/git/titan.core/Install/bin/titanver ]; then /home/lee/git/titan.core/Install/bin/titanver asdf.o ; else : ; fi
ar: creating /cygdrive/c/Users/lee/MUNKA_NOBACKUP/_SWAT/TITAN/test
ar: wsp/asdf/bin/asdf.a: No such file or directory
make: *** [Makefile:137: /cygdrive/c/Users/lee/MUNKA_NOBACKUP/_SWAT/TITAN/test] Error 1
make: *** Waiting for unfinished jobs....
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: cannot open output file wsp/asdf/bin/asdf.exe: No such file or directory
collect2: error: ld returned 1 exit status
Operation failed with return value: 2
```
It seems the compiler only takes into account the part of the path coming before or after the space.
## Possible fixes
## Titan version
8.1.0
## Platform details (OS type and version)
Microsoft Windows 10 Enterprise 10.0.19042
/cc @aknappqwt @mmagyarihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/683Fully unitialized constants are allowed by Titan2023-11-15T09:57:38ZLevente ErősFully unitialized constants are allowed by Titan## Summary
According to Section 10 point d) of the TTCN-3 standard, "The right-hand side of the assignment that initializes a constant shall evaluate to an object that is at least partially initialized."
## Steps and/or TTCN-3 code to ...## Summary
According to Section 10 point d) of the TTCN-3 standard, "The right-hand side of the assignment that initializes a constant shall evaluate to an object that is at least partially initialized."
## Steps and/or TTCN-3 code to reproduce
```
type record myRecord{
integer field1,
charstring field2 optional,
integer field3
}
type record mymultirecord{
myRecord A,
myRecord B
}
type record of integer roi;
testcase partly_init_constants() runs on ct_empty{
const mymultirecord cr := {A := {field1 := 1, field2 := -, field3 := -}, B := -};
const mymultirecord ct := {A := -, B := -}; //should cause an error
const roi iro := {}; //should cause an error
setverdict(pass);
}
```
## What is the current bug behavior?
The test case passes.
## What is the expected correct behavior?
The indicated lines shall cause an error, as those constants are not even partially initialized (they have unbound fields).
## Relevant logs and/or screenshots
## Possible fixes
## Titan version
8.1.0
## Platform details (OS type and version)
Microsoft Windows 10 Enterprise 10.0.19042
/cc @aknappqwt @mmagyariBotond BaranyiBotond Baranyihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/682Titan does not follow the standard wrt timer, component and port type constants.2023-01-25T14:49:38ZLevente ErősTitan does not follow the standard wrt timer, component and port type constants.## Summary
Titan does not allow for timer, and port type constants, while the TTCN-3 standard implies otherwise: "The only value that can be assigned to global constants of default, component, port or timer type or
component constants o...## Summary
Titan does not allow for timer, and port type constants, while the TTCN-3 standard implies otherwise: "The only value that can be assigned to global constants of default, component, port or timer type or
component constants of default or component types is the special value null." (Section 10, NOTE)
## Steps and/or TTCN-3 code to reproduce
Create a module and insert these rows:
```
type port mypt message{
inout charstring
}with{extension "internal"}
type component ct_empty{}
const default d := null;
const mypt p := null;
const ct_empty c := null;
const timer t := null;
```
The same happens if these constants are put in a component type, like:
```
type component ct_myctf{
const default d := null;
const mypt p := null;
const ct_empty c := null;
const timer t := null;
}
```
## What is the current bug behavior?
The port, and timer constants cause errors. However, they should be allowed in case being assigned the null value.
## What is the expected correct behavior?
None of the above lines should cause errors. Furthermore note:
- global default, component, port or timer type constants can only be assigned the null value
- current status: port and timer constants are not accepted on module level (note: except for default, there is no other possible value than null, on global level)
- component-level port or timer type constants can be assigned non-null values
- for port type constants, only non-null values are accepted on component level.
- for timer type constants, nothing is accepted on component level (there is no such thing as timer type btw)
- component-level default or component type constants can only be assigned the null value
- this seems to work.
## Relevant logs and/or screenshots
## Possible fixes
## Titan version
8.1.0
## Platform details (OS type and version)
Microsoft Windows 10 Enterprise 10.0.19042
/cc @aknappqwt @mmagyarihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/681Clashing enumerated identifiers unrecognized by Titan2023-11-15T09:57:46ZLevente ErősClashing enumerated identifiers unrecognized by Titan## Summary
According to sections 6.2.4 and 8.2.3.1 of the TTCN-3 standard, the identifier of a data element with an enumerated type cannot be identical to any element of the domain of the given enumerated type. For example, in the below...## Summary
According to sections 6.2.4 and 8.2.3.1 of the TTCN-3 standard, the identifier of a data element with an enumerated type cannot be identical to any element of the domain of the given enumerated type. For example, in the below example enumY cannot be the identifier of a MyEnumType variable for the following reason: When assigning enumY as the value of another MyEnumType variable enumW, it is ambiguous whether the value of variable enumY (which is enumX) or the emunerated domain value enumY is intended to be assigned to enumW.
## Steps and/or TTCN-3 code to reproduce
```
import from A all;
const MyEnumType2 enumX := enumY;// this is allowed as MyEnumtype2 does not contain enumX
testcase clashing_enum_value() runs on ct_empty{
var MyEnumType enumY := enumX; // this is not allowed as enumerated values restrict global names (see clause 6.2.4)
var MyEnumType enumW := enumY;
var MyEnumType enumZ;
enumZ := enumX; // allowed as MyEnumType does not contain enumZ and also, enumX resolves to domain element of type MyEnumType
//enumZ := modules.enumX; //ERROR but due to this resolving to local constant enumX, which is the expected behavior
setverdict(pass);
}
```
```
module A {
friend module modules;
type enumerated MyEnumType {enumX, enumY}
type enumerated MyEnumType2 {enumY, enumZ}
}
```
## What is the current bug behavior?
pass
## What is the expected correct behavior?
error
## Relevant logs and/or screenshots
## Possible fixes
## Titan version
8.1.0
## Platform details (OS type and version)
Microsoft Windows 10 Enterprise 10.0.19042
/cc @aknappqwt @mmagyarihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/680OOP: using class method return value as external function parameter2023-05-16T10:53:40ZBotond BaranyiOOP: using class method return value as external function parameterThe use of return values of class methods as actual parameters of external functions is not handled correctly by the compiler.
In the example below a class method returning a template is passed to a parameter expecting a value. This is n...The use of return values of class methods as actual parameters of external functions is not handled correctly by the compiler.
In the example below a class method returning a template is passed to a parameter expecting a value. This is not caught at compile-time, and it causes a C++ compilation error.
```
type record of integer IntList
with {
encode "JSON";
}
external function f_enc_il(in IntList x) return octetstring
with { extension "prototype(convert) encode(JSON)" }
type class ExampleClass {
private template IntList t := { 0, 1, 2, 3 }
public function get_list() return template IntList { return t; }
}
function test() {
var ExampleClass x := ExampleClass.create;
var octetstring res := f_enc_il(x.get_list()); // C++ compilation error
}
```
/cc @aknappqwt @mmagyariBotond BaranyiBotond Baranyihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/678importing imports does not work2023-11-15T09:57:56ZLevente Erősimporting imports does not work## Summary
The mechanism defined in Section 8.2.3.7 of the TTCN-3 standard for importing import statements does not work.
## Steps and/or TTCN-3 code to reproduce
In one module
```
import from chain1 {import all};
testcase importimpo...## Summary
The mechanism defined in Section 8.2.3.7 of the TTCN-3 standard for importing import statements does not work.
## Steps and/or TTCN-3 code to reproduce
In one module
```
import from chain1 {import all};
testcase importimport() runs on ct_empty{
// log(chain2const); //ERROR
// log(chain32const); //ERROR
log(chain33const); //should work
}
```
Furthermore the following modules are needed:
```
module chain1 {
private import from chain2 {import all}; //importing module does not see chain2const
import from chain22 {import all}; //importing module does not see chain32const
public import from chain23 {import all}; //importing module does see chain33const
}
```
```
module chain2 {
import from chain3 all;
}
```
```
module chain22 {
import from chain32 all;
}
```
```
module chain23 {
import from chain33 all;
}
```
```
module chain3 {
const integer chain2const := 1;
}
```
```
module chain32 {
const integer chain32const := 1;
}
```
```
module chain33 {
const integer chain33const := 1;
}
```
## What is the current bug behavior?
chain33const is not seen in the main module.
## What is the expected correct behavior?
chain33const shoulw be seen in the main module while the commented-out two constants should not be seen.
## Relevant logs and/or screenshots
## Possible fixes
## Titan version
8.1.0
## Platform details (OS type and version)
Microsoft Windows 10 Enterprise 10.0.19042
/cc @aknappqwt @mmagyarihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/677inter-language imports allowed from younger language2024-01-11T15:16:52ZLevente Erősinter-language imports allowed from younger language## Summary
According to Section 8.2.3, point c) of the TTCN-3 standard, "the TTCN-3 language specification in an import statement has to be lower or equal to the TTCN-3
language specification of the importing module".
## Steps and/or T...## Summary
According to Section 8.2.3, point c) of the TTCN-3 standard, "the TTCN-3 language specification in an import statement has to be lower or equal to the TTCN-3
language specification of the importing module".
## Steps and/or TTCN-3 code to reproduce
```
module modules language "TTCN-3:2003"{
type component ct_empty{}
import from F language "TTCN-3:2010" all; //ERROR```
testcase oldimport() runs on ct_empty{
var oldint voi := 1;
setverdict(pass);
}
}
```
also
```
module F language "TTCN-3:2010"{
type integer oldint
}
```
## What is the current bug behavior?
Code compiles and passes.
## What is the expected correct behavior?
Compilation or runtime error due to the import language clause being greater than the language clause of module ```modules```.
## Relevant logs and/or screenshots
## Possible fixes
## Titan version
8.1.0
## Platform details (OS type and version)
Microsoft Windows 10 Enterprise 10.0.19042
/cc @aknappqwt @mmagyariBotond BaranyiBotond Baranyihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/676Shifting and rotation operations are missing for string elements2023-05-16T10:55:10ZGábor SzalaiShifting and rotation operations are missing for string elements## Summary
The generated c++ code can't be compiled
## Steps and/or TTCN-3 code to reproduce
```
module proba {
control{
var octetstring rawRTCM3msg:='112233445566'O
var integer i:=oct2int(rawRTCM3msg[3] << 4);
log(i)
}
}
`...## Summary
The generated c++ code can't be compiled
## Steps and/or TTCN-3 code to reproduce
```
module proba {
control{
var octetstring rawRTCM3msg:='112233445566'O
var integer i:=oct2int(rawRTCM3msg[3] << 4);
log(i)
}
}
```
## What is the current bug behavior?
```
~/proba$ make
/home/ethgasz/TTCNv3/bin/compiler -L \
proba.ttcn - proba.ttcn
Notify: Parsing TTCN-3 module `proba.ttcn'...
Notify: Checking modules...
Notify: Generating code...
Notify: File `proba.cc' was updated.
Notify: 1 file was updated.
touch compile
g++ -c -DLINUX -I/home/ethgasz/TTCNv3/include -Wall -o proba.o proba.cc
proba.cc: In function ‘void proba::module_control_part()’:
proba.cc:44:68: error: no match for ‘operator<<’ (operand types are ‘const OCTETSTRING_ELEMENT’ and ‘int’)
44 | INTEGER i(oct2int((const_cast< const OCTETSTRING&>(rawRTCM3msg)[3] << 4)));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~ ~
| | |
| | int
| const OCTETSTRING_ELEMENT
make: *** [Makefile:148: proba.o] Error 1
```
## What is the expected correct behavior?
Working c++ code or error reported by the TITAN
## Titan version
Latest
/cc @aknappqwt @mmagyariBotond BaranyiBotond Baranyihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/672default as module parameter type is allowed in Titan2023-11-15T09:58:29ZLevente Erősdefault as module parameter type is allowed in Titan## Summary
According to Section 8.2.1, Restriction b), module parameters shall not be of default type. However, TITAN allows for this.
## Steps and/or TTCN-3 code to reproduce
```
module modules{
type component ct_empty{}
modulepar ...## Summary
According to Section 8.2.1, Restriction b), module parameters shall not be of default type. However, TITAN allows for this.
## Steps and/or TTCN-3 code to reproduce
```
module modules{
type component ct_empty{}
modulepar default d; //wrong
testcase mp_def_val() runs on ct_empty{
log(d);
}
control{
execute(mp_def_val());
}
}
```
## What is the current bug behavior?
unbound default is logged
## What is the expected correct behavior?
compliation error
## Relevant logs and/or screenshots
```
2022/Dec/06 08:57:24.298261 USER - <unbound>
```
## Possible fixes
## Titan version
8.1.0
## Platform details (OS type and version)
Microsoft Windows 10 Enterprise 10.0.19042
/cc @aknappqwt @mmagyariBotond BaranyiBotond Baranyihttps://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/671isvalue yields error for non-chosen field, while it should return false2023-11-20T07:33:07ZLevente Erősisvalue yields error for non-chosen field, while it should return false## Summary
According to Section 7.1.8.4, EXAMPLE 3, isvalue should yield false if its parameter is a non-chosen (sub)field of a union. Titan however, returns an error because of the referenced field not being the chosen one.
## Steps a...## Summary
According to Section 7.1.8.4, EXAMPLE 3, isvalue should yield false if its parameter is a non-chosen (sub)field of a union. Titan however, returns an error because of the referenced field not being the chosen one.
## Steps and/or TTCN-3 code to reproduce
```
type union MyUnion_isv {
integer ch1,
integer ch2
}
template MyUnion_isv mw_myUnion := { ch1 := ? }
type record MyRecord_isv {
MyUnion_isv u optional
}
template MyRecord_isv mw_myRecord := { u := mw_myUnion }
testcase isvalue_fun() runs on ct_empty{
var boolean v_checkResult := isvalue(mw_myUnion.ch2); // yields false
if(not v_checkResult){setverdict(pass);}else{setverdict(fail);}
v_checkResult := isvalue(mw_myRecord.u.ch2); // yields false
if(not v_checkResult){setverdict(pass);}else{setverdict(fail);}
v_checkResult := isvalue(m_myRecord.u.ch2); // yields false
if(not v_checkResult){setverdict(pass);}else{setverdict(fail);}
}
```
## What is the current bug behavior?
Error.
## What is the expected correct behavior?
Pass.
## Relevant logs and/or screenshots
```
../src/operators.ttcn:353.51-53: error: Reference to inactive field `ch2' in a template of union type `@operators.MyUnion_isv'. The active field is `ch1'.
```
## Possible fixes
## Titan version
8.1.0
## Platform details (OS type and version)
Microsoft Windows 10 Enterprise 10.0.19042
/cc @aknappqwt @mmagyariBotond BaranyiBotond Baranyi