<?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>16333</bug_id>
          
          <creation_ts>2026-06-25 16:21:24 +0000</creation_ts>
          <short_desc>Profiling doesn&apos;t work</short_desc>
          <delta_ts>2026-10-29 14:59:54 +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>BitBake</product>
          <component>bitbake</component>
          <version>6.0</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.2 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Burton">ross.burton</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>tim.orling</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>106022</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2026-06-25 16:21:24 +0000</bug_when>
    <thetext>$ bitbake -P main perl -C package
...
ERROR: Task (/home/rosbur01/Yocto/openembedded-core/meta/recipes-devtools/perl/perl_5.42.2.bb:do_package) failed with exit code &apos;1&apos;

The cookerlog has the actual error:

3766965 16:17:50.737188 Parsing started
Traceback (most recent call last):
  File &quot;/home/rosbur01/Yocto/bitbake/bin/bitbake-worker&quot;, line 341, in fork_off_task
    ret = profile.Profile.runcall(prof, child)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File &quot;/usr/lib/python3.12/cProfile.py&quot;, line 109, in runcall
    self.enable()
ValueError: Another profiling tool is already active

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/home/rosbur01/Yocto/bitbake/bin/bitbake-worker&quot;, line 575, in &lt;module&gt;
    profile.Profile.runcall(prof, worker.serve)
  File &quot;/usr/lib/python3.12/cProfile.py&quot;, line 111, in runcall
    return func(*args, **kw)
           ^^^^^^^^^^^^^^^^^
  File &quot;/home/rosbur01/Yocto/bitbake/bin/bitbake-worker&quot;, line 439, in serve
    self.handle_item(b&quot;runtask&quot;, self.handle_runtask)
  File &quot;/home/rosbur01/Yocto/bitbake/bin/bitbake-worker&quot;, line 470, in handle_item
    func(self.queue[(tag_len + 4):index])
  File &quot;/home/rosbur01/Yocto/bitbake/bin/bitbake-worker&quot;, line 520, in handle_runtask
    pid, pipein, pipeout = fork_off_task(self.cookercfg, self.data, self.databuilder, self.workerdata, self.extraconfigdata, runtask)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File &quot;/home/rosbur01/Yocto/bitbake/bin/bitbake-worker&quot;, line 344, in fork_off_task
    bb.utils.process_profilelog(profname)
  File &quot;/home/rosbur01/Yocto/bitbake/lib/bb/utils.py&quot;, line 1482, in process_profilelog
    p = pstatopen()
        ^^^^^^^^^^^
  File &quot;/home/rosbur01/Yocto/bitbake/lib/bb/utils.py&quot;, line 1479, in pstatopen
    return pstats.Stats(fn, stream=pout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File &quot;/usr/lib/python3.12/pstats.py&quot;, line 115, in __init__
    self.init(arg)
  File &quot;/usr/lib/python3.12/pstats.py&quot;, line 129, in init
    self.load_stats(arg)
  File &quot;/usr/lib/python3.12/pstats.py&quot;, line 155, in load_stats
    raise TypeError(&quot;Cannot create or construct a %r object from %r&quot;
TypeError: Cannot create or construct a &lt;class &apos;pstats.Stats&apos;&gt; object from &apos;Thu Jun 25 16:18:12 2026    profile--home-rosbur01-Yocto-openembedded-core-meta-recipes-devtools-perl-perl_5.42.2.bb-do_package.log&apos;
Cannot create or construct a &lt;class &apos;pstats.Stats&apos;&gt; object from &apos;Thu Jun 25 16:18:12 2026    profile--home-rosbur01-Yocto-openembedded-core-meta-recipes-devtools-perl-perl_5.42.2.bb-do_package.log&apos;/home/rosbur01/Yocto/bitbake/bin/bitbake-worker:-1: ResourceWarning: unclosed file &lt;_io.BufferedReader name=3&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106023</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2026-06-25 16:31:33 +0000</bug_when>
    <thetext>Guessing this is the 3.12 change where profiling doesn&apos;t get disabled over threads?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>