<?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>15170</bug_id>
          
          <creation_ts>2023-07-24 08:19:39 +0000</creation_ts>
          <short_desc>[4.3 M2 RC1] segfault for createrepo_c on beaglebone and qemuarm</short_desc>
          <delta_ts>2023-07-28 04:59:55 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>11</classification_id>
          <classification>Runtime</classification>
          <product>General Runtime</product>
          <component>General Runtime</component>
          <version>4.3</version>
          <rep_platform>BeagleBone</rep_platform>
          <op_sys>arm</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>4.3 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yi Zhao">yi.zhao</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>jay.shen.teoh</cc>
    
    <cc>jing.hui.tham</cc>
    
    <cc>jon.mason</cc>
    
    <cc>raj.khem</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>ross.burton</cc>
    
    <cc>yi.zhao</cc>
          
          <qa_contact name="Yi Zhao">yi.zhao</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>Regression (Used to work)</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>96022</commentid>
    <comment_count>0</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2023-07-24 08:19:39 +0000</bug_when>
    <thetext>Image Location: https://autobuilder.yocto.io/pub/releases/yocto-4.3_M2.rc1/machines/beaglebone-yocto/

Poky git rev: f73ae292bc0b92df3cb76c6e8b220f18630f6bc7


Steps:
1. Deploy rootfs image and boot up.
2. Install createrepo-c:
   $ rpm -ivh createrepo-c-0.21.1-r0.cortexa8hf_neon.rpm
3. Run creatrepo_c to create a local repo:
   $ mkdir localrepo
   $ createrepo_c ./localrepo
   Directory walk started
   Directory walk done - 0 packages
   Temporary output repo path: ./localrepo/.repodata/
   Preparing sqlite DBs
   Pool started (with 5 workers)
   Pool finished
   Segmentation fault



This issue happens on beaglebone-yocto and qemuarm. I also tested on qemux86-64 and qemuarm64, there is no such issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96031</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-07-25 10:30:41 +0000</bug_when>
    <thetext>sqlite regressing on 32 bit arm?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96035</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-07-26 16:20:06 +0000</bug_when>
    <thetext>I reverted various upgrades back to 3.40.1 and it still segfaults</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96037</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-07-26 17:09:26 +0000</bug_when>
    <thetext>I&apos;ve confirmed it is the time64.inc changes that trigger the segfault</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96038</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-07-26 18:52:45 +0000</bug_when>
    <thetext>Thread 1 &quot;createrepo_c&quot; received signal SIGSEGV, Segmentation fault.
__GI_strlen () at ../sysdeps/arm/armv6t2/strlen.S:126
126	../sysdeps/arm/armv6t2/strlen.S: No such file or directory.
(gdb) bt
#0  __GI_strlen () at ../sysdeps/arm/armv6t2/strlen.S:126
#1  0xb6dd8434 in __printf_buffer (buf=buf@entry=0xbefff5f0, format=format@entry=0xbefff708 &quot;&quot;, ap=..., mode_flags=mode_flags@entry=2)
    at vfprintf-process-arg.c:435
#2  0xb6decd0e in __vasprintf_internal
    (result_ptr=result_ptr@entry=0xbefff708, format=format@entry=0xbefff708 &quot;&quot;, args=..., mode_flags=mode_flags@entry=2) at vasprintf.c:102
#3  0xb6e5ae38 in __vasprintf_chk (result_ptr=result_ptr@entry=0xbefff708, flag=flag@entry=1, format=format@entry=0xbefff708 &quot;&quot;, ap=...)
    at vasprintf_chk.c:36
#4  0xb6f401c4 in vasprintf (__ap=..., __fmt=&lt;optimized out&gt;, __ptr=0xbefff708) at /usr/include/bits/stdio2.h:169
#5  g_vasprintf (string=string@entry=0xbefff708, format=format@entry=0x0, args=...) at /usr/src/debug/glib-2.0/1_2.76.4-r0/glib/gprintf.c:340
#6  0xb6f16fb0 in g_strdup_vprintf (format=format@entry=0x0, args=..., args@entry=...) at /usr/src/debug/glib-2.0/1_2.76.4-r0/glib/gstrfuncs.c:553
#7  0xb6f17000 in g_strdup_printf (format=0xb6fd0e68 &quot;%s%jd.%s.%ld%s&quot;) at /usr/src/debug/glib-2.0/1_2.76.4-r0/glib/gstrfuncs.c:583
#8  0xb6fbf8d6 in cr_append_pid_and_datetime (str=&lt;optimized out&gt;, suffix=suffix@entry=0x0) at /usr/src/debug/createrepo-c/0.21.1-r0/src/misc.c:1501
#9  0x00405962 in main (argc=&lt;optimized out&gt;, argv=&lt;optimized out&gt;) at /usr/src/debug/createrepo-c/0.21.1-r0/src/createrepo_c.c:2473</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96039</commentid>
    <comment_count>5</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-07-26 19:01:57 +0000</bug_when>
    <thetext>Compile log has a corresponding:

/media/build/poky/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/createrepo-c/0.21.1-r0/git/src/misc.c: In function &apos;cr_append_pid_and_datetime&apos;:
/media/build/poky/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/createrepo-c/0.21.1-r0/git/src/misc.c:1501:49: warning: format &apos;%ld&apos; expects argument of type &apos;long int&apos;, but argument 5 has type &apos;__suseconds
64_t&apos; {aka &apos;long long int&apos;} [-Wformat=]
 1501 |     gchar *result = g_strdup_printf(&quot;%s%jd.%s.%ld%s&quot;,
      |                                               ~~^
      |                                                 |
      |                                                 long int
      |                                               %lld
......
 1505 |                                     tv.tv_usec,
      |                                     ~~~~~~~~~~   
      |                                       |
      |                                       __suseconds64_t {aka long long int}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96040</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-07-26 19:12:56 +0000</bug_when>
    <thetext>Also suspect we may need to fix:

/media/build/poky/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/createrepo-c/0.21.1-r0/git/src/xml_dump_repomd.c
/media/build/poky/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/createrepo-c/0.21.1-r0/git/src/xml_dump_repomd.c: In function &apos;cr_xml_dump_repomd_body&apos;:
/media/build/poky/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/createrepo-c/0.21.1-r0/git/src/xml_dump_repomd.c:146:41: warning: format &apos;%ld&apos; expects argument of type &apos;long int&apos;, but argument 2 has type &apos;time_t&apos; {aka &apos;long long int&apos;} [-Wformat=]
  146 |         gchar *rev = g_strdup_printf(&quot;%ld&quot;, time(NULL));
      |                                       ~~^   ~~~~~~~~~~
      |                                         |   |
      |                                         |   time_t {aka long long int}
      |                                         long int
      |                                       %lld


and

/media/build/poky/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/createrepo-c/0.21.1-r0/git/src/createrepo_c.c: In function &apos;duplicates_warning&apos;:
/media/build/poky/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/createrepo-c/0.21.1-r0/git/src/createrepo_c.c:643:17: warning: format &apos;%ld&apos; expects argument of type &apos;long int&apos;, but argument 5 has type &apos;gint64&apos; {aka &apos;long long int&apos;} [-Wformat=]
  643 |       g_warning(&quot;    Sourced from location: \&apos;%s\&apos;, build timestamp: %ld%s&quot;,
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  644 |                 location.location,
  645 |                 location.pkg-&gt;time_build,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~
      |                             |
      |                             gint64 {aka long long int}
/media/build/poky/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/createrepo-c/0.21.1-r0/recipe-sysroot/usr/include/glib-2.0/glib/gmessages.h:356:32: note: in definition of macro &apos;g_warning&apos;
  356 |                                __VA_ARGS__)
      |                                ^~~~~~~~~~~
/media/build/poky/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/createrepo-c/0.21.1-r0/git/src/createrepo_c.c:643:72: note: format string is defined here
  643 |       g_warning(&quot;    Sourced from location: \&apos;%s\&apos;, build timestamp: %ld%s&quot;,
      |                                                                      ~~^
      |                                                                        |
      |                                                                        long int
      |                                                                      %lld</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96041</commentid>
    <comment_count>7</comment_count>
      <attachid>4964</attachid>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2023-07-26 19:30:07 +0000</bug_when>
    <thetext>Created attachment 4964
proposed fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96125</commentid>
    <comment_count>8</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-07-27 14:41:55 +0000</bug_when>
    <thetext>https://git.yoctoproject.org/poky/commit/?id=5e7bf2a17d888bf2a8afcbbbd92269d873e7422c</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96137</commentid>
    <comment_count>9</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2023-07-28 04:59:55 +0000</bug_when>
    <thetext>Verified with 4.3 M2 RC2 (poky git rev: 3eff0eb5ea77de20d85a2ffc64652579cbd7755c)</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>4964</attachid>
            <date>2023-07-26 19:30:07 +0000</date>
            <delta_ts>2023-07-26 19:30:07 +0000</delta_ts>
            <desc>proposed fix.</desc>
            <filename>0001-Adjust-printf-formats-for-64bit-time_t-on-32bit-syst.patch</filename>
            <type>text/plain</type>
            <size>2767</size>
            <attacher name="Khem Raj">raj.khem</attacher>
            
              <data encoding="base64">RnJvbSA4OWUxYzk0MTVmYjg0MzgzMTAwMzZkNTgxMGNkYjdkYTc1ZWUzYTdmIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBLaGVtIFJhaiA8cmFqLmtoZW1AZ21haWwuY29tPgpEYXRlOiBX
ZWQsIDI2IEp1bCAyMDIzIDEyOjI3OjE0IC0wNzAwClN1YmplY3Q6IFtQQVRDSF0gQWRqdXN0IHBy
aW50ZiBmb3JtYXRzIGZvciA2NGJpdCB0aW1lX3Qgb24gMzJiaXQgc3lzdGVtcwoKRml4ZXMgZm9y
bWF0IHNwZWNpZmllciBtaXNtYXRjaCB3YXJuaW5ncyBhcyB3ZWxsIHdoaWxlIGhlcmUKCmUuZy4K
d2FybmluZzogZm9ybWF0ICclbGQnIGV4cGVjdHMgYXJndW1lbnQgb2YgdHlwZSAnbG9uZyBpbnQn
LCBidXQgYXJndW1lbnQgMiBoYXMgdHlwZSAndGltZV90JwoKVXBzdHJlYW0tU3RhdHVzOiBQZW5k
aW5nCgpTaWduZWQtb2ZmLWJ5OiBLaGVtIFJhaiA8cmFqLmtoZW1AZ21haWwuY29tPgotLS0KIHNy
Yy9jcmVhdGVyZXBvX2MuYyAgICB8IDQgKystLQogc3JjL21pc2MuYyAgICAgICAgICAgIHwgNCAr
Ky0tCiBzcmMveG1sX2R1bXBfc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raXBfZHVtcCA/IHNraXBfcmVh
c29uIDogIiIpOwogCiAgIH0KZGlmZiAtLWdpdCBhL3NyYy9taXNjLmMgYi9zcmMvbWlzYy5jCmlu
ZGV4IDg1MTFjYTIuLjc4NjZjN2IgMTAwNjQ0Ci0tLSBhL3NyYy9taXNjLmMKKysrIGIvc3JjL21p
c2MuYwpAQCAtMTUxMiwxMSArMTUxMiwxMSBAQCBjcl9hcHBlbmRfcGlkX2FuZF9kYXRldGltZShj
b25zdCBjaGFyICpzdHIsIGNvbnN0IGNoYXIgKnN1ZmZpeCkKICAgICBnZXR0aW1lb2ZkYXkoJnR2
LCBOVUxMKTsKICAgICB0aW1laW5mbyA9IGxvY2FsdGltZSAoJih0di50dl9zZWMpKTsKICAgICBz
dHJmdGltZShkYXRldGltZSwgODAsICIlWSVtJWQlSCVNJVMiLCB0aW1laW5mbyk7Ci0gICAgZ2No
YXIgKnJlc3VsdCA9IGdfc3RyZHVwX3ByaW50ZigiJXMlamQuJXMuJWxkJXMiLAorICAgIGdjaGFy
ICpyZXN1bHQgPSBnX3N0cmR1cF9wcmludGYoIiVzJWpkLiVzLiVqZCVzIiwKICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgIHN0ciA/IHN0ciA6ICIiLAogICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgKGludG1heF90KSBnZXRwaWQoKSwKICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIGRhdGV0aW1lLAotICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgdHYudHZfdXNlYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgIChpbnRtYXhfdCkgdHYudHZfdXNlYywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgIHN1ZmZpeCA/IHN1ZmZpeCA6ICIiKTsKICAgICByZXR1cm4gcmVzdWx0OwogfQpkaWZm
IC0tZ2l0IGEvc3JjL3htbF9kdW1wX3JlcG9tZC5jIGIvc3JjL3htbF9kdW1wX3JlcG9tZC5jCmlu
ZGV4IDMzYjBlMDkuLjlkMjQyNDkgMTAwNjQ0Ci0tLSBhL3NyYy94bWxfZHVtcF9yZXBvbWQuYwor
KysgYi9zcmMveG1sX2R1bXBfcmVwb21kLmMKQEAgLTE0Myw3ICsxNDMsNyBAQCBjcl94bWxfZHVt
cF9yZXBvbWRfYm9keSh4bWxOb2RlUHRyIHJvb3QsIGNyX1JlcG9tZCAqcmVwb21kKQogICAgICAg
ICAgICAgICAgICAgICAgICAgICAgQkFEX0NBU1QgcmVwb21kLT5yZXZpc2lvbik7CiAgICAgfSBl
bHNlIHsKICAgICAgICAgLy8gVXNlIHRoZSBjdXJyZW50IHRpbWUgaWYgbm8gcmV2aXNpb24gd2Fz
IGV4cGxpY2l0bHkgc3BlY2lmaWVkCi0gICAgICAgIGdjaGFyICpyZXYgPSBnX3N0cmR1cF9wcmlu
dGYoIiVsZCIsIHRpbWUoTlVMTCkpOworICAgICAgICBnY2hhciAqcmV2ID0gZ19zdHJkdXBfcHJp
bnRmKCIlamQiLCAoaW50bWF4X3QpIHRpbWUoTlVMTCkpOwogICAgICAgICB4bWxOZXdDaGlsZChy
b290LCBOVUxMLCBCQURfQ0FTVCAicmV2aXNpb24iLCBCQURfQ0FTVCByZXYpOwogICAgICAgICBn
X2ZyZWUocmV2KTsKICAgICB9Ci0tIAoyLjQxLjAKCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>