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

[DocDB] alma8 fastdebug gcc11 compilation: ‘prev_op’ may be used uninitialized in this function #21811

Closed
1 task done
jasonyb opened this issue Apr 3, 2024 · 0 comments
Labels
area/docdb YugabyteDB core features kind/bug This issue is a bug priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage

Comments

@jasonyb
Copy link
Contributor

jasonyb commented Apr 3, 2024

Jira Link: DB-10712

Description

Almalinux 8, fastdebug, gcc11 compilation fails on master 8239595.

/-------------------------------------------------------------------------------
| COMPILATION FAILED
|-------------------------------------------------------------------------------
../../src/yb/integration-tests/cdcsdk_ysql_test_base.cc: In member function ‘void yb::cdc::CDCSDKYsqlTest::CheckRecordsConsistencyFromVWAL(const std::vector<yb::cdc::CDCSDKProtoRecordPB>&)’:
../../src/yb/integration-tests/cdcsdk_ysql_test_base.cc:3879:9: error: ‘prev_op’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
 3879 |         if (prev_op == RowMessage::DDL) {
      |         ^~
cc1plus: all warnings being treated as errors

Likely due to commit 061dc69.

Issue Type

kind/bug

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
@jasonyb jasonyb added area/docdb YugabyteDB core features status/awaiting-triage Issue awaiting triage labels Apr 3, 2024
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Apr 3, 2024
@jasonyb jasonyb closed this as completed in 193589f Apr 4, 2024
jasonyb pushed a commit that referenced this issue Apr 25, 2024
Summary:
Commit 061dc69 introduces code causing
compilation failure

    ../../src/yb/integration-tests/cdcsdk_ysql_test_base.cc: In member function ‘void yb::cdc::CDCSDKYsqlTest::CheckRecordsConsistencyFromVWAL(const std::vector<yb::cdc::CDCSDKProtoRecordPB>&)’:
    ../../src/yb/integration-tests/cdcsdk_ysql_test_base.cc:3879:9: error: ‘prev_op’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     3879 |         if (prev_op == RowMessage::DDL) {
          |         ^~
    cc1plus: all warnings being treated as errors

Almalinux 8 + fastdebug + gcc11 is affected, but other build combos such
as those in jenkins_jobs.yml are fine.

Fix the issue by initializing prev_op to UNKNOWN.  This should be fine
according to the logic as far as I can tell.
Jira: DB-10712

Test Plan:
On Almalinux 8:

    ./yb_build.sh fastdebug --gcc11

Close: #21811
Original commit: 193589f / D33830

Reviewers: siddharth.shah

Reviewed By: siddharth.shah

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D34494
jasonyb pushed a commit that referenced this issue May 14, 2024
…ter-merge

Merge YB master commit 193589f titled

    [#21811] docdb: fix alma8 fastdebug gcc11 compilation

and committed 2024-04-04T10:20:10-07:00 to YB pg15.

- TestPgReplicationSlot.java:
  - consumptionOnSubsetOfColocatedTables: YB pg15 merge
    5fe2012 ignores this test.  YB
    master fddfec6 moves this test
    lower.  YB master 71ad62a adds new
    test dynamicTableAdditionForTablesCreatedBeforeStreamCreation in the
    old location.  This causes merge conflict.  Apply the ignore to the
    new location.
  - *: add @ignore for a bunch of new tests introduced by various YB
    master commits because they fail.  This is along the lines of what
    has been already happening to this file in previous merges.
- nodeYbBitmapTablescan.c:
  - ExecReScanYbBitmapTableScan: YB master
    7ac6dc2 adds logic to pfree
    ss_currentScanDesc.  In YB pg15, it is already being freed by
    ybc_heap_endscan(tsdesc).  In YB pg15, the YbScanDesc contains
    TableScanDesc whereas in YB master, YbScanDesc is contained in
    HeapScanDesc.  All in all, the incoming logic from YB master is not
    needed because things are already being freed properly.
- logical.c:
  - function declarations: YB master
    459e6b6 adds
    yb_schema_change_cb_wrapper declaration in the middle of PG-owned
    declarations.  Upstream PG 45fdc9738b36d1068d3ad8fdb06436d6fd14436b
    and 0aa8a01d04c8fe200b7a106878eebc3d0af9105c add extra functions in
    the same area.  Adjacent lines conflict.
  - StartupDecodingContext: again, upstream PG
    45fdc9738b36d1068d3ad8fdb06436d6fd14436b and
    0aa8a01d04c8fe200b7a106878eebc3d0af9105c add code where YB master
    459e6b6 adds code.  Adjacent lines
    conflict.
  - yb_schema_change_cb_wrapper: (same)
- proto.c:
  - function declarations: upstream PG
    52e4f0cd472d39d07732b99559989ea3b615be78 and
    923def9a533a7d986acfb524139d8b9e5466d0a5 change the signature of
    logicalrep_write_tuple.  YB master
    fddfec6 also changes signature.
    Apply both.
  - logicalrep_write_insert: (same)
  - logicalrep_write_update signature: upstream PG
    464824323e57dc4b397e8b05854d779908b55304,
    52e4f0cd472d39d07732b99559989ea3b615be78, and
    923def9a533a7d986acfb524139d8b9e5466d0a5 change the signature.  YB
    master fddfec6 also changes the
    signature.  Apply both.
  - logicalrep_write_update body: (same as logicalrep_write_insert)
  - logicalrep_write_delete: (same)
  - logicalrep_write_tuple: (same)
- yb_virtual_wal_client.c:
  - YBCReadRecord: YB master 71ad62a
    adds publication_names parameter while YB pg15 merge
    417e9b3 removes RecPtr parameter.
    Apply both.
- pgoutput.c:
  - _PG_output_plugin_init: upstream PG
    464824323e57dc4b397e8b05854d779908b55304 and
    ac4645c0157fc5fcef0af8ff571512aa284a2cec add code where YB master
    459e6b6 adds code.  Adjacent lines
    conflict.
  - pgoutput_change case REORDER_BUFFER_CHANGE_UPDATE: upstream PG
    83fd4532a72179c370e318075a10e0e2aa832024 and
    52e4f0cd472d39d07732b99559989ea3b615be78 significantly change the
    code.  YB master fddfec6 adds code
    to determine yb_old_is_omitted and yb_new_is_omitted, and it passes
    them to the logicalrep_write_update call.  Major conflict.
- slot.c:
  - ReplicationSlotAcquire: major conflict: many commits appear to be
    involved on both sides.  Follow the resolution in YB pg15 merge
    ee08bd6 to change "slot" to "s" and
    take YB master's version.
- walsender.c:
  - XLogSendLogical: (same as yb_virtual_wal_client.c YBCReadRecord)
- pg_yb_utils.c:
  - YbGetDdlMode T_VacuumStmt: YB pg15
    0a5cbae and YB master
    9a27aff add logic in the same area.
    Keep both.
- logicalproto.h:
  - logicalrep_write_update: (same as proto.c logicalrep_write_update
    signature)
- output_plugin.h:
  - YBLogicalDecodeSchemaChangeCB: (same as logical.c function
    declarations)
  - OutputPluginCallbacks: (same as logical.c function declarations)
- reorderbuffer.h:
  - YBReorderBufferSchemaChangeCB: (same as logical.c function
    declarations)
- yb_virtual_wal_client.h:
  - YBCReadRecord: (same as yb_virtual_wal_client.c YBCReadRecord)
- aggregates.sql:
  - YB master b2f8822 is an upstream PG
    point import of 44e95b5728a4569c494fa4ea4317f8a2f50a206b, which is
    already part of upstream PG REL_15_2.  Drop incoming YB master
    changes because YB pg15 is already up to date.
- aggregates.out:
  - (same as aggregates.sql)
- yb_decode.c:
  - YBDecodeUpdate: like YB pg15 merge
    d68d96c, pass false for the new
    argument of the new ReorderBufferQueueChange call.
- build_postgres.py:
  - make_postgres: add new extensions yb_ycql_utils (YB master
    ce7d880) and
    yb_xcluster_ddl_replication (YB master
    0185d16) to the list of directories
    to build.  YB pg15 initial merge disabled building all contrib
    extensions automatically, so each extension has to be added to this
    list for now.
- yb_xcluster_ddl_replication.c:
  - HandleSourceDDLEnd: this file is introduced by YB master
    0185d16.  In various places, adjust
    code according to upstream PG
    2f9661311b83dc481fc19f6e3bda015392010a40, which makes trig_data->tag
    of CommandTag type rather than char*.  Use GetCommandTagName where
    str is needed and switch to comparing CommandTag to CommandTag
    instead of str to str where possible.
  - IsInIgnoreList: (same)
jasonyb pushed a commit that referenced this issue May 14, 2024
…9b0af3c' into pg15

Summary:
Merge YB master commit 193589f titled

    [#21811] docdb: fix alma8 fastdebug gcc11 compilation

and committed 2024-04-04T10:20:10-07:00 to YB pg15.

- TestPgReplicationSlot.java:
  - consumptionOnSubsetOfColocatedTables: YB pg15 merge
    5fe2012 ignores this test.  YB
    master fddfec6 moves this test
    lower.  YB master 71ad62a adds new
    test dynamicTableAdditionForTablesCreatedBeforeStreamCreation in the
    old location.  This causes merge conflict.  Apply the ignore to the
    new location.
  - *: add @ignore for a bunch of new tests introduced by various YB
    master commits because they fail.  This is along the lines of what
    has been already happening to this file in previous merges.
- nodeYbBitmapTablescan.c:
  - ExecReScanYbBitmapTableScan: YB master
    7ac6dc2 adds logic to pfree
    ss_currentScanDesc.  In YB pg15, it is already being freed by
    ybc_heap_endscan(tsdesc).  In YB pg15, the YbScanDesc contains
    TableScanDesc whereas in YB master, YbScanDesc is contained in
    HeapScanDesc.  All in all, the incoming logic from YB master is not
    needed because things are already being freed properly.
- logical.c:
  - function declarations: YB master
    459e6b6 adds
    yb_schema_change_cb_wrapper declaration in the middle of PG-owned
    declarations.  Upstream PG 45fdc9738b36d1068d3ad8fdb06436d6fd14436b
    and 0aa8a01d04c8fe200b7a106878eebc3d0af9105c add extra functions in
    the same area.  Adjacent lines conflict.
  - StartupDecodingContext: again, upstream PG
    45fdc9738b36d1068d3ad8fdb06436d6fd14436b and
    0aa8a01d04c8fe200b7a106878eebc3d0af9105c add code where YB master
    459e6b6 adds code.  Adjacent lines
    conflict.
  - yb_schema_change_cb_wrapper: (same)
- proto.c:
  - function declarations: upstream PG
    52e4f0cd472d39d07732b99559989ea3b615be78 and
    923def9a533a7d986acfb524139d8b9e5466d0a5 change the signature of
    logicalrep_write_tuple.  YB master
    fddfec6 also changes signature.
    Apply both.
  - logicalrep_write_insert: (same)
  - logicalrep_write_update signature: upstream PG
    464824323e57dc4b397e8b05854d779908b55304,
    52e4f0cd472d39d07732b99559989ea3b615be78, and
    923def9a533a7d986acfb524139d8b9e5466d0a5 change the signature.  YB
    master fddfec6 also changes the
    signature.  Apply both.
  - logicalrep_write_update body: (same as logicalrep_write_insert)
  - logicalrep_write_delete: (same)
  - logicalrep_write_tuple: (same)
- yb_virtual_wal_client.c:
  - YBCReadRecord: YB master 71ad62a
    adds publication_names parameter while YB pg15 merge
    417e9b3 removes RecPtr parameter.
    Apply both.
- pgoutput.c:
  - _PG_output_plugin_init: upstream PG
    464824323e57dc4b397e8b05854d779908b55304 and
    ac4645c0157fc5fcef0af8ff571512aa284a2cec add code where YB master
    459e6b6 adds code.  Adjacent lines
    conflict.
  - pgoutput_change case REORDER_BUFFER_CHANGE_UPDATE: upstream PG
    83fd4532a72179c370e318075a10e0e2aa832024 and
    52e4f0cd472d39d07732b99559989ea3b615be78 significantly change the
    code.  YB master fddfec6 adds code
    to determine yb_old_is_omitted and yb_new_is_omitted, and it passes
    them to the logicalrep_write_update call.  Major conflict.
- slot.c:
  - ReplicationSlotAcquire: major conflict: many commits appear to be
    involved on both sides.  Follow the resolution in YB pg15 merge
    ee08bd6 to change "slot" to "s" and
    take YB master's version.
- walsender.c:
  - XLogSendLogical: (same as yb_virtual_wal_client.c YBCReadRecord)
- pg_yb_utils.c:
  - YbGetDdlMode T_VacuumStmt: YB pg15
    0a5cbae and YB master
    9a27aff add logic in the same area.
    Keep both.
- logicalproto.h:
  - logicalrep_write_update: (same as proto.c logicalrep_write_update
    signature)
- output_plugin.h:
  - YBLogicalDecodeSchemaChangeCB: (same as logical.c function
    declarations)
  - OutputPluginCallbacks: (same as logical.c function declarations)
- reorderbuffer.h:
  - YBReorderBufferSchemaChangeCB: (same as logical.c function
    declarations)
- yb_virtual_wal_client.h:
  - YBCReadRecord: (same as yb_virtual_wal_client.c YBCReadRecord)
- aggregates.sql:
  - YB master b2f8822 is an upstream PG
    point import of 44e95b5728a4569c494fa4ea4317f8a2f50a206b, which is
    already part of upstream PG REL_15_2.  Drop incoming YB master
    changes because YB pg15 is already up to date.
- aggregates.out:
  - (same as aggregates.sql)
- yb_decode.c:
  - YBDecodeUpdate: like YB pg15 merge
    d68d96c, pass false for the new
    argument of the new ReorderBufferQueueChange call.
- build_postgres.py:
  - make_postgres: add new extensions yb_ycql_utils (YB master
    ce7d880) and
    yb_xcluster_ddl_replication (YB master
    0185d16) to the list of directories
    to build.  YB pg15 initial merge disabled building all contrib
    extensions automatically, so each extension has to be added to this
    list for now.
- yb_xcluster_ddl_replication.c:
  - HandleSourceDDLEnd: this file is introduced by YB master
    0185d16.  In various places, adjust
    code according to upstream PG
    2f9661311b83dc481fc19f6e3bda015392010a40, which makes trig_data->tag
    of CommandTag type rather than char*.  Use GetCommandTagName where
    str is needed and switch to comparing CommandTag to CommandTag
    instead of str to str where possible.
  - IsInIgnoreList: (same)

Test Plan:
On Almalinux 8:

    #!/usr/bin/env bash
    set -eu
    ./yb_build.sh fastdebug --gcc11
    pg15_tests/run_tests.sh

Get the following results using pg15_tests/run_tests.sh:

    0	2024-05-13T14:05:03-07:00	JAVA	org.yb.pgsql.TestPgViewYCQLStats
    0	2024-05-13T14:05:33-07:00	integration-tests_cdcsdk_consumption_consistent_changes-test	CDCSDKConsumptionConsistentChangesTest.TestVWALConsumptionWitDDLStatements
    0	2024-05-13T14:06:05-07:00	integration-tests_cdcsdk_consumption_consistent_changes-test	CDCSDKConsumptionConsistentChangesTest.TestVWALConsumptionWithMultipleAlter
    0	2024-05-13T14:06:35-07:00	integration-tests_cdcsdk_consumption_consistent_changes-test	CDCSDKConsumptionConsistentChangesTest.TestVWALConsumptionWitDDLStatementsAndRestart
    0	2024-05-13T14:26:41-07:00	integration-tests_cdcsdk_consumption_consistent_changes-test	CDCSDKConsumptionConsistentChangesTest.*
    0	2024-05-13T14:27:32-07:00	integration-tests_cdcsdk_consumption_consistent_changes-test	CDCSDKConsumptionConsistentChangesTest.TestTabletSplitDuringConsumptionFromVWAL
    0	2024-05-13T14:28:38-07:00	integration-tests_cdcsdk_consumption_consistent_changes-test	CDCSDKConsumptionConsistentChangesTest.TestRecordCountsAfterMultipleTabletSplits
    0	2024-05-13T14:29:25-07:00	integration-tests_cdcsdk_consumption_consistent_changes-test	CDCSDKConsumptionConsistentChangesTest.TestTabletSplitDuringConsumptionFromVWALWithRestart
    0	2024-05-13T14:30:07-07:00	integration-tests_cdcsdk_consumption_consistent_changes-test	CDCSDKConsumptionConsistentChangesTest.TestTabletSplitDuringConsumptionFromVWALWithRestartOnPartialAck
    0	2024-05-13T14:30:33-07:00	integration-tests_master_path_handlers-itest	MasterPathHandlersItest.TestHiddenSplitParentTablet
    1	2024-05-13T14:39:24-07:00	JAVA	org.yb.pgsql.TestPgWaitQueuesRegress
    0	2024-05-13T14:39:46-07:00	integration-tests_xcluster_ysql_index-test	XClusterDbScopedYsqlIndexTest.IndexCheckpointLocation
    0	2024-05-13T14:40:43-07:00	integration-tests_minicluster-snapshot-test	Colocation/MasterExportSnapshotTest.ExportSnapshotAsOfTimeWithHiddenTables/0
    0	2024-05-13T14:41:32-07:00	integration-tests_minicluster-snapshot-test	Colocation/MasterExportSnapshotTest.ExportSnapshotAsOfTimeWithHiddenTables/1
    0	2024-05-13T14:49:45-07:00	integration-tests_wait_states-itest	*
    1	2024-05-13T15:14:59-07:00	JAVA	org.yb.pgsql.TestPgRegressIndex
    0	2024-05-13T15:15:38-07:00	JAVA	org.yb.pgsql.TestPgRegressThirdPartyExtensionsYBXClusterDDLReplication
    0	2024-05-13T15:16:17-07:00	integration-tests_xcluster_ddl_replication-test	XClusterDDLReplicationTest.CreateTable
    0	2024-05-13T15:16:35-07:00	pgwrapper_pg_mini-test	PgMiniTest.SmallParallelScan
    1	2024-05-13T15:17:54-07:00	JAVA	org.yb.pgsql.TestPgRegressMisc#testPgRegressMiscIndependent
    0	2024-05-13T15:18:25-07:00	integration-tests_cdcsdk_consumption_consistent_changes-test	CDCSDKConsumptionConsistentChangesTest.TestDynamicTablesAddition
    0	2024-05-13T15:18:55-07:00	integration-tests_cdcsdk_consumption_consistent_changes-test	CDCSDKConsumptionConsistentChangesTest.TestDynamicTablesRemoval
    0	2024-05-13T15:19:15-07:00	integration-tests_cdcsdk_consumption_consistent_changes-test	CDCSDKConsumptionConsistentChangesTest.TestCommitTimeTieWithoutSeparateResponseForPublicationRefreshNotification
    0	2024-05-13T15:19:35-07:00	integration-tests_cdcsdk_consumption_consistent_changes-test	CDCSDKConsumptionConsistentChangesTest.TestCommitTimeTieWithSeparateResponseForPublicationRefreshNotification
    0	2024-05-13T15:19:58-07:00	integration-tests_cdcsdk_consumption_consistent_changes-test	CDCSDKConsumptionConsistentChangesTest.TestLSNDeterminismWithSpecialRecordOnRestartWithPartialAck
    0	2024-05-13T15:22:29-07:00	integration-tests_xcluster_db_scoped-test	XClusterDBScopedTest.TestCreateWithCheckpoint
    0	2024-05-13T15:23:16-07:00	integration-tests_xcluster_db_scoped-test	XClusterDBScopedTest.ColocatedDB

Also run some tests that enable YSQL Connection Manager:

    #./yb_build.sh fastdebug --gcc11 --enable-ysql-conn-mgr-test --java-test 'org.yb.pgsql.TestPgYbStat#testYbTerminatedQueriesMultipleCauses'
    ./yb_build.sh fastdebug --gcc11 --enable-ysql-conn-mgr-test --java-test 'org.yb.pgsql.TestPgAlterTable'
    ./yb_build.sh fastdebug --gcc11 --enable-ysql-conn-mgr-test --java-test 'org.yb.pgsql.TestPgRegressReplicaIdentity#testPgRegressTable'
    ./yb_build.sh fastdebug --gcc11 --enable-ysql-conn-mgr-test --java-test 'org.yb.pgsql.TestPgConnection'
    ./yb_build.sh fastdebug --gcc11 --enable-ysql-conn-mgr-test --java-test 'org.yb.pgsql.TestYbPgStatActivity#testMemUsageFuncsWithMultipleBackends'
    ./yb_build.sh fastdebug --gcc11 --enable-ysql-conn-mgr-test --java-test 'org.yb.pgsql.TestPgBackendMemoryContext#testLogBackendMemoryTexts'
    ./yb_build.sh fastdebug --gcc11 --enable-ysql-conn-mgr-test --java-test 'org.yb.ysqlconnmgr.TestMisc#testNegSetYsqlConnMgr'
    ./yb_build.sh fastdebug --gcc11 --enable-ysql-conn-mgr-test --java-test 'org.yb.pgsql.TestPgRegressPublication#testPgRegressPublication'
    ./yb_build.sh fastdebug --gcc11 --enable-ysql-conn-mgr-test --java-test 'org.yb.pgsql.TestPgUniqueConstraint#createIndexViolatingUniqueness'

C++ test ClientTest.TestCreateTableWithRangePartition may be fixed by
merging over YB master 84c4ae5.

Jenkins: rebase: pg15

Reviewers: tfoucher

Reviewed By: tfoucher

Subscribers: fizaa, aagrawal, yql

Differential Revision: https://phorge.dev.yugabyte.com/D34968
ZhenYongFan pushed a commit to ZhenYongFan/yugabyte-db that referenced this issue Jun 15, 2024
…mpilation

Summary:
Commit 061dc69 introduces code causing
compilation failure

    ../../src/yb/integration-tests/cdcsdk_ysql_test_base.cc: In member function ‘void yb::cdc::CDCSDKYsqlTest::CheckRecordsConsistencyFromVWAL(const std::vector<yb::cdc::CDCSDKProtoRecordPB>&)’:
    ../../src/yb/integration-tests/cdcsdk_ysql_test_base.cc:3879:9: error: ‘prev_op’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     3879 |         if (prev_op == RowMessage::DDL) {
          |         ^~
    cc1plus: all warnings being treated as errors

Almalinux 8 + fastdebug + gcc11 is affected, but other build combos such
as those in jenkins_jobs.yml are fine.

Fix the issue by initializing prev_op to UNKNOWN.  This should be fine
according to the logic as far as I can tell.
Jira: DB-10712

Test Plan:
On Almalinux 8:

    ./yb_build.sh fastdebug --gcc11

Close: yugabyte#21811
Original commit: 193589f / D33830

Reviewers: siddharth.shah

Reviewed By: siddharth.shah

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D34494
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docdb YugabyteDB core features kind/bug This issue is a bug priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage
Projects
None yet
Development

No branches or pull requests

2 participants