Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Titan compiler crashing while compilation
Titan compiler crashing while compilation [message #1738327] Tue, 19 July 2016 06:40 Go to next message
murli sharma is currently offline murli sharmaFriend
Messages: 85
Registered: November 2015
Member
Hi,

While compiling a ttcn script, the Titan compile is crashing in the following function:
void Value::generate_code_expr(expression_struct *expr)

The crash is in the default case of the switch, in the following line:
default:
        FATAL_ERROR("Value::generate_code_expr(%d)", valuetype);


I'm not able to determine which line of ttcn is causing this crash. Is there a way to know that? By printing some variable in the Titan code maybe?

Thanks
Murli
Re: Titan compiler crashing while compilation [message #1738331 is a reply to message #1738327] Tue, 19 July 2016 06:57 Go to previous messageGo to next message
murli sharma is currently offline murli sharmaFriend
Messages: 85
Registered: November 2015
Member
Adding more details:
value.cc
void Value::generate_code_expr(expression_struct *expr)
{
default:
FATAL_ERROR("Value::generate_code_expr(%d)", valuetype);
}
=> in this valuetype is 34 enum value, it looks V_NOTUSED, /**< not used symbol ('-') */
But I'm not able to determine which line of my ttcn script is causing this crash.
Is there any way to add some debug info in titan code to get the exact line in ttcn script which causing crash.
Re: Titan compiler crashing while compilation [message #1738334 is a reply to message #1738331] Tue, 19 July 2016 07:11 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Murli,

Please send me the code that is being compiled and causing the error ; else, please try to reduce the fault to an example by eliminating code parts that are not relevant.

Best regards
Elemer




Re: Titan compiler crashing while compilation [message #1738692 is a reply to message #1738334] Fri, 22 July 2016 10:03 Go to previous messageGo to next message
murli sharma is currently offline murli sharmaFriend
Messages: 85
Registered: November 2015
Member
Hi Elemer,

Please find attached the code in which I'm getting crash while compilation.

Thanks

[Updated on: Fri, 22 July 2016 12:52]

Report message to a moderator

Re: Titan compiler crashing while compilation [message #1738702 is a reply to message #1738692] Fri, 22 July 2016 12:30 Go to previous messageGo to next message
Botond Baranyi is currently offline Botond BaranyiFriend
Messages: 53
Registered: February 2016
Member
Hi,

The faulty code line is line 144724 in HSD_ENH_r5_wk37.ttcn:

GVC_.tcv_Res := o_AuthRspChk(valueof(GVC_.tcv_AuthRsp), {}, valueof(GVC_.tcv_AuthK), valueof(GVC_.tcv_AuthRAND), false);

An empty record value is passed as the function's second parameter.The compiler should have caught this during semantic analysis and should have displayed a more desrciptive error message (I've created a bug report for this issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=498337).

As a workaround please avoid using incomplete values as function parameters.

Best regards,
Botond Baranyi
Re: Titan compiler crashing while compilation [message #1738711 is a reply to message #1738702] Fri, 22 July 2016 13:03 Go to previous messageGo to next message
murli sharma is currently offline murli sharmaFriend
Messages: 85
Registered: November 2015
Member
Hello Botond,
Thanks a lot for your valuable input.
Could you please explain us, how did you identify the exact Error line in TTCN script.

Regards,
Murli
Re: Titan compiler crashing while compilation [message #1738715 is a reply to message #1738711] Fri, 22 July 2016 13:43 Go to previous messageGo to next message
Botond Baranyi is currently offline Botond BaranyiFriend
Messages: 53
Registered: February 2016
Member
No Message Body
Re: Titan compiler crashing while compilation [message #1738718 is a reply to message #1738715] Fri, 22 July 2016 14:01 Go to previous message
Botond Baranyi is currently offline Botond BaranyiFriend
Messages: 53
Registered: February 2016
Member
Hi Murli,

I usually insert 'printf's into to the TITAN code to determine which functions were called and the values of certain variables, starting from the line that caused the error.

In this case I only needed to print the 'full name' of the value that triggered the fatal error:

default:
        printf("%s\n", get_fullname().c_str());
        FATAL_ERROR("Value::generate_code_expr(%d)", valuetype);
}


Which resulted in:

@HSD_ENH_wk37.ts_GPRS_Authentication.<statement_block>.stmt_8.ags.ag_2.block.stmt_4.ass.<parameter2>

This string indicates where the value is:
in module HSD_ENH_wk37
in function ts_GPRS_Authentication
in the function's statement block
in the 8th statement within the block
in the alt guards
in the 2nd alt guard
in the alt guard's statement block
in the 4th statement within the block
in the assignment within the statement
the value is the 2nd parameter in the assigment

Hope this helps.

Best regards,
Botond Baranyi
Previous Topic:Catching dynamic testcase errors
Next Topic:The unfinished business of multiple encodings
Goto Forum:
  


Current Time: Tue Apr 23 09:10:39 GMT 2024

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

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

Back to the top