Project

General

Profile

Actions

Bug #13701

open

Crash with Menu with StackedWidget

Added by Stephan Kerker 7 days ago. Updated 6 days ago.

Status:
Review
Priority:
Normal
Target version:
Start date:
04/09/2025
Due date:
% Done:

0%

Estimated time:

Description

Creating and showing a dialog that contains a WMenu with a StackedWidget causes a Segfault/SIGABRT.
This seems to be related to
https://redmine.emweb.be/issues/13291
since fixing this in 4.11.3, worked fine with StackedWidgets.
In 4.11.4, the fix has been reverted (commit e680203), and release 4.11.4 segfaults again.
Stacktrace:
Thread #57 [webtcs] 79053 [core: 6] (Suspended : Signal : SIGABRT:Aborted)

abort() at 0x7ffff1c335e7

std::__glibcxx_assert_fail() at assert_fail.cc:41 0x7ffff1ed3f70

std::vector >::operator at stl_vector.h:1,128 0x7ffff25bf9d0
std::vector >::operator at stl_vector.h:1,128 0x7ffff25bf9d0
Wt::WStackedWidget::setCurrentIndex() at WStackedWidget.C:146 0x7ffff25bf9d0

Wt::WMenu::undoSelectVisual() at WMenu.C:519 0x7ffff2566d96
Wt::WebRenderer::learnabi:cxx11 at WebRenderer.C:1,961 0x7ffff280f8e9

Wt::EventSignalBase::processPreLearnStateless() at WSignal.C:398 0x7ffff25aec85
Wt::WebRenderer::preLearnStateless() at WebRenderer.C:1,928 0x7ffff280f098

Wt::WebRenderer::collectJavaScriptUpdate() at WebRenderer.C:1,764 0x7ffff280f291

<...more frames...>

The relevant line from WStackedWidget:
if (loadPolicies_[currentIndex_] == ContentLoading::Lazy) {
...
currentIndex_ is -1 and causes the invalid access to loadPolicies.


Related issues 2 (0 open2 closed)

Related to Bug #13291: Nested WMenu items causing segfaultsClosedRomain Mardulyn12/05/2024

Actions
Related to Bug #13585: Segfault on internal path navigation with submenusClosedMatthias Van Ceulebroeck02/26/2025

Actions
Actions #1

Updated by Matthias Van Ceulebroeck 7 days ago

  • Related to Bug #13291: Nested WMenu items causing segfaults added
Actions #2

Updated by Matthias Van Ceulebroeck 7 days ago

  • Related to Bug #13585: Segfault on internal path navigation with submenus added
Actions #3

Updated by Matthias Van Ceulebroeck 7 days ago

  • Status changed from New to InProgress
  • Assignee set to Matthias Van Ceulebroeck
  • Target version set to 4.12.0

Hello Stephan,

thank you for the report. This is indeed a regression.
Due to changes in #13585 that aimed to greatly simplify the complexity of WMenu::select, the currentIndex_ == -1 fix was omitted.

Actions #4

Updated by Matthias Van Ceulebroeck 7 days ago

  • Status changed from InProgress to Review
  • Assignee deleted (Matthias Van Ceulebroeck)
Actions #5

Updated by Romain Mardulyn 6 days ago

  • Assignee set to Romain Mardulyn
Actions

Also available in: Atom PDF