<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>14976</bug_id>
          
          <creation_ts>2022-11-28 21:20:33 +0000</creation_ts>
          <short_desc>go crashes with &quot;panic: runtime error: index out of range [0] with length 0&quot;</short_desc>
          <delta_ts>2026-02-19 16:26:01 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>4.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>OBSOLETE</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Denys Dmytriyenko">denis</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>94461</commentid>
    <comment_count>0</comment_count>
    <who name="Denys Dmytriyenko">denis</who>
    <bug_when>2022-11-28 21:20:33 +0000</bug_when>
    <thetext>On some platforms, including, but not limited to, riscv64/qemuriscv64, go lang crashes with &quot;panic: runtime error: index out of range [0] with length 0&quot; when building several packages, namely docker/container related from meta-virtualization.

This has previously discussed in this thread:
https://lists.openembedded.org/g/openembedded-core/topic/94022663

And identified to be caused by this patch:
https://git.openembedded.org/openembedded-core/tree/meta/recipes-devtools/go/go/0001-cmd-go-make-content-based-hash-generation-less-pedan.patch

$ bitbake docker-ce -k
Loading cache: 100% |#######################################################################| Time: 0:00:00
Loaded 4136 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = &quot;2.2.0&quot;
BUILD_SYS            = &quot;x86_64-linux&quot;
NATIVELSBSTRING      = &quot;universal&quot;
TARGET_SYS           = &quot;riscv64-poky-linux&quot;
MACHINE              = &quot;qemuriscv64&quot;
DISTRO               = &quot;poky&quot;
DISTRO_VERSION       = &quot;4.1&quot;
TUNE_FEATURES        = &quot;riscv64&quot;
meta                 
meta-poky            
meta-yocto-bsp       = &quot;master:b3061544c2bb4c0f47681f8a0cc700c84440cd7e&quot;
meta-oe              
meta-networking      
meta-python          
meta-filesystems     = &quot;master:c4829fa338dae008c75cfffd4a712813a99c33c4&quot;
meta-virtualization  = &quot;master:3626f2c9ccd56c6a3ee51304a7da7aafb395a588&quot;

Initialising tasks: 100% |###########################################################################################| Time: 0:00:00


| HASH subkey 4dad2cb36e6f0723b2a5c4133077e3da50b0efe2c8bfa38ded136139f27b8085 &quot;stdout&quot; = 04e7bcaf88bbb52c44ee7a2bd00dd468fe6edff4518beb3f433e6f1a478debed
| HASH subkey 1a898b46dfb141ffb81736c647cd39359e80ed266cc8956eb04746ab065df683 &quot;srcfiles&quot; = e43323c8f7a53cce942af7898fca6214bb27dcafa121e8f9da4284295b713487
| panic: runtime error: index out of range [0] with length 0
| 
| goroutine 11454 [running]:
| cmd/go/internal/work.(*Builder).buildActionID(0xc000003180, 0xc002502000)
|       /OE/poky-virt-master/build/tmp/work/x86_64-linux/go-cross-riscv64/1.19.3-r0/recipe-sysroot-native/usr/lib/riscv64-poky-linux/go/src/cmd/go/internal/work/exec.go:281 +0x2425
| cmd/go/internal/work.(*Builder).build(0xc000003180, {0xc00002a268?, 0x0?}, 0xc002502000)
|       /OE/poky-virt-master/build/tmp/work/x86_64-linux/go-cross-riscv64/1.19.3-r0/recipe-sysroot-native/usr/lib/riscv64-poky-linux/go/src/cmd/go/internal/work/exec.go:478 +0x199
| cmd/go/internal/work.(*Builder).Do.func2({0xb2f8d0, 0xc00002a268}, 0xc002502000)
|       /OE/poky-virt-master/build/tmp/work/x86_64-linux/go-cross-riscv64/1.19.3-r0/recipe-sysroot-native/usr/lib/riscv64-poky-linux/go/src/cmd/go/internal/work/exec.go:139 +0x5fc
| cmd/go/internal/work.(*Builder).Do.func3()
|       /OE/poky-virt-master/build/tmp/work/x86_64-linux/go-cross-riscv64/1.19.3-r0/recipe-sysroot-native/usr/lib/riscv64-poky-linux/go/src/cmd/go/internal/work/exec.go:201 +0xb9
| created by cmd/go/internal/work.(*Builder).Do
|       /OE/poky-virt-master/build/tmp/work/x86_64-linux/go-cross-riscv64/1.19.3-r0/recipe-sysroot-native/usr/lib/riscv64-poky-linux/go/src/cmd/go/internal/work/exec.go:187 +0x3f5
| WARNING: exit code 2 from a shell command.
ERROR: Task (/OE/poky-virt-master/meta-virtualization/recipes-containers/docker/docker-ce_git.bb:do_compile) failed with exit code &apos;1&apos;


Summary: 3 tasks failed:
  /OE/poky-virt-master/meta-virtualization/recipes-containers/runc/runc-opencontainers_git.bb:do_compile
  /OE/poky-virt-master/meta-virtualization/recipes-containers/containerd/containerd-opencontainers_git.bb:do_compile
  /OE/poky-virt-master/meta-virtualization/recipes-containers/docker/docker-ce_git.bb:do_compile</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94462</commentid>
    <comment_count>1</comment_count>
    <who name="Denys Dmytriyenko">denis</who>
    <bug_when>2022-11-28 21:22:51 +0000</bug_when>
    <thetext>A patch has been proposed on the list:
https://lists.openembedded.org/g/openembedded-core/topic/95320460</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94497</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2022-12-08 15:36:35 +0000</bug_when>
    <thetext>https://git.yoctoproject.org/poky/commit/?id=058def277e0cd8e262ba8f3d5821ec5300de7466</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94498</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2022-12-08 15:37:52 +0000</bug_when>
    <thetext>Patch fixes one problem but there are more issues to deal with.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96956</commentid>
    <comment_count>4</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-10-24 14:24:51 +0000</bug_when>
    <thetext>Bulk move from 4.99 or 0.00 to 5.99</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104361</commentid>
    <comment_count>5</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2026-02-19 16:26:01 +0000</bug_when>
    <thetext>Create a new bug with specific reproducer if it is still a problem.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>