|
|
Home » Developing U++ » Mac OS » Fatal Upp Core memory management (heap/malloc) interventions in AppKit/Cocoa?
Re: Fatal Upp Core memory management (heap/malloc) interventions in AppKit/Cocoa? [message #32914 is a reply to message #30702] |
Mon, 20 June 2011 00:50   |
 |
daveremba
Messages: 32 Registered: June 2011 Location: Los Angeles, CA, USA
|
Member |
|
|
I encountered a similar problem.
Not a crash, but a leak detected in UPP/heapdbg.cpp
I get "Heap leaks detected!" on exit.
Here is what I found:
a stack trace showed a MacOSX carbon function
from Xft... calling
UPP Core/operator new()!
maybe the order of constructors in UPP
is calling Xft before it is initialized?
Here is a temp fix: in Draw/Font.cpp:
(telling UPP heap debugger to ignore this leak)
const CommonFontInfo& Font::Fi() const
{
// add:
MemoryIgnoreLeaksBlock __;
if(lastStdFont != AStdFont.AsInt64()) {
lastFiFont = INT_MIN;
lastStdFont = AStdFont.AsInt64();
}
if(AsInt64() == lastFiFont)
return lastFontInfo;
// known leak on MacOSX here: getAllCarbonLazyValues2000 calls Core.h op new()
// should not call UPP op new()
// from GetFontInfo() ... XftFontOpenPattern() ... getAllCarbonLazyValues2000() -> new()
lastFontInfo = GetFontInfo(*this);
lastFiFont = AsInt64();
return lastFontInfo;
}
A stack trace from gdb is attached to this message.
(stack frames 0-5 are from a temp gets() to force a halt
while gdb is attached to the process)
I haven't tried debugging UPP in UPP yet!
I think the better fix is to include some Xft header
in Font.cpp after Core.h ?
Core/Core.h:201:inline void *operator new(size_t size) throw(std::bad_alloc) { void *ptr = UPP::MemoryAlloc(size); return ptr; }
Dave
[Updated on: Mon, 20 June 2011 01:00] Report message to a moderator
|
|
|
 |
|
Fatal Upp Core memory management (heap/malloc) interventions in AppKit/Cocoa?
By: fudadmin on Sun, 16 January 2011 20:53
|
 |
|
Re: Fatal Upp Core memory management (heap/malloc) interventions in AppKit/Cocoa?
By: mirek on Sun, 16 January 2011 23:33
|
 |
|
Re: Fatal Upp Core memory management (heap/malloc) interventions in AppKit/Cocoa?
By: fudadmin on Mon, 17 January 2011 00:53
|
 |
|
Re: Fatal Upp Core memory management (heap/malloc) interventions in AppKit/Cocoa?
By: fudadmin on Mon, 17 January 2011 02:52
|
 |
|
Re: Fatal Upp Core memory management (heap/malloc) interventions in AppKit/Cocoa?
By: fudadmin on Mon, 17 January 2011 04:05
|
 |
|
Re: Fatal Upp Core memory management (heap/malloc) interventions in AppKit/Cocoa?
By: mirek on Mon, 17 January 2011 10:32
|
 |
|
Re: Fatal Upp Core memory management (heap/malloc) interventions in AppKit/Cocoa?
By: fudadmin on Mon, 17 January 2011 16:27
|
 |
|
Re: Fatal Upp Core memory management (heap/malloc) interventions in AppKit/Cocoa?
By: mirek on Mon, 17 January 2011 16:57
|
 |
|
Re: Fatal Upp Core memory management (heap/malloc) interventions in AppKit/Cocoa?
By: fudadmin on Mon, 17 January 2011 17:16
|
 |
|
Re: Fatal Upp Core memory management (heap/malloc) interventions in AppKit/Cocoa?
|
 |
|
Re: Fatal Upp Core memory management (heap/malloc) interventions in AppKit/Cocoa?
By: mirek on Mon, 20 June 2011 05:58
|
Goto Forum:
Current Time: Wed Apr 30 19:14:57 CEST 2025
Total time taken to generate the page: 0.01004 seconds
|
|
|