• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: _LSCopyInfoForNode Guard Malloc crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: _LSCopyInfoForNode Guard Malloc crash


  • Subject: Re: _LSCopyInfoForNode Guard Malloc crash
  • From: Dave Camp <email@hidden>
  • Date: Sat, 23 Aug 2008 22:41:07 -0700

On Aug 23, 2008, at 6:07 PM, Nick Zitzmann wrote:

I'm trying to write a QuickLook plugin using Xcode, but I kept getting some really weird results - every time the plugin would execute, the QuickLook daemon would log thousands of malloc warnings to the console, completely overwhelming syslogd.

So I debugged it, and some very weird things were going on with the memory (e.g. view bounds were returning -NaN right after they were properly initialized). I tried it again with Guard Malloc turned on, and Guard Malloc would keep crashing in _LSCopyInfoForNode, called whenever qlmanage started up.

That's very interesting. I logged the following bug (radar 6169603) on Friday that I found by accident when writing some code to scan directories...
---
NSFileManager crashes on rtfd files when guard malloc is enabled


The following code crashes on two machines when guard malloc is enabled. The target file does not have to actually be a real rtfd file. It will also crash on a plain folder that is given the rtfd extension. The code appears to work as expected when guard malloc is disabled.

NSError *error = NULL;
NSDictionary *attrs = [[NSFileManager defaultManager] attributesOfItemAtPath:@"/Users/dave/Downloads/Directions from PDX.rtfd" error:&error];
CFShow(attrs);


Backtrace:
#0 0x91447859 in XCFBufInitWithUnicode ()
#1 0x91464ed5 in _LSIsKnownExtensionUnicode ()
#2 0x91464e1b in _LSCanHideExtension ()
#3 0x9144a34b in _LSCanSetExtensionHidden ()
#4 0x9144999a in _LSCopyInfoForNode ()
#5 0x91464d9e in LSCopyItemInfoForRef ()
#6 0x92970b97 in +[NSFileAttributes _attributesAtPath:partialReturn:error:] ()
#7 0x929b1afb in -[NSFileManager attributesOfItemAtPath:error:] ()
#8 0x00001f3d in main (argc=1, argv=0xbffff824) at /Users/dave/Desktop/ CrashTest/CrashTest.m:16


With guard malloc disabled, we don't immediately crash but we do get odd behavior (random crashes later, odd debugger messages).

If you rename the folder from whatever.rtfd to whatever.asdf, the crash remains.

if you completely remove the extension from the folder, the crash goes away.

Initially naming a folder with any other extension does not crash. The crash only happens for folders with the rtfd extension.
---


Is it possible quicklook is scanning some rtfd files around the time your crash happens?

Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: _LSCopyInfoForNode Guard Malloc crash
      • From: Nick Zitzmann <email@hidden>
References: 
 >_LSCopyInfoForNode Guard Malloc crash (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: _LSCopyInfoForNode Guard Malloc crash
  • Next by Date: Strip command
  • Previous by thread: Re: _LSCopyInfoForNode Guard Malloc crash
  • Next by thread: Re: _LSCopyInfoForNode Guard Malloc crash
  • Index(es):
    • Date
    • Thread