<?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>2881</bug_id>
          
          <creation_ts>2012-08-02 18:23:41 +0000</creation_ts>
          <short_desc>Under pseudo rm of files &gt; 2GB fail with errno 75 = Value too large for defined data type</short_desc>
          <delta_ts>2013-05-01 15:43:32 +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>Meta-yocto</product>
          <component>meta-yocto</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andrei Gherzan">andrei</reporter>
          <assigned_to name="Seebs">seebs</assigned_to>
          <cc>jessica.zhang</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>23759</commentid>
    <comment_count>0</comment_count>
    <who name="Andrei Gherzan">andrei</who>
    <bug_when>2012-08-02 18:23:41 +0000</bug_when>
    <thetext>cannot remove ‘rpi-hwup-image-raspberrypi-20120802151428.rootfs.rpi-sdimg.bak’: Value too large for defined data type</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23761</commentid>
    <comment_count>1</comment_count>
    <who name="Andrei Gherzan">andrei</who>
    <bug_when>2012-08-02 19:56:58 +0000</bug_when>
    <thetext>Fix:
http://lists.linuxtogo.org/pipermail/openembedded-core/2012-August/027186.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23766</commentid>
    <comment_count>2</comment_count>
    <who name="Seebs">seebs</who>
    <bug_when>2012-08-02 23:35:30 +0000</bug_when>
    <thetext>Okay, I&apos;ve done some poking at this, and I think I have a fix. In fact, I would go so far as to say that I&apos;ve tested the fix, a little. Only on a 64-bit box, but I made a 32-bit pseudo and a 32-bit app that called rmdir, and I did get the behavior I expected.

So that&apos;s the PSEUDO_1_4_1 branch, if someone wants to give it a whirl. I&apos;ll get it code reviewed and then see about trying to update.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23785</commentid>
    <comment_count>3</comment_count>
    <who name="Andrei Gherzan">andrei</who>
    <bug_when>2012-08-03 08:36:18 +0000</bug_when>
    <thetext>Your patched seemed OK - obviously much better than my 2 line patch. :)

But while testing...
tar: ./var/volatile/cache/ldconfig/aux-cache: Unknown file type; file ignored
So now it crashes in tar...

ag</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23819</commentid>
    <comment_count>4</comment_count>
    <who name="Andrei Gherzan">andrei</who>
    <bug_when>2012-08-06 10:07:43 +0000</bug_when>
    <thetext>More info:

Ubuntu says:
---
The crashed program seems to use third-party or local libraries:

/home/agherzan/work/personal/yocto/2012-07-24-rpi/tmp/sysroots/i686-linux/usr/lib/pseudo/lib/libpseudo.so

It is highly recommended to check if the problem persists without those first.

Do you want to continue the report process anyway?
---

(In reply to comment #3)
&gt; Your patched seemed OK - obviously much better than my 2 line patch. :)
&gt; 
&gt; But while testing...
&gt; tar: ./var/volatile/cache/ldconfig/aux-cache: Unknown file type; file ignored
&gt; So now it crashes in tar...
&gt; 
&gt; ag</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23830</commentid>
    <comment_count>5</comment_count>
    <who name="Seebs">seebs</who>
    <bug_when>2012-08-06 17:39:51 +0000</bug_when>
    <thetext>Okay, I don&apos;t have a 32-bit system handy (wow, never thought I&apos;d say THAT).

I&apos;d be interested in more data on this; in particular, in stat information for the file, both inside and outside pseudo. Worst case... ugh. I wish I&apos;d gotten to fixing the debug output yet. I want to know what tar&apos;s calling that it&apos;s getting an unexpected response from, but the only way I know of to get real information about wrappers called is PSEUDO_DEBUG=4, which is ridiculously verbose.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23832</commentid>
    <comment_count>6</comment_count>
    <who name="Seebs">seebs</who>
    <bug_when>2012-08-06 18:24:31 +0000</bug_when>
    <thetext>Okay, I looked into tar a bit. Ultimately, the value in st_mode (which is the only thing that can trigger that diagnostic, unless you&apos;re using a V7_FORMAT archive) comes from a call to either stat() or lstat().

So the call chain from those is roughly:

stat calls fxstatat which does a real fxstatat() on the buffer, then calls the fxstatat64() wrapper on a 64-bit buffer, and overwrites all the standard/known stat buffer values in the plain stat from the stat64. This could result in a meaningless size (which you&apos;d have gotten anyway), but it should not result in an invalid mode; the mode should either come from the filesystem or the database.

If you can easily arrange to replace the version of tar being used, could you run with one that dumps the mode it reports, and/or run the tar command with PSEUDO_DEBUG=2 and get me a copy of the logs? (Warning: they will be huge. You might want to do a dummy command like &quot;tar cf /dev/null var/blah/blah/that-single-file&quot; to shorten them.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23833</commentid>
    <comment_count>7</comment_count>
    <who name="Andrei Gherzan">andrei</who>
    <bug_when>2012-08-06 18:45:03 +0000</bug_when>
    <thetext>Here is an example with DEBUG=4

25313: called: __fxstat64
25313: fstat /home/agherzan/work/personal/yocto/2012-08-06-rpi/tmp/work/raspberrypi-poky-linux-gnueabi/rpi-hwup-image-1.0-r0/rootfs/lib/modules/3.1.9/kernel/drivers/usb/storage/ums-onetouch.ko [fd 14] (+buf) [dev/ino: 2054/16781491] (0100644): processing request [ino 16781491]
25313: sending request [ino 16781491]
25313: sending a message: ino 16781491
25313: msg type 3 (fstat), external path /home/agherzan/work/personal/yocto/2012-08-06-rpi/tmp/work/raspberrypi-poky-linux-gnueabi/rpi-hwup-image-1.0-r0/rootfs/lib/modules/3.1.9/kernel/drivers/usb/storage/ums-onetouch.ko, mode 0100644
25313: got header, type 4, pathlen 0
25313: got response type 4
25313: (25313) fail mode 0100644 uid 1000:1000
25313: completed: __fxstat64 (errno: 0)
25313: called: close
25313: close /home/agherzan/work/personal/yocto/2012-08-06-rpi/tmp/work/raspberrypi-poky-linux-gnueabi/rpi-hwup-image-1.0-r0/rootfs/lib/modules/3.1.9/kernel/drivers/usb/storage/ums-onetouch.ko [fd 14]: processing request [ino 0]
25313: (25313) (no request)
25313: completed: close (errno: 0)
25313: called: __fxstatat64
25313: base_path: /home/agherzan/work/personal/yocto/2012-08-06-rpi/tmp/work/raspberrypi-poky-linux-gnueabi/rpi-hwup-image-1.0-r0/rootfs/lib/modules/3.1.9/kernel/drivers/usb/storage&lt;/&gt;ums-sddr09.ko
25313: root_path [__fxstatat64, 280]: &apos;/home/agherzan/work/personal/yocto/2012-08-06-rpi/tmp/work/raspberrypi-poky-linux-gnueabi/rpi-hwup-image-1.0-r0/rootfs/lib/modules/3.1.9/kernel/drivers/usb/storage/ums-sddr09.ko&apos; from &apos;ums-sddr09.ko&apos;
25313: statat /home/agherzan/work/personal/yocto/2012-08-06-rpi/tmp/work/raspberrypi-poky-linux-gnueabi/rpi-hwup-image-1.0-r0/rootfs/lib/modules/3.1.9/kernel/drivers/usb/storage/ums-sddr09.ko (+buf) (0100644): processing request [ino 16781968]
25313: sending request [ino 16781968]
25313: sending a message: ino 16781968
25313: msg type 3 (stat), external path /home/agherzan/work/personal/yocto/2012-08-06-rpi/tmp/work/raspberrypi-poky-linux-gnueabi/rpi-hwup-image-1.0-r0/rootfs/lib/modules/3.1.9/kernel/drivers/usb/storage/ums-sddr09.ko, mode 0100644
25313: got header, type 4, pathlen 0
25313: got response type 4
25313: (25313) succeed mode 01143570755 uid 0:0
25313: completed: __fxstatat64 (errno: 0)
33188
Before error ./lib/modules/3.1.9/kernel/drivers/usb/storage/ums-sddr09.ko


This is just one file reported with error. There are a lot of them!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23835</commentid>
    <comment_count>8</comment_count>
    <who name="Andrei Gherzan">andrei</who>
    <bug_when>2012-08-06 18:59:15 +0000</bug_when>
    <thetext>In pseudo:
1140670644 device_table                                                                                                                                                                               
Before error ./etc/device_table

Outside pseudo:
100755 device_table</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23899</commentid>
    <comment_count>9</comment_count>
    <who name="Seebs">seebs</who>
    <bug_when>2012-08-08 23:43:14 +0000</bug_when>
    <thetext>Okay, this one&apos;s turning interesting; I got access to a proper 32-bit Linux machine (Fedora 17, although it shouldn&apos;t matter), and I can&apos;t actually get it to fail. Hmm. Of some interest: I note that it seems as though the last three digits are a plausible mode, but the rest is all garbled. Hmm. I&apos;ll keep looking.

Can you trigger this outside the build system so the reproducer is a little smaller? If you could get this to happen on a smaller test case, I could probably look at the files.db and maybe figure something out.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23900</commentid>
    <comment_count>10</comment_count>
    <who name="Seebs">seebs</who>
    <bug_when>2012-08-09 00:13:35 +0000</bug_when>
    <thetext>I should add some explanation of those logs.

The key point:
25313: statat /home/agherzan/work/personal/yocto/2012-08-06-rpi/tmp/work/raspberrypi-poky-linux-gnueabi/rpi-hwup-image-1.0-r0/rootfs/lib/modules/3.1.9/kernel/drivers/usb/storage/ums-sddr09.ko (+buf) (0100644): processing request [ino 16781968]
25313: sending request [ino 16781968]
25313: sending a message: ino 16781968
25313: msg type 3 (stat), external path /home/agherzan/work/personal/yocto/2012-08-06-rpi/tmp/work/raspberrypi-poky-linux-gnueabi/rpi-hwup-image-1.0-r0/rootfs/lib/modules/3.1.9/kernel/drivers/usb/storage/ums-sddr09.ko, mode 0100644
25313: got header, type 4, pathlen 0
25313: got response type 4
25313: (25313) succeed mode 01143570755 uid 0:0
25313: completed: __fxstatat64 (errno: 0)

Which is to say: We got an __fxstatat() request for ums-sddr09.ko, which had an existing mode of 0100644. We sent the request to the server, and the response had a new mode of 01143570755.

Which is, it turns out, probably not correct.

There are two possibilities I can think of:
1. Something in the sequence by which the response gets back from the server is busted.
2. The pseudo database itself is full of really strange bogus values.
2a. Which got in through some other part of this being screwed up.
2b. Because the files are corrupt for some unrelated reason.

I guess the first thing would be to see whether, in a new build directory, you see similar problems. I was pretty sure this couldn&apos;t break existing stuff, and wouldn&apos;t change the bits sent over the wire, but it is possible that I missed something somewhere.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23925</commentid>
    <comment_count>11</comment_count>
    <who name="Seebs">seebs</who>
    <bug_when>2012-08-09 20:32:32 +0000</bug_when>
    <thetext>Well, whaddya know. Ran a whole build on the 32-bit box:

tar: ./var/volatile/cache/ldconfig/aux-cache: Unknown file type; file ignored

I should be able to track this down now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23926</commentid>
    <comment_count>12</comment_count>
    <who name="Seebs">seebs</who>
    <bug_when>2012-08-09 23:33:13 +0000</bug_when>
    <thetext>Okay, found it. There&apos;s a new patch on the PSEUDO_1_4_1 branch (and master) to fix that.

What&apos;s wrong is that I used unwrapped stat() calls, and that can fail inside a chroot. The problem is, in the case where something creates a file under another name, then moves it, and is inside a chroot, we end up creating a link using a statbuf which is stack garbage. The reason it&apos;s hard to reproduce is partially the need to be in a chroot for it to go wrong, and partially that sometimes the garbage didn&apos;t happen to have an invalid mode.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24128</commentid>
    <comment_count>13</comment_count>
    <who name="Andrei Gherzan">andrei</who>
    <bug_when>2012-08-16 22:08:34 +0000</bug_when>
    <thetext>Thanks for the work done in this matter. Now my problem is solved. So please submit a an update to pseudo for this.

Thanks,
ag</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32797</commentid>
    <comment_count>14</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2013-04-30 23:11:26 +0000</bug_when>
    <thetext>can this be closed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32799</commentid>
    <comment_count>15</comment_count>
    <who name="Seebs">seebs</who>
    <bug_when>2013-04-30 23:19:25 +0000</bug_when>
    <thetext>I think so, it&apos;s in 1.4 and 1.5 both.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32815</commentid>
    <comment_count>16</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2013-05-01 15:43:32 +0000</bug_when>
    <thetext>Resolved</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>