Skip to content

Commit

Permalink
Merge pull request #1290 from trws/segfault-fix
Browse files Browse the repository at this point in the history
resource-query: fix segfault in graphml writer
  • Loading branch information
mergify[bot] authored Sep 4, 2024
2 parents 893e2dc + fb7dde8 commit 8d8941d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
32 changes: 31 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,38 @@
"cacheVariables": {
"SANITIZE_ADDRESS": "ON"
}
},
{
"name": "rpm",
"displayName": "rpm",
"description": "rpm",
"generator": "Ninja",
"binaryDir": "build/rpm",
"cacheVariables": {
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_C_COMPILER": "gcc",
"CMAKE_BUILD_TYPE":"RelWithDebInfo",
"CMAKE_EXPORT_COMPILE_COMMANDS":true,
"CMAKE_SHARED_LINKER_FLAGS":"-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld-errors -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1",
"CMAKE_EXE_LINKER_FLAGS":"-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld-errors -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1",
"CMAKE_INSTALL_PREFIX":"${sourceDir}/install/rpm",
"CMAKE_C_FLAGS": "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer",
"CMAKE_CXX_FLAGS": "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
},
"environment": {
},
"vendor": {}
}
],
"buildPresets": [
{
"name": "default",
"configurePreset": "default"
},
{
"name": "rpm",
"configurePreset": "rpm"
},
{
"name": "asan",
"configurePreset": "asan"
Expand All @@ -50,7 +75,7 @@
},
"execution": {
"noTestsAction": "error",
"stopOnFailure": true
"stopOnFailure": false
}
},
{
Expand All @@ -67,6 +92,11 @@
"noTestsAction": "error",
"stopOnFailure": true
}
},
{
"name": "rpm",
"configurePreset": "rpm",
"inherits": "default"
}
],
"packagePresets": [
Expand Down
4 changes: 2 additions & 2 deletions resource/utilities/resource-query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ static void flatten (resource_graph_t &fg,
}
for (tie (ei, e_end) = edges (fg); ei != e_end; ++ei) {
esubsystems[*ei] = "{";
for (auto const &k : fg[*vi].idata.member_of.key_range ()) {
if (!fg[*vi].idata.member_of[k])
for (auto const &k : fg[*ei].idata.member_of.key_range ()) {
if (!fg[*ei].idata.member_of[k])
continue;
if (esubsystems[*ei].size () > 0)
esubsystems[*ei] += ",";
Expand Down

0 comments on commit 8d8941d

Please sign in to comment.