[DEBUG-ONLY] Expecting %YDB-E-ICUSYMNOTFOUND error but got an assert failure in sr_unix/ydb_init.c instead
Final Release Note
Description
This is something I noticed while running the bats tests in YDBOcto (test_errors/TERR018 subtest where it tests for the ICUSYMNOTFOUND error) using a Debug build of YottaDB r1.34. It assert failed as seen below. The Release build of r1.34 works fine.
r1.32 Debug build
$ sh ydb_init.sh
ydb_init() returned status = 150381514
ydb_zstatus() returned : 150381514,(Call-In),%YDB-E-ICUSYMNOTFOUND, Symbol u_getVersion not found in the ICU libraries. ICU needs to be built with symbol-renaming disabled or ydb_icu_version/gtm_icu_version environment variable needs to be properly specified,%YDB-I-TEXT, /lib/x86_64-linux-gnu/libicuio.so: undefined symbol: u_getVersion
r1.34 Debug build
$ sh ydb_init.sh
%YDB-F-ASSERT, Assert failed in sr_unix/ydb_init.c line 265 for expression (prev_intrpt_state == intrpt_ok_state)
Test script and C program
$ cat ydb_init.sh
export ydb_chset=M LC_ALL=C gcc ydb_init.c $(pkg-config --libs --cflags yottadb) -o ydbinit
unset ydb_icu_version gtm_icu_version
ydb_chset=UTF-8 LC_ALL=en_US.UTF8 ./ydbinit
$ cat ydb_init.c
#include "libyottadb.h"
#include <stdio.h>
int main()
{
int status;
char errbuf[1024];
status = ydb_init();
if (YDB_OK != status)
{
ydb_zstatus(errbuf, sizeof(errbuf));
printf("ydb_init() returned status = %d\n", status);
printf("ydb_zstatus() returned : %s\n", errbuf);
fflush(stdout);
}
}
It is most likely an issue only in the Debug build. But it is not clear why this worked fine in r1.32 Debug build and started failing only in r1.34. Needs some investigation.
Draft Release Note
No user visible issue. No release note needed.
Edited by Narayanan Iyer