It seems that this is not a problem with the asn1c library. There is a bug in ogs_calloc()/ogs_free().
I've changed memory alloc()/free() as below.
And then, the source code is modified like the following.
diff --git a/lib/asn1c/common/asn_internal.h b/lib/asn1c/common/asn_internal.h
index 77e005f7..d561043b 100644
--- a/lib/asn1c/common/asn_internal.h
+++ b/lib/asn1c/common/asn_internal.h
@@ -23,7 +23,7 @@ extern "C" {
#define ASN1C_ENVIRONMENT_VERSION 923 /* Compile-time version */
int get_asn1c_environment_version(void); /* Run-time version */
-#if 0 /* modified by acetcom */
+#if 1 /* modified by acetcom */
#define CALLOC(nmemb, size) calloc(nmemb, size)
#define MALLOC(size) malloc(size)
#define REALLOC(oldptr, size) realloc(oldptr, size)
So, s1ap encoder/decoder is executed with system's calloc()/free().
And then, run the following command.
$ ./test/testcsfb crash-test
The above test is not crashed.
Of course, if ogs_calloc()/ogs_free() is used, the above test command is crashed.
So, I need to analyze what the bug of ogs-memory.c raise this crash.
Thanks!