Dear Maintainer,
I tried to have a look at this hanging test and could
reproduce a hang at this backtrace [1].
The loop in [2] gets not left because the result of the fgetc call
gets stored in a variable of type char and later compared to EOF.
It seems to be an issue with not being explicit
about signed/unsigned char with this variable.
At least using the type int makes the test finish and pass,
when libgatbcore3 is built with attached patch.
Kind regards,
Bernhard
[1]
(gdb) bt
#0 gatb::core::system::impl::CommonFile::gets (this=0x55839ffbb0,
s=, size=) at
./gatb-core/src/gatb/system/impl/FileSystemCommon.hpp:103
#1 0x0076c633ee38 in gatb::core::bank::impl::BankAlbum::BankAlbum
(this=this@entry=0x55839fc860,
name="/tmp/autopkgtest.iSjXKJ/autopkgtest_tmp/simka_temp_output/simka_output_temp//input/A",
deleteIfExists=deleteIfExists@entry=false, __in_chrg=,
__vtt_parm=) at ./gatb-core/src/gatb/bank/impl/BankAlbum.cpp:64
#2 0x0076c633f6a4 in
gatb::core::bank::impl::BankAlbumFactory::createBank (this=,
uri="/tmp/autopkgtest.iSjXKJ/autopkgtest_tmp/simka_temp_output/simka_output_temp//input/A")
at ./gatb-core/src/gatb/bank/impl/BankAlbum.cpp:343
#3 0x0076c633c1a8 in gatb::core::bank::impl::Bank::_open_
(this=this@entry=0x555bb42388
,
uri="/tmp/autopkgtest.iSjXKJ/autopkgtest_tmp/simka_temp_output/simka_output_temp//input/A")
at ./gatb-core/src/gatb/bank/impl/Bank.cpp:150
#4 0x00555bb0b704 in gatb::core::bank::impl::Bank::open
(uri="/tmp/autopkgtest.iSjXKJ/autopkgtest_tmp/simka_temp_output/simka_output_temp//input/A")
at /usr/include/gatb/bank/impl/Bank.hpp:135
#5 SimkaAlgorithm<32ul>::isInputValid (this=0x7fd3195140) at
/build/simka-C4DX5D/simka-1.5.2/src/core/SimkaAlgorithm.cpp:362
#6 0x00555baf9264 in SimkaPotaraAlgorithm<32ul>::execute
(this=0x7fd3195140) at /build/simka-C4DX5D/simka-1.5.2/src/SimkaPotara.hpp:413
#7 0x00555badc9e4 in Functor<32ul>::operator() (this=,
p=...) at /build/simka-C4DX5D/simka-1.5.2/src/SimkaPotara.cpp:111
#8
gatb::core::tools::math::IntegerTemplate,
mpl_::int_<64>, mpl_::int_<96>, mpl_::int_<128> > >::Apply, mpl_::int_<64>, mpl_::int_<96>,
mpl_::int_<128> >, false>::execute (params=..., kmerSize=) at
/usr/include/gatb/tools/math/Integer.hpp:463
#9
gatb::core::tools::math::IntegerTemplate,
mpl_::int_<64>, mpl_::int_<96>, mpl_::int_<128> > >::apply
(params=..., kmerSize=) at
/usr/include/gatb/tools/math/Integer.hpp:84
#10 SimkaPotara::execute (this=) at
/build/simka-C4DX5D/simka-1.5.2/src/SimkaPotara.cpp:140
#11 0x0076c6428020 in gatb::core::tools::misc::impl::Tool::run
(this=0x7fd31955d8, input=) at
./gatb-core/src/gatb/tools/misc/impl/Tool.cpp:158
#12 0x0076c64277c8 in gatb::core::tools::misc::impl::Tool::run
(this=0x7fd31955d8, argc=7, argv=0x7fd3195848) at
./gatb-core/src/gatb/tools/misc/impl/Tool.cpp:112
#13 0x00555bad97bc in main (argc=7, argv=0x7fd3195848) at
/usr/include/c++/10/ext/new_allocator.h:79
[2]
https://sources.debian.org/src/gatb-core/1.4.2+dfsg-5/gatb-core/src/gatb/system/impl/FileSystemCommon.hpp/#L103
Description: Use int as return of fgetc
Author: Bernhard Übelacker
Bug-Debian: https://bugs.debian.org/954273
Forwarded: no
Last-Update: 2020-11-03
Index: gatb-core-1.4.2+dfsg/gatb-core/src/gatb/system/impl/FileSystemCommon.hpp
===
--- gatb-core-1.4.2+dfsg.orig/gatb-core/src/gatb/system/impl/FileSystemCommon.hpp
+++ gatb-core-1.4.2+dfsg/gatb-core/src/gatb/system/impl/FileSystemCommon.hpp
@@ -100,7 +100,7 @@ public:
result = strlen (tmp);
/** we skip all characters until we reach the next '\n'. */
-if (result > 0) { for (char c = tmp[result-1]; c !='\n' && c!=EOF; c = fgetc (getHandle())) {} }
+if (result > 0) { for (int c = tmp[result-1]; c !='\n' && c!=EOF; c = fgetc (getHandle())) {} }
}
/** We return the result. */
# Unstable chroot 2020-11-03 running on Android/LineageOS kernel
root@localhost:~# lscpu
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 4,5
Off-line CPU(s) list: 0-3,6,7
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s):1
Vendor ID:ARM
Model:1
Model name: Cortex-A53
Stepping: r0p1
CPU max MHz: 1113,6000
CPU min MHz: 249,6000
Flags:fp asimd evtstrm aes pmull sha1 sha2 crc32
root@localhost:~# uname -a
Linux localhost 3.10.108-g5285e19 #1 SMP PREEMPT Fri Oct 26 18:55:56 CEST 2018
aarch64 GNU/Linux
apt update
apt dist-upgrade
apt install mc htop psmisc net-tools strace quilt autopkgtest gdb valgrind
simka simkamin simka-dbgsym libgatbcore3-dbgsym
apt build-dep simka
apt build-dep gatb-core
mkdir /home/media_rw/source/libgatbcore3/orig -p
cd