2012-12-04 38 views
1

我做了一些軟件的valgrind的測試。理想情況下,我希望一次打開20個或更多的valgrind實例。但是,如果我並行運行超過16分的情況下,我開始越來越喜歡消息:是什麼原因導致mkstemp運行許多同時發生的valgrind進程時失敗?

==30533== VG_(mkstemp): failed to create temp file: /tmp/valgrind_proc_30533_cmdline_269e37a6 
==30533== VG_(mkstemp): failed to create temp file: /tmp/valgrind_proc_30533_cmdline_d6b675e7 
==30533== VG_(mkstemp): failed to create temp file: /tmp/valgrind_proc_30533_cmdline_db46c594 
==30533== VG_(mkstemp): failed to create temp file: /tmp/valgrind_proc_30533_cmdline_51cd683d 
==30533== VG_(mkstemp): failed to create temp file: /tmp/valgrind_proc_30533_cmdline_86662832 
==30533== VG_(mkstemp): failed to create temp file: /tmp/valgrind_proc_30533_cmdline_226a8983 
==30533== VG_(mkstemp): failed to create temp file: /tmp/valgrind_proc_30533_cmdline_bb94a700 
==30533== VG_(mkstemp): failed to create temp file: /tmp/valgrind_proc_30533_cmdline_532d4b39 
==30533== VG_(mkstemp): failed to create temp file: /tmp/valgrind_proc_30533_cmdline_de4a957e 
==30533== VG_(mkstemp): failed to create temp file: /tmp/valgrind_proc_30533_cmdline_fcc23adf 
==30533== VG_(mkstemp): failed to create temp file: /tmp/valgrind_proc_30533_cmdline_f41d332c 
valgrind: Startup or configuration error: 
valgrind: Can't create client cmdline file in /pathtomyproject/ 
valgrind: Unable to start up properly. Giving up. 

一些處理(也許他們中的1/3),而不是與錯誤

==30482== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 2 from 2) 
==30482== 
==30482== 1 errors in context 1 of 1: 
==30482== Jump to the invalid address stated on the next line 
==30482== at 0x4C6: ??? 
==30482== by 0x4005D2E: open_verify (dl-load.c:1914) 
==30482== by 0x4006362: open_path (dl-load.c:2175) 
==30482== by 0x4008799: _dl_map_object (dl-load.c:2407) 
==30482== by 0x400CFE1: openaux (dl-deps.c:65) 
==30482== by 0x400F175: _dl_catch_error (dl-error.c:178) 
==30482== by 0x400D6BD: _dl_map_object_deps (dl-deps.c:258) 
==30482== by 0x400350C: dl_main (rtld.c:1826) 
==30482== by 0x4015B23: _dl_sysdep_start (dl-sysdep.c:244) 
==30482== by 0x4005364: _dl_start (rtld.c:338) 
==30482== by 0x40016B7: ??? (in /lib/x86_64-linux-gnu/ld-2.15.so) 
==30482== by 0x4: ??? 
==30482== by 0x7FF0007C6: ??? 
==30482== by 0x7FF0007DD: ??? 
==30482== by 0x7FF0007E2: ??? 
==30482== by 0x7FF0007E9: ??? 
==30482== by 0x7FF0007EE: ??? 
==30482== Address 0x4c6 is not stack'd, malloc'd or (recently) free'd 

而終止運行這些電話,沒有文件在/ tmp中創建的,但我使用的用戶帳戶也有讀,寫和/ tmp目錄執行權限。

我不能在網上找到有關此錯誤的任何信息,但或許這裏的某個地方有所瞭解呢?

編輯:一些進一步的實驗表明,事實上,不超過5點的過程可以一起同時運行。

+0

什麼是內存的情況?我的猜測是,在16個打開的實例後,你的可用內存不足。將免費的輸出添加到您的帖子中。 – Gille

+0

這是一個很大的系統:24GB的RAM,即使一次處理20個進程,使用率也很少超過5%。 –

回答

2

這個錯誤來自這裏:

// coregrind/m_libcfile.c 

/* Create and open (-rw------) a tmp file name incorporating said arg. 
    Returns -1 on failure, else the fd of the file. If fullname is 
    non-NULL, the file's name is written into it. The number of bytes 
    written is guaranteed not to exceed 64+strlen(part_of_name). */ 

Int VG_(mkstemp) (HChar* part_of_name, /*OUT*/HChar* fullname) 
{ 
    HChar buf[200]; 
    Int n, tries, fd; 
    UInt seed; 
    SysRes sres; 
    const HChar *tmpdir; 

    vg_assert(part_of_name); 
    n = VG_(strlen)(part_of_name); 
    vg_assert(n > 0 && n < 100); 

    seed = (VG_(getpid)() << 9)^VG_(getppid)(); 

    /* Determine sensible location for temporary files */ 
    tmpdir = VG_(tmpdir)(); 

    tries = 0; 
    while (True) { 
     if (tries++ > 10) 
     return -1; 
     VG_(sprintf)(buf, "%s/valgrind_%s_%08x", 
        tmpdir, part_of_name, VG_(random)(&seed)); 
     if (0) 
     VG_(printf)("VG_(mkstemp): trying: %s\n", buf); 

     sres = VG_(open)(buf, 
         VKI_O_CREAT|VKI_O_RDWR|VKI_O_EXCL|VKI_O_TRUNC, 
         VKI_S_IRUSR|VKI_S_IWUSR); 
     if (sr_isError(sres)) { 
     VG_(umsg)("VG_(mkstemp): failed to create temp file: %s\n", buf); 
     continue; 
     } 
     /* VG_(safe_fd) doesn't return if it fails. */ 
     fd = VG_(safe_fd)(sr_Res(sres)); 
     if (fullname) 
     VG_(strcpy)(fullname, buf); 
     return fd; 
    } 
    /* NOTREACHED */ 
} 

正如你所看到的,該代碼會是否有共享相同pidppid十幾道工序失敗。目前尚不清楚你是如何創建20個valgrind進程的 - 他們通常應該是而不是分享pid

您可能能夠通過任一

  • 來解決此問題創建Valgrind的情況下,使得它們不共享相同pid,或
  • 設置TMPDIR到不同的目錄爲每個Valgrind的的實例。
+0

謝謝!不知道這是怎麼回事,但至少知道它爲什麼好! –

相關問題