Bug 2689 - apt-native 0.7.14: Method file has died unexpectedly when run (tmpdir length)
Summary: apt-native 0.7.14: Method file has died unexpectedly when run (tmpdir length)
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 1.3
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.3 M4
Assignee: Robert Yang
QA Contact:
URL:
Whiteboard: (P2) (QA Testing Completed)(Done)
Depends on:
Blocks: 2434
  Show dependency tree
 
Reported: 2012-07-04 02:58 UTC by Robert Yang
Modified: 2012-07-19 08:08 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Yang 2012-07-04 02:58:20 UTC
When the length of the tmpdir is longer than 400, there is an error when run "apt-get update":

Method file has died unexpectedly!

This is caused by the following code in apt-pkg/acquire-method.cc:


// AcqMethod::URIStart - Indicate a download is starting                /*{{{*/
// ---------------------------------------------------------------------
/* */
void pkgAcqMethod::URIStart(FetchResult &Res)
{
   if (Queue == 0)
      abort();

   char S[1024] = "";
   char *End = S;

   End += snprintf(S,sizeof(S),"200 URI Start\nURI: %s\n",Queue->Uri.c_str());
   if (Res.Size != 0)
      End += snprintf(End,sizeof(S)-4 - (End - S),"Size: %lu\n",Res.Size);

   if (Res.LastModified != 0)
      End += snprintf(End,sizeof(S)-4 - (End - S),"Last-Modified: %s\n",
                      TimeRFC1123(Res.LastModified).c_str());

   if (Res.ResumePoint != 0)
      End += snprintf(End,sizeof(S)-4 - (End - S),"Resume-Point: %lu\n",
                      Res.ResumePoint);

   strcat(End,"\n");
   if (write(STDOUT_FILENO,S,strlen(S)) != (signed)strlen(S))
      exit(100);
}

The S[1024] is not enough when the tmpdir is very long, assign a bigger value would fix the problem, for example, 2048.
Comment 2 liang li 2012-07-19 08:04:24 UTC
the build dir is "/home/yocto/test_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto/test_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto" ,which length equals 400.
run "bitbake core-image-minimal", no error during build.
Comment 3 liang li 2012-07-19 08:08:47 UTC
test env :
host :Fedora 17 x86_64

git info : eb0cb7e8234f5d2e5623406e9660be91cf52f65e
git branch: poky/master