Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Titan 6.1.0 TEXT encoder trouble(module with TEXT encoding works on 6.3.0 but not 6.1.0)
Titan 6.1.0 TEXT encoder trouble [message #1778305] Tue, 12 December 2017 23:27 Go to next message
Harald Welte is currently offline Harald WelteFriend
Messages: 48
Registered: July 2017
Location: Berlin, Germany
Member

I have a rather simple module using the TEXT encoder, see
http://git.osmocom.org/osmo-ttcn3-hacks/tree/library/Osmocom_CTRL_Types.ttcn

This builds fine with TITAN 6.3.0, but it fails with 6.1.0 for no obvious reason.
TITAN 6.1.0 complains with:

Osmocom_CTRL_Types.ttcn: In TTCN-3 module `Osmocom_CTRL_Types':
 Osmocom_CTRL_Types.ttcn:60.1-70: In external function definition `enc_CtrlMessage':
  Osmocom_CTRL_Types.ttcn:60.38-48: error: Input type `@Osmocom_CTRL_Types.CtrlMessage' does not support TEXT encoding
 Osmocom_CTRL_Types.ttcn:63.1-70: In external function definition `dec_CtrlMessage':
  Osmocom_CTRL_Types.ttcn:63.60-70: error: Output type `@Osmocom_CTRL_Types.CtrlMessage' does not support TEXT encoding


but the entire Osmocom_CTRL_Types module has { encoding "TEXT" }. I tried to add an empty { variant ""} or an explicit { encoding "TEXT" } to the CtrlMessage definition, but it didn't work.

The exact same source code builds fine with 6.3.0. How can I make it build with 6.1.0?

Thanks in advance.
Re: Titan 6.1.0 TEXT encoder trouble [message #1778306 is a reply to message #1778305] Tue, 12 December 2017 23:29 Go to previous messageGo to next message
Harald Welte is currently offline Harald WelteFriend
Messages: 48
Registered: July 2017
Location: Berlin, Germany
Member

Interestingly, a rather similar looking MGCP_Types.ttcn (see http://git.osmocom.org/osmo-ttcn3-hacks/tree/library/MGCP_Types.ttcn) is building fine, despite using the same syntax and the same "TEXT" encoder features. What am I missing?
Re: Titan 6.1.0 TEXT encoder trouble [message #1778329 is a reply to message #1778306] Wed, 13 December 2017 08:10 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 807
Registered: January 2015
Senior Member
Hi Harald,

hmm, puzzling,
I have tried with 6.1.0 and it worked for me:

ll                                                        
total 20                                                                                                
drwxr-xr-x 2 ethlel rnd 4096 Dec 13 09:05 ./                                                            
drwx--x--x 5 ethlel rnd 4096 Dec 13 09:01 ../                                                           
-rw-r--r-- 1 ethlel rnd 5125 Dec 13 09:02 Makefile                                                      
-rw-r--r-- 1 ethlel rnd 2813 Dec 13 09:02 Osmocom_CTRL_Types.ttcn                                       
esekilxxen1845 [9:05] [ethlel/Harald/TEXT] -> compiler -v                                               
TTCN-3 and ASN.1 Compiler for the TTCN-3 Test Executor                                                  
Product number: CRL 113 200/6 R1A                                                                       
Build date: Dec 13 2016 13:20:12                                                                        
Compiled with: GCC 4.3.4                                                                                

Copyright (c) 2000-2016 Ericsson Telecom AB


Using OpenSSL 0.9.8h 28 May 2008

esekilxxen1845 [9:05] [ethlel/Harald/TEXT] -> make
/app/TITAN/6_R1A/LMWP3.1/bin/compiler -L  \
        Osmocom_CTRL_Types.ttcn  - Osmocom_CTRL_Types.ttcn
Notify: Parsing TTCN-3 module `Osmocom_CTRL_Types.ttcn'...
Osmocom_CTRL_Types.ttcn:14.39-88: In character string pattern:
 Osmocom_CTRL_Types.ttcn:14.44-45: warning: Use of unrecognized escape sequence `\{' is deprecated
 Osmocom_CTRL_Types.ttcn:14.46-47: warning: Use of unrecognized escape sequence `\}' is deprecated
Notify: Checking modules...
Notify: Generating code...
Notify: File `Osmocom_CTRL_Types.hh' was generated.
Notify: File `Osmocom_CTRL_Types.cc' was generated.
Notify: 2 files were updated.
touch compile
g++  -c -DLINUX -I/app/TITAN/6_R1A/LMWP3.1/include -Wall   -o Osmocom_CTRL_Types.o Osmocom_CTRL_Types.cc
if g++   -o Osmocom_CTRL_Types Osmocom_CTRL_Types.o  \
        -L/app/TITAN/6_R1A/LMWP3.1/lib -lttcn3-parallel \
        -L/app/TITAN/6_R1A/LMWP3.1/lib -lcrypto \
        -L/app/TITAN/6_R1A/LMWP3.1/lib -lxml2 -lpthread -lrt; \
        then : ; else /app/TITAN/6_R1A/LMWP3.1/bin/titanver Osmocom_CTRL_Types.o ; exit 1; fi


I will keep investigating; your binary was downloaded or you built it yourself?

If you do a make clean before make you end up with the same result?
It's always a good idea to clean up before switching compiler versions.


BR

Elemer
Re: Titan 6.1.0 TEXT encoder trouble [message #1778330 is a reply to message #1778329] Wed, 13 December 2017 08:34 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 807
Registered: January 2015
Senior Member
Hi Harald,
I have also built quickly 6.1.0 from github source, with the same result(on a different machine this time):

james00@GlobalWarning1:~/Harald/TEXT$ ll
total 36
drwxr-xr-x 2 james00 xampp 4096 Dec 13 09:27 ./
drwxr-xr-x 4 james00 xampp 4096 Dec 13 09:24 ../
-rw-r--r-- 1 james00 xampp 5044 Dec 13 09:26 Makefile
-rw-r--r-- 1 james00 xampp 2691 Dec 13 09:26 Osmocom_CTRL_Types.ttcn
james00@GlobalWarning1:~/Harald/TEXT$ compiler -v
TTCN-3 and ASN.1 Compiler for the TTCN-3 Test Executor
Product number: CRL 113 200/6 R1A
Build date: Dec 13 2017 09:18:07
Compiled with: GCC 4.8.4

Copyright (c) 2000-2016 Ericsson Telecom AB

james00@GlobalWarning1:~/Harald/TEXT$ make
/home/james00/titan.core/Install/bin/compiler -L  \
	Osmocom_CTRL_Types.ttcn  - Osmocom_CTRL_Types.ttcn
Notify: Parsing TTCN-3 module `Osmocom_CTRL_Types.ttcn'...
Osmocom_CTRL_Types.ttcn:14.39-88: In character string pattern:
 Osmocom_CTRL_Types.ttcn:14.44-45: warning: Use of unrecognized escape sequence `\{' is deprecated
 Osmocom_CTRL_Types.ttcn:14.46-47: warning: Use of unrecognized escape sequence `\}' is deprecated
Notify: Checking modules...
Notify: Generating code...
Notify: File `Osmocom_CTRL_Types.hh' was generated.
Notify: File `Osmocom_CTRL_Types.cc' was generated.
Notify: 2 files were updated.
touch compile
g++  -c -DLINUX -I/home/james00/titan.core/Install/include -Wall   -o Osmocom_CTRL_Types.o Osmocom_CTRL_Types.cc
if g++   -o Osmocom_CTRL_Types Osmocom_CTRL_Types.o  \
	-L/home/james00/titan.core/Install/lib -lttcn3-parallel \
	-L/lib -lcrypto \
	-L/home/james00/titan.core/Install/lib -lxml2; \
	then : ; else /home/james00/titan.core/Install/bin/titanver Osmocom_CTRL_Types.o ; exit 1; fi 


So it's still a mistery....

Re: Titan 6.1.0 TEXT encoder trouble [message #1778348 is a reply to message #1778330] Wed, 13 December 2017 10:17 Go to previous messageGo to next message
Harald Welte is currently offline Harald WelteFriend
Messages: 48
Registered: July 2017
Location: Berlin, Germany
Member

Thanks for trying. Late last night I found a workaround, but I don't understand why it's needed, and why it fails with such a cryptic error message. Any idea?

See http://git.osmocom.org/osmo-ttcn3-hacks/commit/?id=16979760b22a28f696509e5d69edd4d37e3155ca for the workaround. Without that patch applied, the error appears on 6.1.0.
Re: Titan 6.1.0 TEXT encoder trouble [message #1778354 is a reply to message #1778348] Wed, 13 December 2017 11:25 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 807
Registered: January 2015
Senior Member
Hi Harald,

then I tried the already corrected version :)



I suspect the following happens:


your top level type is a union; the codec expects instructions to differentiate between the branches ; if it can't find any, then it stops and says:" I don't move from here unless you give me something to lock on";
It does not go one layer deeper to verify if there are any further variants.


I believe this logic will come back when encoding/decoding:

it's better to have the encoding variants as early as possible so e.g. the decoder can take a quick decision;
So I'd suggest you move the variants upwards to the union, else it may happen that when decoding the codec feels left with insufficient information.

So even if this is technically a fault, I'm uncertain if we should correct it.

Please bear in mind that codecs are not meant to be very intelligent as this would come to the detriment of speed of execution.


Please let me know your take on this

BR

Elemer



Re: Titan 6.1.0 TEXT encoder trouble [message #1778366 is a reply to message #1778354] Wed, 13 December 2017 14:15 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 807
Registered: January 2015
Senior Member
Hi Harald,

a few additional notes:

-this was a known behaviour of the TEXT codec, if you look into the SMTP protocol module

https://github.com/eclipse/titan.ProtocolModules.SMTP

you will see a similar construct:

:
type union SMTP_PDU {
  SMTP_Command      command,
  SMTP_Reply        smtp_reply,
  SMTP_Raw          raw_data
} with {variant "TEXT_CODING()"}

} with { encode "TEXT" }



the dummy with {variant "TEXT_CODING()"} does the same as your addition

It appears that this behaviour changed post 6.1.0 and it's likely a side effect of
a correction implemented in this time period.
Can't say now if its a beneficial or otherwise side effect though.

We will look into it.

BR
Elemer
Re: Titan 6.1.0 TEXT encoder trouble [message #1778436 is a reply to message #1778366] Thu, 14 December 2017 09:26 Go to previous message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 807
Registered: January 2015
Senior Member
Hi Harald,

OK, here's the ultimate summary:

up until 6.2.0 the requirement was that on the top level type one needed at least a dummy TEXT codec instruction , e.g. an empty 'with {variant "TEXT_CODING()"}' , in order to have the TEXT codecs generated.
(This was a side effect of Titan supporting multiple encodings in an unofficial manner)
see Encoding text-based protocols in Titan
https://www.eclipse.org/forums/index.php/t/1075053/


From 6.3.0 there are two possible modes:

-the legacy mode triggered by the usage of the "-e" compiler flag
Under this mode the dummy TEXT codec instruction is required as before

-the new mode working as default ( w/o the "-e" flag) which supports the standard multiple encoding
In this mode the dummy TEXT codec instruction is not anymore required
but of course its presence causes no problems

I hope this helps somewhat


BR

Elemer




Previous Topic: Error "Restriction 'value' on template does not allow usage of this"
Next Topic:Eclipse Titan 6.3.0 released, binaries available
Goto Forum:
  


Current Time: Thu Sep 20 00:45:21 GMT 2018

Powered by FUDForum. Page generated in 0.01807 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top