Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CuraEngine::LayerPlanTest/AllCombinations/AddTravelTest.NoRetractionIfDisabled/20 fails because sliceDataStorage.storage.supportLayers hasn't been initialized properly #2008

Open
amorozov opened this issue Jan 8, 2024 · 1 comment

Comments

@amorozov
Copy link

amorozov commented Jan 8, 2024

CuraEngine-5.6.0

ArchLinux

Qt version is not applicable.

PyQt version is not applicable

Display Driver is not relevant

Compile the CuraEngine with the following flags:

  • CFLAGS = '-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g'
  • CXXFLAGS = '-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -g'
  • LDFLAGS = '-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

then run make test (or ninja test)

Actual Results
the test fails with the following diagnostics:

[ RUN      ] AllCombinations/AddTravelTest.NoRetractionIfDisabled/19
[       OK ] AllCombinations/AddTravelTest.NoRetractionIfDisabled/19 (0 ms)
[ RUN      ] AllCombinations/AddTravelTest.NoRetractionIfDisabled/20
/usr/include/c++/13.2.1/bits/stl_vector.h:1144: constexpr std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = cura::SupportLayer; _Alloc = std::allocator<cura::SupportLayer>; const_reference = const cura::SupportLayer&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
Aborted (core dumped)

This happens because in function SliceDataStorage::getLayerOutlines on line 320:

            const SupportLayer& support_layer = support.supportLayers[std::max(LayerIndex(0), layer_nr)];

an attempt to access a support layer is performed while support.supportLayers.size() == 0

So an assertion and a preliminary test exit happen.

Apparently this is the first test which enters the code under if on the line 318:

        if (include_support && (extruder_nr == -1 || extruder_nr == int(mesh_group_settings.get<ExtruderTrain&>("support_infill_extruder_nr").extruder_nr)))
        {

Expected results
The tests should be completed without errors

Additional Information

@amorozov
Copy link
Author

amorozov commented Jan 8, 2024

Probably a call to AreaSupport::generateSupportAreas(SliceDataStorage&) should be performed prior to the SliceDataStorage::getLayerOutlines(....) . However my knowledge and understanding of CuraEngine internals is pretty limited, so it's just a guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant