Bug 278320 - clang fails on the port science/dynare (version 5.4): Assertion failed: (idx < size()), function operator[], file /usr/local/poudriere/jails/main-amd64/usr/src/contrib/llvm-project/llvm/include/llvm/ADT/SmallVector.h, line 304
Summary: clang fails on the port science/dynare (version 5.4): Assertion failed: (idx ...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 15.0-CURRENT
Hardware: amd64 Any
: --- Affects Many People
Assignee: freebsd-toolchain (Nobody)
URL: https://pkg-status.freebsd.org/beefy1...
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-12 03:10 UTC by Yuri Victorovich
Modified: 2024-04-20 10:36 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2024-04-12 03:10:49 UTC
science/dynare wasn't changed recently, but clang began to fail beginning 2024-04-11:
Assertion failed: (idx < size()), function operator[], file /usr/local/poudriere/jails/main-amd64/usr/src/contrib/llvm-project/llvm/include/llvm/ADT/SmallVector.h, line 304.
PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: c++ -DPACKAGE_NAME=\"dynare-preprocessor\" -DPACKAGE_TARNAME=\"dynare-preprocessor\" -DPACKAGE_VERSION=\"5.4\" "-DPACKAGE_STRING=\"dynare-preprocessor 5.4\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"dynare-preprocessor\" -DVERSION=\"5.4\" -DHAVE_CXX17=1 -DHAVE_BOOST=/**/ -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_BOOST_GRAPH_ADJACENCY_LIST_HPP=1 -DHAVE_BOOST_ALGORITHM_STRING_TRIM_HPP=1 -DHAVE_BOOST_ALGORITHM_STRING_SPLIT_HPP=1 -DBOOST_NO_HASH=/**/ -I. -I/usr/local/include -I. -isystem /usr/local/include -Wall -Wno-parentheses -Wold-style-cast -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -MT dynare_preprocessor-DynamicModel.o -MD -MP -MF .deps/dynare_preprocessor-DynamicModel.Tpo -c -o dynare_preprocessor-DynamicModel.o DynamicModel.cc


See URL for log.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-04-12 18:41:10 UTC
Regressed with https://github.com/llvm/llvm-project/commit/7c4180a36a9, still reproduces on upstream main. Now reducing test case.
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2024-04-13 09:09:51 UTC
Regressed with https://github.com/llvm/llvm-project/commit/7c4180a36a9, reported bug at https://github.com/llvm/llvm-project/issues/88607 .
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-04-15 16:31:16 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=514c98ba14a0f590891844d1a6bec0ac4de54489

commit 514c98ba14a0f590891844d1a6bec0ac4de54489
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-04-15 16:24:39 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-04-15 16:30:29 +0000

    Merge commit 37b7207651b4 from llvm-project (by zhongyunde@huawei.com):

      [SimplifyCFG] Fix crash when there is unreachable large index (#88616)

      The large case index out of scope is dead code, but it is still be
      created for TableContents in SwitchLookupTable::SwitchLookupTable,
      so make sure the table size after growing should not get smaller.

      Fix https://github.com/llvm/llvm-project/issues/88607

    This should fix "Assertion failed: (idx < size()), function operator[]"
    when building the science/dynare port.

    PR:             276104, 278320
    Reported by:    yuri
    MFC after:      1 month

 contrib/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-04-20 10:33:15 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=40d5cf3f394d72b9c6a9ce69cebd95d168b1fa72

commit 40d5cf3f394d72b9c6a9ce69cebd95d168b1fa72
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-04-15 16:24:39 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-04-20 10:03:26 +0000

    Merge commit 37b7207651b4 from llvm-project (by zhongyunde@huawei.com):

      [SimplifyCFG] Fix crash when there is unreachable large index (#88616)

      The large case index out of scope is dead code, but it is still be
      created for TableContents in SwitchLookupTable::SwitchLookupTable,
      so make sure the table size after growing should not get smaller.

      Fix https://github.com/llvm/llvm-project/issues/88607

    This should fix "Assertion failed: (idx < size()), function operator[]"
    when building the science/dynare port.

    PR:             276104, 278320
    Reported by:    yuri
    MFC after:      1 month

    (cherry picked from commit 514c98ba14a0f590891844d1a6bec0ac4de54489)

 contrib/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2024-04-20 10:36:07 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=5b763c0e1f30583f8447a0818e2a72498d2e2bc3

commit 5b763c0e1f30583f8447a0818e2a72498d2e2bc3
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-04-15 16:24:39 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-04-20 10:29:10 +0000

    Merge commit 37b7207651b4 from llvm-project (by zhongyunde@huawei.com):

      [SimplifyCFG] Fix crash when there is unreachable large index (#88616)

      The large case index out of scope is dead code, but it is still be
      created for TableContents in SwitchLookupTable::SwitchLookupTable,
      so make sure the table size after growing should not get smaller.

      Fix https://github.com/llvm/llvm-project/issues/88607

    This should fix "Assertion failed: (idx < size()), function operator[]"
    when building the science/dynare port.

    PR:             276104, 278320
    Reported by:    yuri
    MFC after:      1 month

    (cherry picked from commit 514c98ba14a0f590891844d1a6bec0ac4de54489)

 contrib/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)