-
Notifications
You must be signed in to change notification settings - Fork 6
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
gcc13 warning: FFDC pointer alignment #1
Comments
This code is generated by the perl script here: pub-ekb/hwpf/fapi2/tools/parseErrorInfo_p10.pl Line 1893 in 7fd7e4d
The call site is here: https://github.com/open-power/libekb_p10/blob/3d1b2963082d7725c3a4a2960d6f3f3336f401a7/libekb.C#L258 void libekb_get_sbe_ffdc(FFDC& ffdc, const sbeFfdcPacketType& ffdc_pkt,
int proc_index)
{
using namespace fapi2;
fapi2::ReturnCode rc;
std::vector<sbeFfdc_t> ffdc_endian;
FAPI_SET_SBE_ERROR(rc, ffdc_pkt.fapiRc, ffdc_endian.data(), proc_index); typedef struct sbeFfdcPacket {
uint32_t fapiRc; // Fapi Rc
uint32_t ffdcLengthInWords; // length of Fapi FFDC data
uint32_t *ffdcData; // fapi FFDC data
~sbeFfdcPacket()
{
// freeup the ffdcData allocated memory
if (ffdcData) {
delete ffdcData;
}
}
} sbeFfdcPacketType; struct sbeFfdc_t
{
uint32_t size;
uint64_t data;
} __attribute__((packed)); #define FAPI_SET_SBE_ERROR(RC,ERRVAL,FFDC_BUFFER,SBE_INSTANCE)\
We are trying to take the data from the vector of
|
If I change the temporary buffer in libekb.C to a std::vector<uint32_t>: --- a/libekb.C
+++ b/libekb.C
@@ -229,9 +229,9 @@ void libekb_get_sbe_ffdc(FFDC& ffdc, const sbeFfdcPacketType& ffdc_pkt,
// Get size of FFDC data in bytes. exculde RC size.
size_t size = (ffdc_pkt.ffdcLengthInWords - 1) * sizeof(uint32_t);
- // Create temporary sbeFfdc_t to store the data after endianess
- // conversion.
- std::vector<sbeFfdc_t> ffdc_endian;
+ // Create temporary vector to store the data after endianess
+ // conversion.
+ std::vector<uint32_t> ffdc_endian;
// get size of sbeFfdc_t structre
size_t sbe_ffdc_size = sizeof(sbeFfdc_t);
@@ -251,7 +251,8 @@ void libekb_get_sbe_ffdc(FFDC& ffdc, const sbeFfdcPacketType& ffdc_pkt,
} else {
ffdc_data.data = sbe_ffdc->data;
}
- ffdc_endian.push_back(ffdc_data);
+ ffdc_endian.push_back(ffdc_data.size);
+ ffdc_endian.push_back(ffdc_data.data); This breaks because the setSbeError calls in the generated I think the fix is to copy the data to an intermediate buffer before creating fapi2::variable_buffer l_buffer, or create a new fapi2::variable_buffer constructor that takes a byte array. |
The text was updated successfully, but these errors were encountered: