openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Openexr-devel] Re: Mac stuff


From: Paul Schneider
Subject: [Openexr-devel] Re: Mac stuff
Date: Wed, 9 Apr 2003 15:25:59 -0700

Here's some recent posts on this topic:

"Help.  Can't find how to increase stack limit"
<http://www.google.com/groups?hl=en&lr=&ie=UTF- 8&safe=off&th=fa6dee68462ab47e&rnum=1>

"Big Array in MachO causes Segmentation Fault"
<http://www.google.com/groups?hl=en&lr=&ie=UTF- 8&safe=off&th=9e72a986de75f4f3&seekm=3E790547.2C4FDF59%40idiom.com&fram e=off>

Yes, from these it looks like the stack size is always fixed on OS X. One posting even touts it as a feature that helps you detect infinite recursion, which is sort of amusing. It's good to know I'm correct about that, at any rate.


Yeah, I'm probably wrong about that.  I do know that the heap size
settings only apply to OS 9.  On OS X, the stack size is obviously much
larger than the setting in the panel, but there's probably some other
limit.

Yes, I believe I set the heap size for the confidence tests to 80 MB, which is somewhat arbitrary. As you say, the heap size settings aren't needed for an OS X native application.

It could very well be that OS X's loader ignores the stack value in the 'cfrg' resource (which is what OS 9 uses) and just sets the stack size to the default value of 512 KB, making you call setrlimit when your app starts up. It would be pretty easy to write a test program to see how much stack space you really get by default in a CFM app on OS X.


I have also had problems with a plugin I wrote for Final Cut Pro, though that was a case where I was writing a plugin and was limited by what they chose.

Yep, that's how I first ran across this problem in the Piz compressor. Unfortunately, using EXR in a plug-in will probably be the most common use on the Mac, so we'll have to keep our stack usage below the default in the Mac builds. I suppose that at some point, we might be tempted to break OS 9 compatibility by choosing a stack requirement above 64 KB but below 512 KB. Actually, I believe that until Pro 7 CodeWarrior had a hard-coded 32 KB stack, so that would be the practical OS 9 limit as most classic host applications are likely to have been built with an older version of CodeWarrior. I vote for putting everything big in the heap :)

By the way, in case anyone is interested, there's another potential issue with the CFM build of IlmImfTest. IlmImfTest creates temporary files called "/var/tmp/test_comp.exr" which are placed in /var/tmp in the mach-o builds. Of course, CFM MSL doesn't deal with Posix paths and so creates a file in the directory you're running IlmImfTest from that is actually named "/var/tmp/test_comp.exr". This would probably fail on OS X if your drive isn't HFS (I don't think filenames containing slashes are legal on UFS), and it could fail in the future on machines running OS's earlier than OS 9 if the file name becomes longer than 31 characters. Just a warning to the "unofficial" OS 9 developers out there. Note that both of these issues are with the confidence app that tests the IlmImf module, and not with the core exr library itself.

- Paul





reply via email to

[Prev in Thread] Current Thread [Next in Thread]