2011-08-06 92 views
1

我的應用程序突然中斷,甚至沒有顯示管理堆棧跟蹤。它在控制檯中顯示以下消息:錯誤,如何調試?

mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xac5ac2c0) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 
mono(6417,0xb0307000) malloc: *** mmap(size=16777216) failed (error code=12) 
*** error: can't allocate region 
*** set a breakpoint in malloc_error_break to debug 

Native stacktrace: 

    0 mono        0x000b6ea9 mono + 745129 
    1 mono        0x00006e23 mono + 24099 
    2 libsystem_c.dylib     0x9487c59b _sigtramp + 43 
    3 ???         0xffffffff 0x0 + 4294967295 
    4 libclh.dylib      0x9776bbbb libclh.dylib + 191419 
    5 libclh.dylib      0x97773564 libclh.dylib + 222564 
    6 libclh.dylib      0x977b0456 clhFenceCreate + 38 
    7 GeForceGLDriver      0x8f0dca23 glrCompExecuteKernel + 5034 
    8 OpenCL        0x9a691ff1 processExec + 506 
    9 OpenCL        0x9a696ec6 processWork + 214 
    10 libdispatch.dylib     0x9282f80b _dispatch_queue_drain + 224 
    11 libdispatch.dylib     0x9282f6b0 _dispatch_queue_invoke + 47 
    12 libdispatch.dylib     0x9282eeb8 _dispatch_worker_thread2 + 187 
    13 libsystem_c.dylib     0x94826b24 _pthread_wqthread + 346 
    14 libsystem_c.dylib     0x948286fe start_wqthread + 30 

Debug info from gdb: 

/tmp/mono-gdb-commands.DNbmkH:1: Error in sourced command file: 
unable to debug self 

================================================================= 
Got a SIGSEGV while executing native code. This usually indicates 
a fatal error in the mono runtime or one of the native libraries 
used by your application. 
================================================================= 

看來問題在於OpenCL驅動程序。我如何追蹤和解決問題?

回答

0

有與互操作的內存泄漏問題,它造成suckout所有可用內存,當超出2GB墜毀去......所以謝謝大家,我的錯......

0

它看起來更像是在OpenCL中發生的(注意'C',這不是OpenGL,但與它有關係)。可能發生的情況是,你的程序試圖將一些GPU內存映射到它的地址空間,但是這會失敗,因爲沒有剩下的地址空間,這足夠大並且具有正確的對齊。而在低級代碼中,由mmap返回的指針不會被檢查,這會導致段錯誤。

這顯然是Mono或OpenCL/OpenGL驅動程序的錯誤,或者是它的綁定。將上面的跟蹤發送給任一開發人員,提出一個錯誤問題。

+0

這很有趣,因爲該程序工作約10分鐘,然後崩潰。所有的內存分配都是在初始化過程中完成的,並且在處理過程中沒有內存分配,在計算過程中沒有分配GPU內存,真的很奇怪...... – Lu4

+0

@ Lu4:是什麼讓你覺得沒有內存分配? Mono/.net是垃圾收集系統。內存一直在後臺分配和丟棄。只要在Mono中發生這種情況,內存管理就可以處理髮生的地址空間碎片(垃圾收集器不時重新安排內存佈局)。然而,引入一些需要乾淨的地址空間,OpenGL,Op​​enCL等的系統,各種奇怪的交互即將發生。 – datenwolf

+0

我已經在Windows上運行程序同樣的問題,但它給了我堆棧跟蹤,clEnqueueAcquireGLObjects的問題。這也很奇怪,因爲我稍後調用了適當的clEnqueueReleaseGLObjects,我開始新的線程 – Lu4

0

它SA重要的CALayer上下文中的大量內存分配,每次更改視圖時都需要釋放該層。它發生在我身上,我就是這樣解決它的,每次你改變頁面繪製特定的上下文時,你都需要釋放內存。