Skip to content

ttcn3_logformat: SIGABRT due to memory corruption

Summary

ttcn3_logformat crashes while processing one of the merged logging files generated by ttcn3-s1gw-test.

Steps and/or TTCN-3 code to reproduce

Try to run ttcn3_logformat on the attached logging file (merged and compressed):

zcat S1GW_Tests.TC_conn_term_by_mme.merged.gz | ttcn3_logformat /dev/stdin > /dev/null

S1GW_Tests.TC_conn_term_by_mme.merged.gz

What is the current bug behavior?

The program aborts and generates a coredump.

What is the expected correct behavior?

The program should not crash.

Relevant logs and/or screenshots

fixeria@LEGION:/home/fixeria/ws$ zcat S1GW_Tests.TC_conn_term_by_mme.merged.gz | ttcn3_logformat /dev/stdin > /dev/null 
logformat.l:85: Fatal error: memory corruption detected at block end when reallocating pointer 0x6051502a3a70.
logformat.l:194: Last freed here.
Aborted (core dumped)

fixeria@LEGION:~$ coredumpctl gdb 410982
Reading symbols from /opt/eclipse-titan/bin/ttcn3_logformat...
[New LWP 410982]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `ttcn3_logformat /dev/stdin'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007ed5a23813f4 in ?? () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ed5a23813f4 in ?? () from /usr/lib/libc.so.6
#1  0x00007ed5a2328120 in raise () from /usr/lib/libc.so.6
#2  0x00007ed5a230f4c3 in abort () from /usr/lib/libc.so.6
#3  0x000060513ea7093c in check_magic_values (filename=0x60513ea75994 "logformat.l", line=85, block_ptr=0x6051502a3a40, is_realloc=1) at memory.c:201
#4  0x000060513ea70c80 in Realloc_dbg (filename=0x60513ea75994 "logformat.l", line=85, ptr=0x6051502a3a70, size=2048) at memory.c:443
#5  0x000060513ea6d4d6 in append_char (c=114 'r') at /usr/src/debug/eclipse-titan/titan.core-10.1.2/repgen/logformat.l:85
#6  0x000060513ea6e7cb in yylex () at /usr/src/debug/eclipse-titan/titan.core-10.1.2/repgen/logformat.l:399
#7  0x000060513ea70589 in main (argc=2, argv=0x7ffc30f6baf8) at /usr/src/debug/eclipse-titan/titan.core-10.1.2/repgen/logformat.l:544

Titan version

TTCN-3 and ASN.1 Compiler for the TTCN-3 Test Executor
Version: 10.1.2
Build date: Sep 17 2024 17:55:31
Compiled with: GCC 14.2.1
Using OpenSSL 3.3.2 3 Sep 2024

Platform details (OS type and version)

Arch Linux https://aur.archlinux.org/packages/eclipse-titan

/cc @aknappqwt @mmagyari