×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

KStars crashes when adding a custom CSV catalog

  • Posts: 62
  • Thank you received: 8
Hi,

On latest KStars on Stellarmate fully up to date, trying to add a custom catalog crashes KStars.

Steps to reproduces:

1) load attached csv file
2) map fields
3) click Preview
4) Kstars crashes

The test file is taken from here from which I kept only the 3 first lines for the test.

Here are the last lines from strace:

writev(3, [{iov_base=";\3\5\0F\0 \2\0\0\0\0\v\0B\2P\0\36\0\202\3\n\0@\0 \2F\0 \2"..., iov_len=76}], 1) = 76
write(2, "terminate called after throwing "..., 48terminate called after throwing an instance of ') = 48
write(2, "std::out_of_range", 17std::out_of_range) = 17
write(2, "'\n", 2'
) = 2
write(2, " what(): ", 11 what(): ) = 11
write(2, "_Map_base::at", 13_Map_base::at) = 13
write(2, "\n", 1
) = 1
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
getpid() = 30079
gettid() = 30079
tgkill(30079, 30079, SIGABRT) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=30079, si_uid=1000} ---
+++ killed by SIGABRT +++
[1] 30076 abort strace kstars


Hope it helps.
1 year 10 months ago #82810
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 62
  • Thank you received: 8
A bit more information on this bug. I ran kstars throught gdb and loaded a custom test catalog. Once it crashed, i issued bt and got this:
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
 
Thread 1 "kstars" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: Aucun fichier ou dossier de ce type.
(gdb) bt
#0  0xb3a28f14 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0xb3a14230 in __GI_abort () at abort.c:79
#2  0xb3c6e8d8 in __gnu_cxx::__verbose_terminate_handler() () at /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#3  0xb3c6c5b0 in  () at /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#4  0xb3c6c624 in  () at /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#5  0xb3c6c990 in __cxa_rethrow () at /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#6  0xb3c953b4 in std::__throw_out_of_range(char const*) () at /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#7  0x00577430 in std::__detail::_Map_base<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, SkyObject::TYPE>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, SkyObject::TYPE> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true>, true>::at(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const (this=this@entry=0xbeffd7b0, __k="default") at /usr/include/c++/8/bits/char_traits.h:312
#8  0x0057a936 in std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, SkyObject::TYPE, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, SkyObject::TYPE> > >::at(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const (__k="default", this=0xbeffd7b0) at /usr/include/c++/8/bits/unordered_map.h:994
#9  0x0057a936 in CatalogCSVImport::parse_type(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, SkyObject::TYPE, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, SkyObject::TYPE> > > const&)Python Exception <class 'IndexError'> list index out of range: 
 

and
    (this=<optimized out>, type_map=std::unordered_map with 1 element, type="Galaxy") at ./kstars/dialogs/catalogcsvimport.cpp:412
#10 0x0057a936 in CatalogCSVImport::read_n_objects(unsigned int) (this=0xbeffe4e8, n=n@entry=10) at ./kstars/dialogs/catalogcsvimport.cpp:390
#11 0x0057b366 in CatalogCSVImport::<lambda()>::operator() (__closure=0x2fe5b38) at ./kstars/dialogs/catalogcsvimport.cpp:80
#12 0x0057b366 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, CatalogCSVImport::CatalogCSVImport(QWidget*)::<lambda()> >::call
    (arg=<optimized out>, f=...) at /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobjectdefs_impl.h:128
#13 0x0057b366 in QtPrivate::Functor<CatalogCSVImport::CatalogCSVImport(QWidget*)::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...)
    at /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobjectdefs_impl.h:238
#14 0x0057b366 in QtPrivate::QFunctorSlotObject<CatalogCSVImport::CatalogCSVImport(QWidget*)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x2fe5b30, r=<optimized out>, a=<optimized out>, ret=0x0)
    at /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobjectdefs_impl.h:421
#15 0xb458c380 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5
#16 0xb4e00104 in QAbstractButton::clicked(bool) () at /usr/lib/arm-linux-gnueabihf/libQt5Widgets.so.5
#17 0xb4e00340 in  () at /usr/lib/arm-linux-gnueabihf/libQt5Widgets.so.5
 

So it's an out of range problem.

Looking at kstars/dialogs/catalogcsvimport.cpp, we see on ligne 403:
m_objects.emplace_back(CatalogObject::oid{}, type, ra, dec, mag, name, long_name,
                               identifier, -1, a, b, pa, flux);
 

Notice the -1 after the 'identifier' field. I'm no developer but the field after 'identifier' should be 'a' (major axis), so everything after that will be shifted by 1 and might therefore trigger the out of range message.

There are also some 'for' loops in the code that might be the problem.

What do you think?
1 year 10 months ago #82874

Please Log in or Create an account to join the conversation.

Time to create page: 0.638 seconds