You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
P: normalA defect affecting operation with a low possibility of significantly affects.T: defectAn anomaly, which is anything that deviates from expectations.
The app that checks input for the language server crashes if custom_blocks is autocompleted prior to custom_orders.
It should report an error message that custom_blocks and custom_orders must be the same size instead of crashing.
The text was updated successfully, but these errors were encountered:
brandonlangley
added
P: normal
A defect affecting operation with a low possibility of significantly affects.
T: defect
An anomaly, which is anything that deviates from expectations.
labels
Jun 25, 2023
P: normalA defect affecting operation with a low possibility of significantly affects.T: defectAn anomaly, which is anything that deviates from expectations.
Bug Description
I noticed an issue while testing the development of the MOOSE language server autocomplete capabilities.
The
--check-input
app used by the server crashes with a seg-fault when anExecutioner/Quadrature
block like:is autocompleted to add a
custom_blocks
parameter when there is not already acustom_orders
present.This can be observed by taking
test/tests/quadrature/order/block-order.i
which has anExecutioner
block like:and just commenting out the
custom_orders
parameter and then running the input with or without--check-input
.I also built a debug MOOSE app executable and ran
lldb
which produced this backtrace:indicating the culprit is this loop in the
act()
method fromframework/src/actions/SetupQuadratureAction.C
.The loop
i
index used forMoose::stringToEnum<Order>(_custom_orders[i])
is limited by_custom_blocks.size()
.But it is never verified beforehand that the size of
_custom_orders
is at least as much as_custom_blocks
.So this seg-faults and crashes when there is a
custom_blocks
parameter in the input without acustom_orders
.The fix should simply be adding an earlier check to
act()
that_custom_blocks.size() == _custom_orders.size()
.Then the MOOSE language server will report that error message as diagnostics for this scenario instead of crashing.
Steps to Reproduce
Run
--check-input
ontest/tests/quadrature/order/block-order.i
and notice that it executes as expected.Then run it again after just commenting out the
custom_orders
parameter in theExecutioner/Quadrature
block.That
test/tests/quadrature/order/block-order.i
test input file with the modification causing the crash looks like:Impact
The app that checks input for the language server crashes if
custom_blocks
is autocompleted prior tocustom_orders
.It should report an error message that
custom_blocks
andcustom_orders
must be the same size instead of crashing.The text was updated successfully, but these errors were encountered: