Bug 2689

Summary: apt-native 0.7.14: Method file has died unexpectedly when run (tmpdir length)
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Robert Yang <liezhi.yang>
Component: devtools / tool chainAssignee: Robert Yang <liezhi.yang>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: jessica.zhang, liang.li2, meta.mr.watcher, meta.watcher, sgw, song.liu, zhenfeng.zhao
Version: 1.3   
Target Milestone: 1.3 M4   
Hardware: x86   
OS: Multiple   
Whiteboard: (P2) (QA Testing Completed)(Done)
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Bug Depends on:    
Bug Blocks: 2434    

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