<table><tr><td style="">kossebau added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D15605">View Revision</a></tr></table><br /><div><div><p>With asserts enabled, I get a crash with this on opening the settings or sometimes only when selecting Objective-C in the formatting settings</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">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.</pre></div>
<p>Seems that <tt style="background: #ebebeb; font-size: 13px;">sourceIterator->getPeekStart() == 0</tt> is not fulfilled by the new implementation done for KDevelop's <tt style="background: #ebebeb; font-size: 13px;">AStyleStringIterator::getPeekStart()</tt>. This needs some investigation, and more testing please.</p>
<p>This is the backtrace:</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">#6 0x00007fb33b1ae08b in __GI_raise (sig=sig@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</pre></div></div></div><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D15605#inline-84392">View Inline</a><span style="color: #4b4d51; font-weight: bold;">astyle_stringiterator.cpp:77</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">return</span> <span class="n">m_peekStart</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Is there some API dox what one should implement for <tt style="background: #ebebeb; font-size: 13px;">getPeekStart()</tt>, especially which values are valid?</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D15605">https://phabricator.kde.org/D15605</a></div></div><br /><div><strong>To: </strong>rjvbb, KDevelop, kfunk<br /><strong>Cc: </strong>kossebau, kfunk, pino, apol, kdevelop-devel, glebaccon, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd<br /></div>