D15605: kdev-astyle : upgrade libastyle to v3.1

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Fri Sep 21 05:25:28 BST 2018


kossebau added a comment.


  With asserts enabled, I get a crash with this on opening the settings or sometimes only when selecting Objective-C in the formatting settings
  
    kdevelop: /home/koder/Kode/kdegit/kf5/extragear/kdevelop/kdevelop/plugins/astyle/3rdparty/libastyle/ASFormatter.cpp:3841: std::__cxx11::string astyle::ASFormatter::peekNextText(const string&, bool, std::shared_ptr<astyle::ASPeekStream>) const: Assertion `sourceIterator->getPeekStart() == 0 || streamArg != nullptr' failed.
  
  Seems that `sourceIterator->getPeekStart() == 0` is not fulfilled by the new implementation done for KDevelop's `AStyleStringIterator::getPeekStart()`. This needs some investigation, and more testing please.
  
  This is the backtrace:
  
    #6  0x00007fb33b1ae08b in __GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
    #7  0x00007fb33b1974e9 in __GI_abort () at abort.c:79
    #8  0x00007fb33b1973c1 in __assert_fail_base (fmt=0x7fb33b2fb0f0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x7fb2f957ba68 "sourceIterator->getPeekStart() == 0 || streamArg != nullptr", file=0x7fb2f957b6b8 "/home/koder/Kode/kdegit/kf5/extragear/kdevelop/kdevelop/plugins/astyle/3rdparty/libastyle/ASFormatter.cpp", line=3841, function=<optimized out>) at assert.c:92
    #9  0x00007fb33b1a66f2 in __GI___assert_fail (assertion=0x7fb2f957ba68 "sourceIterator->getPeekStart() == 0 || streamArg != nullptr", file=0x7fb2f957b6b8 "/home/koder/Kode/kdegit/kf5/extragear/kdevelop/kdevelop/plugins/astyle/3rdparty/libastyle/ASFormatter.cpp", line=3841, function=0x7fb2f957c800 <astyle::ASFormatter::peekNextText(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, std::shared_ptr<astyle::ASPeekStream>) const::__PRETTY_FUNCTION__> "std::__cxx11::string astyle::ASFormatter::peekNextText(const string&, bool, std::shared_ptr<astyle::ASPeekStream>) const") at assert.c:101
    #10 0x00007fb2f9558eae in astyle::ASFormatter::peekNextText(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, std::shared_ptr<astyle::ASPeekStream>) const (this=0x4c4cdb0, firstLine="a,*d--);", endOnEmptyLine=false, streamArg=std::shared_ptr<class astyle::ASPeekStream> (empty) = {...}) at /home/koder/Kode/kdegit/kf5/extragear/kdevelop/kdevelop/plugins/astyle/3rdparty/libastyle/ASFormatter.cpp:3841
    #11 0x00007fb2f9556a23 in astyle::ASFormatter::isPointerOrReference() const (this=0x4c4cdb0) at /home/koder/Kode/kdegit/kf5/extragear/kdevelop/kdevelop/plugins/astyle/3rdparty/libastyle/ASFormatter.cpp:3177
    #12 0x00007fb2f9553692 in astyle::ASFormatter::nextLine[abi:cxx11]() (this=0x4c4cdb0) at /home/koder/Kode/kdegit/kf5/extragear/kdevelop/kdevelop/plugins/astyle/3rdparty/libastyle/ASFormatter.cpp:1775
    #13 0x00007fb2f952fa52 in AStyleFormatter::formatSource(QString const&, QString const&, QString const&) (this=0x4c4cdb0, text=..., leftContext=..., rightContext=...) at /home/koder/Kode/kdegit/kf5/extragear/kdevelop/kdevelop/plugins/astyle/astyle_formatter.cpp:49
    #14 0x00007fb2f9521c0a in AStylePlugin::formatSourceWithStyle(KDevelop::SourceFormatterStyle, QString const&, QUrl const&, QMimeType const&, QString const&, QString const&) const (this=0x4369850, s=..., text=..., mime=..., leftContext=..., rightContext=...) at /home/koder/Kode/kdegit/kf5/extragear/kdevelop/kdevelop/plugins/astyle/astyle_plugin.cpp:266
    #15 0x00007fb33fb0eab6 in KDevelop::SourceFormatterSelectionEdit::updatePreview() (this=0x5b08e10) at /home/koder/Kode/kdegit/kf5/extragear/kdevelop/kdevelop/kdevplatform/shell/sourceformatterselectionedit.cpp:564
    #16 0x00007fb33fb0bccb in KDevelop::SourceFormatterSelectionEdit::resetUi() (this=0x5b08e10) at /home/koder/Kode/kdegit/kf5/extragear/kdevelop/kdevelop/kdevplatform/shell/sourceformatterselectionedit.cpp:289
    #17 0x00007fb33fb0b699 in KDevelop::SourceFormatterSelectionEdit::loadSettings(KConfigGroup const&) (this=0x5b08e10, config=...) at /home/koder/Kode/kdegit/kf5/extragear/kdevelop/kdevelop/kdevplatform/shell/sourceformatterselectionedit.cpp:243
    #18 0x00007fb33fb39497 in SourceFormatterSettings::reset() (this=0x5b494f0) at /home/koder/Kode/kdegit/kf5/extragear/kdevelop/kdevelop/kdevplatform/shell/settings/sourceformattersettings.cpp:58
    #19 0x00007fb33fb0477c in KDevelop::ConfigDialog::addConfigPageInternal(KPageWidgetItem*, KDevelop::ConfigPage*) (this=0x7ffd91d692a0, item=0x5e49ed0, page=0x5b494f0) at /home/koder/Kode/kdegit/kf5/extragear/kdevelop/kdevelop/kdevplatform/shell/configdialog.cpp:170
    #20 0x00007fb33fb04510 in KDevelop::ConfigDialog::appendConfigPage(KDevelop::ConfigPage*) (this=0x7ffd91d692a0, page=0x5b494f0) at /home/koder/Kode/kdegit/kf5/extragear/kdevelop/kdevelop/kdevplatform/shell/configdialog.cpp:147
    #21 0x00007fb33fa5e9ff in KDevelop::UiController::showSettingsDialog() (this=0x2372b30) at /home/koder/Kode/kdegit/kf5/extragear/kdevelop/kdevelop/kdevplatform/shell/uicontroller.cpp:512
    #22 0x00007fb33fa40c45 in KDevelop::MainWindowPrivate::settingsDialog() (this=0x24314a0) at /home/koder/Kode/kdegit/kf5/extragear/kdevelop/kdevelop/kdevplatform/shell/mainwindow_actions.cpp:112

INLINE COMMENTS

> astyle_stringiterator.cpp:77
> +{
> +   return m_peekStart;
> +}

Is there some API dox what one should implement for `getPeekStart()`, especially which values are valid?

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D15605

To: rjvbb, #kdevelop, kfunk
Cc: kossebau, kfunk, pino, apol, kdevelop-devel, glebaccon, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180921/4c6c3412/attachment.html>


More information about the KDevelop-devel mailing list