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

hcode-hw062823a.opmst failed to compile with Fedora 39 ppc64le #4

Open
runlevel5 opened this issue Aug 19, 2023 · 4 comments
Open

hcode-hw062823a.opmst failed to compile with Fedora 39 ppc64le #4

runlevel5 opened this issue Aug 19, 2023 · 4 comments

Comments

@runlevel5
Copy link

runlevel5 commented Aug 19, 2023

Info

I tried to build a RaptorCS blackbird firmware open-power/op-build#5256 on Fedora 39 ppc64le but got error with hcode-hw062823a.opmst (see Error Output)

I have tried GCC 8.4.0, 9.4, 10.4.0 and 12.3.0 but still produce the same error.

System Details Report


Report details

  • Date generated: 2023-08-20 06:58:21

Hardware Information:

  • Hardware Model: Raptor Computing Blackbird C1P9S01 REV 1.01
  • Memory: 61.4 GiB
  • Processor: POWER9, altivec supported × 32
  • Graphics: AMD Radeon™ RX 6600 XT
  • Disk Capacity: 8.0 TB

Software Information:

  • OS Name: Fedora Linux 39 (Workstation Edition Prerelease)
  • OS Arch: PowerPC 64 LE
  • OS Type: 64-bit
  • Kernel Version: Linux 6.5.0-0.rc6.20230816git4853c74bd7ab.45.fc39.ppc64le

Error Output

    p9_sgpe_img_edit.o
    CC         p9_dd_container.o
    AR         libcen_ringId.a
    C++        p9_scan_compression.o
    AR         libstop_gpeImgEdit.a
    C++        p9_tor.o
    AR         libp9_ring_identification.a
    AR         libp9_xip_image.a
    LD         pstate_gpeImgEdit.exe
    AR         libp9_dd_container.a
    LD         cmeImgEdit.exe
    LDSO       libp9_ringId.so
    AR         libp9_tor.a
    LDSO       libcen_ringId.so
    LD         stop_gpeImgEdit.exe
    C++        common_ringId.o
    LDSO       libp9_ring_identification.so
    LDSO       libp9_dd_container.so
    LDSO       libp9_xip_image.so
    AR         libcommon_ringId.ahcode-hw062823a
    LDSO       libp9_tor.so
    LDSO       libcommon_ringId.so
../../import/chips/p9/utils/imageProcs//p9_scan_compression.C: In function ‘int rs4_embed_cmsk(CompressedScanData**, CompressedScanData*)’:
../../import/chips/p9/utils/imageProcs//p9_scan_compression.C:935:26: error: pointer ‘embeddedAddr’ may be used after ‘void* realloc(void*, size_t)’ [-Werror=use-after-free]
  935 |     memmove(embeddedAddr + embeddedSize,
      |             ~~~~~~~~~~~~~^~~~~~~~~~~~~~
../../import/chips/p9/utils/imageProcs//p9_scan_compression.C:927:43: note: call to ‘void* realloc(void*, size_t)’ here
  927 |     *io_rs4 = (CompressedScanData*)realloc(*io_rs4, totalSize);
      |                                    ~~~~~~~^~~~~~~~~~~~~~~~~~~~
../../import/chips/p9/utils/imageProcs//p9_scan_compression.C:940:11: error: pointer ‘embeddedAddr’ may be used after ‘void* realloc(void*, size_t)’ [-Werror=use-after-free]
  940 |     memcpy(embeddedAddr,
      |     ~~~~~~^~~~~~~~~~~~~~
  941 |            i_rs4Cmsk,
      |            ~~~~~~~~~~
  942 |            embeddedSize);
      |            ~~~~~~~~~~~~~
../../import/chips/p9/utils/imageProcs//p9_scan_compression.C:927:43: note: call to ‘void* realloc(void*, size_t)’ here
  927 |     *io_rs4 = (CompressedScanData*)realloc(*io_rs4, totalSize);
      |                                    ~~~~~~~^~~~~~~~~~~~~~~~~~~~
../../import/chips/p9/utils/imageProcs//p9_scan_compression.C:935:12: error: pointer ‘embeddedAddr’ may be used after ‘void* realloc(void*, size_t)’ [-Werror=use-after-free]
  935 |     memmove(embeddedAddr + embeddedSize,
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  936 |             embeddedAddr,
      |             ~~~~~~~~~~~~~
  937 |             be16toh((*io_rs4)->iv_size) - sizeof(CompressedScanData));
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../import/chips/p9/utils/imageProcs//p9_scan_compression.C:927:43: note: call to ‘void* realloc(void*, size_t)’ here
  927 |     *io_rs4 = (CompressedScanData*)realloc(*io_rs4, totalSize);
      |                                    ~~~~~~~^~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[3]: *** [../../import/chips/p9/utils/imageProcs/p9_scan_compression.mk:32: ../../import/../output/obj/p9_scan_compression/p9_scan_compression.o] Error 1
make[2]: *** [common.dir/order.final.mk:41: _BUILD/MODULE_TARGETS] Error 2
make[1]: *** [Makefile:37: all] Error 2
make[1]: Leaving directory '/home/tle/Work/op-build/output/build/hcode-hw062823a.opmst'
make: *** [package/pkg-gene
@runlevel5 runlevel5 changed the title hcode-hw062823a could not be compiled with Fedora 39 ppc64le hcode-hw062823a.opmst failed to compile with Linux ppc64le Aug 19, 2023
@runlevel5
Copy link
Author

I can also confirm this issue also impacts hcode-hw051123a.opmst

@dcrowell77
Copy link
Contributor

@runlevel5 - What was your previously working level?

@sumitk56 @IlyaSmirnov91

@IlyaSmirnov91
Copy link

Looks like a real bug.

embeddedAddr is declared on line 922 based on io_rs4; then io_rs4 is realloc'ed on line 927, so its pointer could change and point somewhere different. The simple fix here is to declare embeddedAddr after realloc.

@sumitk56 , could you please take a look?

@runlevel5
Copy link
Author

runlevel5 commented Aug 21, 2023

@runlevel5 - What was your previously working level?

This issue only occur on Fedora 37, 38 and 39 (rawhide) ppc64le.

I do not run into this issue with Ubuntu 22.04 ppc64le (with GCC 8.4.0)

@runlevel5 runlevel5 changed the title hcode-hw062823a.opmst failed to compile with Linux ppc64le hcode-hw062823a.opmst failed to compile with Fedora 39 ppc64le Aug 21, 2023
op-jenkins pushed a commit that referenced this issue Oct 9, 2023
track pervasive scan region and SCOM ring hookups based on drop R VHDL
and current Clock Voltage spec XLS

match scan region updates
  FSI     added fsi0inv (region #5)
  TP      added dpllpau (region #8), dpllnest (region #9)
  N0      shifted pe1 to own region (region #4), added iopsi (region #6)
  N1      remove region #1 (mcd -> region #2, pe0 -> region #4)
  PCI     add pcs0..3 (region #2-#5), psm0..3 (region #6-#9)
  MC      remove region #2 (dl01 -> region #3, dl23 -> region #4,
          ioo0 -> region #5, ioo1 -> region #6)
  EQ      added clkadj (region #10)
  AXON    remove odl (region #3)

match scom ring updates
  NMMU    extend match to second SCOM satellite (#1) on ring #3
  PEC,PHB correct n0/n1 instance numbering
          cover additional sat IDs (#4-#6) on PCI chiplet ring #2
  PAUC    rename from PPE
          remove non-IO PPE entries, P10 target will only cover IO PPEs
          add PTL, IO PPE matching rules (direct and per-bus indirect)
	  support match for PAU chiplet pervasive resources
  PAU     update ring matching rules (#2,#3 for first pau unit in chiplet,
          #4,#5 for second)
  IOHS    limit ring match for direct AXON chiplet access to ring #4 (pdl)
          update matching rules for indirect PAU chiplet access via IOPPE,
          remove rules matching direct PAU chiplet access
  EQ      fix matching rules for EQ,C target split of ring space
          on PSCOM endpoint #1
  MC,MI   adjust ring ID (mc_0 shifted from #2 to #3)
          change satellite ID matches to cover MCBIST and PBI
  MCC     adjust ring ID (mc_0 shifted from #2 to #3), cover
          upstream and downstream TL layer registers as well
          as MCBIST/PBI indirect access to the channel facilities
  OMIC    add matches for IO PPE indirect per-group regs,
          MC direct access through omi rings (#5-#6) for shared DL regs
  OMI     add matches for IO PPE indirect per-lane regs,
          MC direct access through omi rings (#5-#6) for sub-channel
          specific DL regs (separate range for non PM and PM specific regs)

update HWP metadata comments for scan xlate source files

fix unitialized variables in p10_scom_xlate impacting clock domain
analysis for chip target scoped input

update unit test to cover matching changes

Change-Id: I66ad0419be5b0915fef81769c82d9f3c3bbea768
Original-Change-Id: I769a4d76266ffcf94d803887e73c6acdf57e5107
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/76629
Tested-by: Jenkins Server <[email protected]>
Reviewed-by: Benjamin Gass <[email protected]>
Tested-by: PPE CI <[email protected]>
Reviewed-by: Thi N. Tran <[email protected]>
Reviewed-by: Joseph J. McGill <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants