You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]Sof-logger ABI version is mismatch with .ldc file built by xcc #2507
Describe the bug
Error: abi version in /etc/sof/sof-apl.ldc file does not coincide with abi version used by logger.
logger ABI Version is 4:2:0
ldc_file ABI Version is 3:14:0
To Reproduce
Reboot via "sudo reboot"
Check with command "sudo sof-logger -l /etc/sof/sof-apl.ldc -t"
Reproduction Rate
100%
Expected behavior
Can see sof trace print normal
Impact
No sof trace because sof-logger ABI mismatch with .ldc file
Environment
Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
on below platforms also has this paoblem
GLK Chrome with onboard codec DA7219 in I2S mode
CML laptop with onboard codec ALC3204 in HDA mode
ICL-U RVP with onboard codec ALC700 in HDA mode
TGL-U RVP with onboard codec ALC711 in HDA mode
CFL-S RVP with onboard codec ALC700 in HDA mode
Firmware manifest and signing completed !
fw abi main version: 3:14:0
PXL: fw abi dbg type: 1f, b8
PXL: fw abi dbg type: 2e, 50
PXL: fw abi dbg type: 0, 70000000
fw abi dbg version: 3:14:0
logs dictionary: size 75680
Dump from elf file
Note the size for the SOF_IPC_EXT_CC_INFO cc_versionis is 0x50, but actually the size is 0x4c. Not sure if this issue is that my CC_DESC here is RG-2017.8-linux and this is 16-char length (a space at the beginning)
@macchian@lgirdwood@ktrzcinx I have a fix here to change flex array into static one to avoid issues between different compiler. #2522
I can also think solution like, move the flex array to the end of the fw_ready_metadata section.
As I see, there is a some limitation in XCC because RG-2017.8-linux string should be terminated with '\0' but I can't see it. Moreover this terminating zero is included in sizeof(CC_DESC), so there is also a solution like this:
fw abi main version: 3:14:0
PXL: fw abi dbg type: 1, b8
PXL: fw abi dbg type: 2, 4c
PXL: fw abi dbg type: 3, 1c
PXL: fw abi dbg type: 4, 10
PXL: fw abi dbg version: 4002000
fw abi dbg version: 4:2:0
Another possible issue in future is related with lack of memory alignment, SOF_IPC_EXT_PROBE_INFO starts just after SOF_IPC_EXT_CC_INFO, but there should be padding to '4
@kakulesza Yep, I think this is because that the 0 at the end maybe merged by the all four sections in __section(".fw_ready_metadata") is merged in ELF.
Your solution will result a overflow as the CC_DESC STRING has no termination. It will result in issues in the later use.
Not sure if this issue is that my CC_DESC here is RG-2017.8-linux
It seems to work on my system since the beginning because I am compiling with the Windows version of the tools and this section looks like (note 4c and two extra zeroes because of shorter description):
@mmaka1 Oh, that explain why we have different result. The issue seems to be more related to the cc_version.c . @jajanusz@tlauda@lgirdwood Do you know any issue like this here?
It seems the flex length structure in ELF may not have the right layout as we expected. So I think we should avoid flex length structure in ELF file #2522
Do you mean on linux version of compiler? For me it's weird that same version of compiler gives different output just cos of os, but anyway, it's better to w/a issue with having fixed sizes on problematic fields.
Activity
Liviali155 commentedon Mar 9, 2020
on below platforms also has this paoblem
GLK Chrome with onboard codec DA7219 in I2S mode
CML laptop with onboard codec ALC3204 in HDA mode
ICL-U RVP with onboard codec ALC700 in HDA mode
TGL-U RVP with onboard codec ALC711 in HDA mode
CFL-S RVP with onboard codec ALC700 in HDA mode
dengyangchao commentedon Mar 9, 2020
Bi-sect result: caused by master 332e150 , @mmaka1 please help to check this
mmaka1 commentedon Mar 9, 2020
Rebuild and upgrade the logger when you see a version mismatch.
6 remaining items
mmaka1 commentedon Mar 10, 2020
@xiulipan Are you sure you did a clean build? I am using xcc all the time. This is from my system:
You should also see the current dbg abi version when running rimage as Liam mentioned:
xiulipan commentedon Mar 11, 2020
@mmaka1 @lgirdwood I did some dig in and find this is related to maybe compiler. Here is my analysis:
First to easily dump info from ELF file I add some debug patch to change the ENUM
Then I add some logs into rimage:
And here is what I got
Dump from elf file
Note the size for the
SOF_IPC_EXT_CC_INFO cc_versionisis 0x50, but actually the size is 0x4c. Not sure if this issue is that my CC_DESC here isRG-2017.8-linuxand this is 16-char length (a space at the beginning)xiulipan commentedon Mar 11, 2020
@macchian @lgirdwood @ktrzcinx I have a fix here to change flex array into static one to avoid issues between different compiler. #2522
I can also think solution like, move the flex array to the end of the fw_ready_metadata section.
rimage logs will becomes to
ktrzcinx commentedon Mar 11, 2020
As I see, there is a some limitation in XCC because
RG-2017.8-linuxstring should be terminated with '\0' but I can't see it. Moreover this terminating zero is included insizeof(CC_DESC), so there is also a solution like this:After this change:
Another possible issue in future is related with lack of memory alignment,
SOF_IPC_EXT_PROBE_INFOstarts just afterSOF_IPC_EXT_CC_INFO, but there should be padding to '4xiulipan commentedon Mar 11, 2020
@kakulesza Yep, I think this is because that the
0at the end maybe merged by the all four sections in__section(".fw_ready_metadata")is merged in ELF.Your solution will result a overflow as the CC_DESC STRING has no termination. It will result in issues in the later use.
mmaka1 commentedon Mar 11, 2020
@xiulipan
It seems to work on my system since the beginning because I am compiling with the Windows version of the tools and this section looks like (note 4c and two extra zeroes because of shorter description):
xiulipan commentedon Mar 12, 2020
@mmaka1 Oh, that explain why we have different result. The issue seems to be more related to the
cc_version.c.@jajanusz @tlauda @lgirdwood Do you know any issue like this here?
It seems the flex length structure in ELF may not have the right layout as we expected. So I think we should avoid flex length structure in ELF file #2522
jajanusz commentedon Mar 13, 2020
Do you mean on linux version of compiler? For me it's weird that same version of compiler gives different output just cos of os, but anyway, it's better to w/a issue with having fixed sizes on problematic fields.
xiulipan commentedon Mar 16, 2020
@jajanusz After debug, it seems to be related to the flex length structure when assemble to section in ELF. The appending length will disappear.
xiulipan commentedon Mar 16, 2020
Update with compare test between GCC and XCC, it seems to be some issue related to compiler linker.
XCC got header size 0x50, actual binary size 0x4c
GCC got both size is 0x50
mengdonglin commentedon Mar 31, 2020
worked around by #2647
Liviali155 commentedon Mar 31, 2020
Error not seen because PR #2647 merged,closed it