Skip to content

Commit 0d64463

Browse files
committed
Bug#37512477 LQH_TRANSCONF signal printer crashes
There are currently two lengths of LQH_TRANSCONF used. The signal printer should accomodate both, avoiding printing uninitialised data and not making invalid assertions about the supported signal lengths. Change-Id: I0757b512445ae30c310b9c1ec37ed3ae2e1e4e38
1 parent 7ea7929 commit 0d64463

File tree

3 files changed

+26
-21
lines changed

3 files changed

+26
-21
lines changed

storage/ndb/include/kernel/signaldata/LqhTransConf.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2003, 2021, Oracle and/or its affiliates.
2+
Copyright (c) 2003, 2025, Oracle and/or its affiliates.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License, version 2.0,
@@ -50,6 +50,7 @@ class LqhTransConf {
5050
friend bool printLQH_TRANSCONF(FILE *, const Uint32 *, Uint32, Uint16);
5151
public:
5252
STATIC_CONST( SignalLength = 18 );
53+
STATIC_CONST( MarkerSignalLength = 7 ) ;
5354

5455
/**
5556
* Upgrade

storage/ndb/src/common/debugger/signaldata/LqhTrans.cpp

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2003, 2021, Oracle and/or its affiliates.
2+
Copyright (c) 2003, 2025, Oracle and/or its affiliates.
33
All rights reserved. Use is subject to license terms.
44
55
This program is free software; you can redistribute it and/or modify
@@ -30,22 +30,26 @@ bool
3030
printLQH_TRANSCONF(FILE * output, const Uint32 * theData,
3131
Uint32 len, Uint16 receiverBlockNo) {
3232
const LqhTransConf * const sig = (LqhTransConf *)theData;
33-
fprintf(output, " tcRef: %x\n", sig->tcRef);
34-
fprintf(output, " lqhNodeId: %x\n", sig->lqhNodeId);
35-
fprintf(output, " operationStatus: %x\n", sig->operationStatus);
36-
fprintf(output, " transId1: %x\n", sig->transId1);
37-
fprintf(output, " transId2: %x\n", sig->transId2);
38-
fprintf(output, " apiRef: %x\n", sig->apiRef);
39-
fprintf(output, " apiOpRec: %x\n", sig->apiOpRec);
40-
fprintf(output, " lqhConnectPtr: %x\n", sig->lqhConnectPtr);
41-
fprintf(output, " oldTcOpRec: %x\n", sig->oldTcOpRec);
42-
fprintf(output, " requestInfo: %x\n", sig->requestInfo);
43-
fprintf(output, " gci_hi: %x\n", sig->gci_hi);
44-
fprintf(output, " gci_lo: %x\n", sig->gci_lo);
45-
fprintf(output, " nextNodeId1: %x\n", sig->nextNodeId1);
46-
fprintf(output, " nextNodeId2: %x\n", sig->nextNodeId2);
47-
fprintf(output, " nextNodeId3: %x\n", sig->nextNodeId3);
48-
fprintf(output, " tableId: %x\n", sig->tableId);
33+
if (len >= LqhTransConf::MarkerSignalLength) {
34+
fprintf(output, " tcRef: %x\n", sig->tcRef);
35+
fprintf(output, " lqhNodeId: %x\n", sig->lqhNodeId);
36+
fprintf(output, " operationStatus: %x\n", sig->operationStatus);
37+
fprintf(output, " transId1: %x\n", sig->transId1);
38+
fprintf(output, " transId2: %x\n", sig->transId2);
39+
fprintf(output, " apiRef: %x\n", sig->apiRef);
40+
fprintf(output, " apiOpRec: %x\n", sig->apiOpRec);
41+
}
42+
if (len >= LqhTransConf::SignalLength) {
43+
fprintf(output, " lqhConnectPtr: %x\n", sig->lqhConnectPtr);
44+
fprintf(output, " oldTcOpRec: %x\n", sig->oldTcOpRec);
45+
fprintf(output, " requestInfo: %x\n", sig->requestInfo);
46+
fprintf(output, " gci_hi: %x\n", sig->gci_hi);
47+
fprintf(output, " gci_lo: %x\n", sig->gci_lo);
48+
fprintf(output, " nextNodeId1: %x\n", sig->nextNodeId1);
49+
fprintf(output, " nextNodeId2: %x\n", sig->nextNodeId2);
50+
fprintf(output, " nextNodeId3: %x\n", sig->nextNodeId3);
51+
fprintf(output, " tableId: %x\n", sig->tableId);
52+
}
4953
return true;
5054
}
5155

storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2003, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2003, 2025, Oracle and/or its affiliates.
33

44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License, version 2.0,
@@ -11945,8 +11945,8 @@ Dblqh::scanMarkers(Signal* signal,
1194511945
lqhTransConf->transId2 = iter.curr.p->transid2;
1194611946
lqhTransConf->apiRef = iter.curr.p->apiRef;
1194711947
lqhTransConf->apiOpRec = iter.curr.p->apiOprec;
11948-
sendSignal(tcNodeFailPtr.p->newTcBlockref, GSN_LQH_TRANSCONF,
11949-
signal, 7, JBB);
11948+
sendSignal(tcNodeFailPtr.p->newTcBlockref, GSN_LQH_TRANSCONF, signal,
11949+
LqhTransConf::MarkerSignalLength, JBB);
1195011950

1195111951
signal->theData[0] = ZSCAN_MARKERS;
1195211952
signal->theData[1] = tcNodeFailPtr.i;

0 commit comments

Comments
 (0)