Problem 1958 - Crash if trying auto-complete (tab) in Qt
Summary: Crash if trying auto-complete (tab) in Qt
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: visualization (show other problems)
Version: 10.3
Hardware: All All
: P4 normal
Assignee: Laurent Garnier
URL:
Depends on:
Blocks:
 
Reported: 2017-03-21 18:01 CET by Andrea Dotti
Modified: 2018-03-06 15:53 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Andrea Dotti 2017-03-21 18:01:26 CET
Report from tutorial, confirmed:

With Qt in 10.3.p01 G4 crashes if auto complete is tried (tab) in session windows if only one character is added after the initial '/', no error w/ two characters. E.g.:

/r tab -> crash
/ru tab -> no crash, completed to /run/
/c tab -> crash
/cu -> no crash, completed to /cuts/

Note that in the second case /c is unique, in the first case is not (could also be /random/) so it seems unrelated to uniqueness.


Can be reproduced with all applications.

From gdb session:
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::substr: __pos (which is 18446744073709551615) > this->size() (which is 2)

Thread 1 "task" received signal SIGABRT, Aborted.
0x00007ffff4368428 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:54
54	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) where
#0  0x00007ffff4368428 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff436a02a in __GI_abort () at abort.c:89
#2  0x00007ffff49a184d in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff499f6b6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff499f701 in std::terminate() ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff499f919 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff49c83f7 in std::__throw_out_of_range_fmt(char const*, ...) ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x00007ffff6e0a7d1 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_check (__s=0x7ffff6e10da7 "basic_string::substr", 
    __pos=<optimized out>, this=0x7fffffffc400)
    at /usr/include/c++/5/bits/basic_string.h:261
#8  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::substr (__n=3, __pos=<optimized out>, this=0x7fffffffc400)
    at /usr/include/c++/5/bits/basic_string.h:2295
#9  G4String::operator() (extent=3, start=<optimized out>, this=0x7fffffffc400)
    at /home/adotti/Work/geant4/source/global/management/include/G4String.icc:94
#10 G4VBasicShell::ModifyPath (this=this@entry=0xa9c0b0, tempPath=...)
    at /home/adotti/Work/geant4/source/interfaces/common/src/G4VBasicShell.cc:154
#11 0x00007ffff6e0ac50 in G4VBasicShell::ModifyToFullPathCommand (
    this=this@entry=0xa9c0b0, aCommandLine=<optimized out>)
---Type <return> to continue, or q <return> to quit---
    at /home/adotti/Work/geant4/source/interfaces/common/src/G4VBasicShell.cc:66
#12 0x00007ffff6e0e867 in G4VBasicShell::ApplyShellCommand (this=0xa9c0b0, a_string=..., 
    exitSession=@0x7ffff7028401: false, exitPause=@0x7ffff7028400: true)
    at /home/adotti/Work/geant4/source/interfaces/common/src/G4VBasicShell.cc:304
#13 0x00007ffff6e0166c in G4UIQt::CommandEnteredCallback (this=0xa9c0a0)
    at /home/adotti/Work/geant4/source/interfaces/basic/src/G4UIQt.cc:3638
#14 0x00007ffff6e07315 in G4UIQt::qt_static_metacall (_o=<optimized out>, 
    _c=<optimized out>, _id=<optimized out>, _a=<optimized out>)
    at /home/adotti/Work/build-G4/source/interfaces/basic/include/moc_G4UIQt.cpp:160
#15 0x00007fffeff88d2a in QMetaObject::activate(QObject*, int, int, void**) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x00007ffff09a2f25 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#17 0x00007fffeff88d2a in QMetaObject::activate(QObject*, int, int, void**) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#18 0x00007ffff0a2d4ef in QWidgetLineControl::processKeyEvent(QKeyEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007ffff099c88a in QLineEdit::keyPressEvent(QKeyEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#20 0x00007ffff08902b7 in QWidget::event(QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007ffff09a3349 in QLineEdit::event(QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007ffff0bc2ab6 in QCompleter::eventFilter(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
---Type <return> to continue, or q <return> to quit---

Andrea
Comment 1 Andrea Dotti 2017-03-21 18:02:13 CET
Joe, this is Qt specific, please reassign to Laurent.
Thank you,
Andrea
Comment 2 Laurent Garnier 2017-06-14 15:23:27 CEST
Thanks Andrea, all commands begun by less than 3 characters + Tab crash the app. (except some special commands trapped before the crash)

Laurent
Comment 3 Laurent Garnier 2017-06-14 17:34:19 CEST
Same problem with all UI commands with a "path" shorter than 3 characters :
ls
ls /r
help /c (Qt UI)
cd
...

Laurent
Comment 4 Laurent Garnier 2017-06-14 17:38:39 CEST
Bug introduced at Révision 63281 (2012-10-18)
Comment 5 garnier 2018-03-06 15:53:45 CET
Close thanks to Andreas