Dushistov / sdcv

https://dushistov.github.io/sdcv/
GNU General Public License v2.0
289 stars 42 forks source link

32-bit builds failing tests on Alpine #86

Closed sodface closed 1 year ago

sodface commented 1 year ago

Hello, I maintain the sdcv package for Alpine Linux. I was a little late with the 0.5.4 upgrade, just submitted the MR today and all 32-bit builds are failing tests while 64-bit seems fine. I will try to look at this later but wanted to file the report in case you wanted to look at the build logs here:

https://gitlab.alpinelinux.org/sodface/aports/-/pipelines/133177

sodface commented 1 year ago

The 32bit test failures start with this commit:

https://github.com/Dushistov/sdcv/commit/911fc2f561af7501c2345da9c147c936671fc582

sodface commented 1 year ago

I haven't figured this out yet but I did notice that on x86_64 and aarch64, which pass all tests, if you pass a dictionary that doesn't exist you get an error back. Are you seeing this?

(aarch64)server:/srv/aports/local/sdcv$ sdcv -2 $(pwd)/src/sdcv-0.5.4/tests/stardict-test_dict-2.4.2 -n -u test_dict test 
save to cache /srv/aports/local/sdcv/src/sdcv-0.5.4/tests/stardict-test_dict-2.4.2/test_dict.idx
Found 1 items, similar to test.
-->test_dict
-->test

test passed

(aarch64)server:/srv/aports/local/sdcv$ sdcv -2 $(pwd)/src/sdcv-0.5.4/tests/stardict-test_dict-2.4.2 -n -u foo test 
Internal error: map::at
(aarch64)server:/srv/aports/local/sdcv$ 

On x86_64:

server:~$ sdcv -u foo test
Internal error: map::at
Dushistov commented 1 year ago

Are you seeing this?

Yes, it reproducible on amd64 as well, so I created separate issue for this one #87 87

sodface commented 1 year ago

This is from x86 build using one of the test case commands. Does this help at all?

(gdb) run
Starting program: /usr/bin/sdcv -e -n --data-dir /srv/aports/local/sdcv/src/sdcv-0.5.4/tests/stardict-test_synonyms-2.4.2/ -u Test\ synonyms testawordies

Program received signal SIGSEGV, Segmentation fault.
get_meta (p=p@entry=0x656d6100 <error: Cannot access memory at address 0x656d6100>) at src/malloc/mallocng/meta.h:133
133 src/malloc/mallocng/meta.h: No such file or directory.
(gdb) bt 
#0  get_meta (p=p@entry=0x656d6100 <error: Cannot access memory at address 0x656d6100>) at src/malloc/mallocng/meta.h:133
#1  0xf7f88583 in __libc_free (p=0x656d6100) at src/malloc/mallocng/free.c:105
#2  0x56565431 in DictData::close (this=0xf7e2b860) at /srv/aports/local/sdcv/src/sdcv-0.5.4/src/dictziplib.cpp:334
#3  0x5655f3dc in DictData::~DictData (this=0xf7e2b860, __in_chrg=<optimized out>) at /srv/aports/local/sdcv/src/sdcv-0.5.4/src/dictziplib.hpp:22
#4  std::default_delete<DictData>::operator() (__ptr=0xf7e2b860, this=<optimized out>) at /usr/include/c++/11.2.1/bits/unique_ptr.h:85
#5  0x565641ca in std::default_delete<DictData>::operator() (this=0xf7b7fc1c, __ptr=<optimized out>) at /usr/include/c++/11.2.1/bits/unique_ptr.h:79
#6  std::unique_ptr<DictData, std::default_delete<DictData> >::~unique_ptr (this=0xf7b7fc1c, __in_chrg=<optimized out>) at /usr/include/c++/11.2.1/bits/unique_ptr.h:361
#7  DictBase::~DictBase (this=0xf7b7fc00, __in_chrg=<optimized out>) at /srv/aports/local/sdcv/src/sdcv-0.5.4/src/stardict_lib.hpp:47
#8  Dict::~Dict (this=0xf7b7fc00, __in_chrg=<optimized out>) at /srv/aports/local/sdcv/src/sdcv-0.5.4/src/stardict_lib.hpp:121
#9  0x56563ea9 in Libs::load_dict (this=0xffffda58, url=...) at /srv/aports/local/sdcv/src/sdcv-0.5.4/src/stardict_lib.cpp:1012
#10 0x5655e878 in std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)>::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) const (this=0xffffd8f4, __args#0=..., __args#1=<optimized out>) at /usr/include/c++/11.2.1/bits/std_function.h:590
#11 0x5655e5c4 in for_each_file(std::__cxx11::list<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::list<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::__cxx11::list<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)> const&) (dirs_list=..., suff=..., order_list=..., disable_list=..., f=...)
    at /srv/aports/local/sdcv/src/sdcv-0.5.4/src/utils.cpp:88
#12 0x5655f9dd in Libs::load (this=0xffffda58, dicts_dirs=..., order_list=..., disable_list=...) at /srv/aports/local/sdcv/src/sdcv-0.5.4/src/stardict_lib.cpp:1019
#13 0x56559b1b in main (argc=<optimized out>, argv=<optimized out>) at /srv/aports/local/sdcv/src/sdcv-0.5.4/src/sdcv.cpp:215
sodface commented 1 year ago

32bit builds are now passing using this commit, thanks! https://gitlab.alpinelinux.org/sodface/aports/-/pipelines/136614