You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Scott Cantor <ca...@osu.edu> on 2008/02/07 17:55:32 UTC
Xerces crashes after fork on OS X 10.5?
There appears to be a problem in Xerces when used inside of software that
forks, Apache being one such. Xerces is using CoreFoundation calls, and
those can't be used with fork by itself.
On 10.5, you get this error:
"The process has forked and you cannot use this CoreFoundation
functionality safely. You MUST exec(). Break on
__THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALIT
Y___YOU_MUST_EXEC__() to debug."
Now, Apache's not changing. So I don't see any choice but to find these
calls and replace them in the OS X port. Either that or I guess my code
won't run under Apache until I change parsers anyway.
Do any Mac maintainers know anything about the feasibility or extent of the
changes?
-- Scott
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
Re: Xerces crashes after fork on OS X 10.5?
Posted by James Berry <jb...@apache.org>.
On Feb 7, 2008, at 1:04 PM, Scott Cantor wrote:
>> Xerces 3.0 uses posix file routines, so
>> that shouldn't be a problem. I'd definitely configure in one of the
>> generic unix transcoders.
>
> I'm looking into it. My fear is that a big new dependency will be
> required,
> although at least using Macports I can probably handle that for my
> users. Is
> anything provided with OS X that works (if you know offhand)?
Mac OS X has both iconv and icu built-in, going back a couple of major
versions at least.
James
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
RE: Xerces crashes after fork on OS X 10.5?
Posted by Scott Cantor <ca...@osu.edu>.
> As John says, you should be able to swap out some of the Mac OS X
> tuned versions of things for more generic versions. I might suggest
> the curl netaccessor (if you're using Xerces 3.0) instead of socket,
> but either should be okay.
This isn't 3.0, it's 2.8.0 (sorry, should have said so).
If the socket accessor is necessary to solve this for me and I can't make
that work because of whatever I ran into years ago, I have a backport of the
curl version for 2.8, but I'd have to swap that into my code and put out a
new release, so it's not ideal.
> Xerces 3.0 uses posix file routines, so
> that shouldn't be a problem. I'd definitely configure in one of the
> generic unix transcoders.
I'm looking into it. My fear is that a big new dependency will be required,
although at least using Macports I can probably handle that for my users. Is
anything provided with OS X that works (if you know offhand)?
Thanks again,
-- Scott
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
Re: Xerces crashes after fork on OS X 10.5?
Posted by James Berry <jb...@apache.org>.
Scott, (huh, thought I sent this early this morning but I guess I got
distracted and didn't finish ;)
As John says, you should be able to swap out some of the Mac OS X
tuned versions of things for more generic versions. I might suggest
the curl netaccessor (if you're using Xerces 3.0) instead of socket,
but either should be okay. Xerces 3.0 uses posix file routines, so
that shouldn't be a problem. I'd definitely configure in one of the
generic unix transcoders. In any event, with Xerces 3.0 you should be
able to configure yourself back to quite a posix-standard view of the
world, which should eliminate the problem.
Note, however, that fork(2) according to the man page places many
explicit caveats on things that may be unsafe following fork.
James
On Feb 7, 2008, at 9:06 AM, John Snelson wrote:
> Hi Scott,
>
> I think you've compiled Xerces-C using the Mac OS X native net
> accessor. You should be able to configure it to run using the socket
> net accessor instead, which means Xerces-C won't be using
> CoreFoundation calls.
>
> John
>
> Scott Cantor wrote:
>> There appears to be a problem in Xerces when used inside of
>> software that
>> forks, Apache being one such. Xerces is using CoreFoundation calls,
>> and
>> those can't be used with fork by itself.
>> On 10.5, you get this error:
>> "The process has forked and you cannot use this CoreFoundation
>> functionality safely. You MUST exec(). Break on
>> __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALIT
>> Y___YOU_MUST_EXEC__() to debug."
>> Now, Apache's not changing. So I don't see any choice but to find
>> these
>> calls and replace them in the OS X port. Either that or I guess my
>> code
>> won't run under Apache until I change parsers anyway.
>> Do any Mac maintainers know anything about the feasibility or
>> extent of the
>> changes?
>> -- Scott
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
>> For additional commands, e-mail: c-dev-help@xerces.apache.org
>
>
> --
> John Snelson, Oracle Corporation http://snelson.org.uk/john
> Berkeley DB XML: http://www.oracle.com/database/berkeley-db/xml
> XQilla: http://xqilla.sourceforge.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: c-dev-help@xerces.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
RE: Xerces crashes after fork on OS X 10.5?
Posted by Scott Cantor <ca...@osu.edu>.
> I think you've compiled Xerces-C using the Mac OS X native net accessor.
> You should be able to configure it to run using the socket net accessor
> instead, which means Xerces-C won't be using CoreFoundation calls.
Ah, ok, I'll look into that, thank you. Unfortunately the reason I had
people do that is that the socket accessor didn't actually work, at least a
couple of Xerces versions ago. I don't think it matters though, I can work
around that now.
However, the crash seems to be during init and related to the transcoder.
Might also be possible to bypass by using a different transcoder though.
-- Scott
Thread 0 Crashed:
0 com.apple.CoreFoundation 0x961479c1 __CFRunLoopFindMode + 353
1 com.apple.CoreFoundation 0x961496ec CFRunLoopAddSource + 124
2 com.apple.DiskArbitration 0x9308ada4
DAApprovalSessionScheduleWithRunLoop + 61
3 ...ple.CoreServices.CarbonCore 0x9621b846
_FSGetDiskArbSession(__DASession**, __DAApprovalSession**) + 646
4 ...ple.CoreServices.CarbonCore 0x9621b58e
CreateDiskArbDiskForMountPath(char const*) + 94
5 ...ple.CoreServices.CarbonCore 0x9621a3d2
FSCacheableClient_GetVolumeCachedInfo(char const*, statfs const*,
CachedVolumeInfo*, __DADisk*, __DADisk**) + 364
6 ...ple.CoreServices.CarbonCore 0x96219d11 MountVolume(char const*,
statfs*, unsigned char, unsigned char, __DADisk*, short*) + 537
7 ...ple.CoreServices.CarbonCore 0x96219a0a MountInitialVolumes() +
258
8 ...ple.CoreServices.CarbonCore 0x96219609 INIT_FileManager() + 219
9 ...ple.CoreServices.CarbonCore 0x962194b6
GetRetainedVolFSVCBByVolumeID(unsigned long) + 36
10 ...ple.CoreServices.CarbonCore 0x96217c96 PathGetObjectInfo(char
const*, unsigned long, unsigned long, VolumeInfo**, unsigned long*, unsigned
long*, char*, unsigned long*, unsigned char*) + 202
11 ...ple.CoreServices.CarbonCore 0x96217b66
FSPathMakeRefInternal(unsigned char const*, unsigned long, unsigned long,
FSRef*, unsigned char*) + 90
12 ...ple.CoreServices.CarbonCore 0x962236bb FSPathMakeRef + 47
13 ...ple.CoreServices.CarbonCore 0x96236e2b
FilterRelevantFilesFromDirectory + 347
14 ...ple.CoreServices.CarbonCore 0x96236679 CacheFMMapData + 1565
15 ...ple.CoreServices.CarbonCore 0x96235395 IntlFCOpenComponentData +
206
16 ...ple.CoreServices.CarbonCore 0x96237be9 InitScriptBundleComponent
+ 85
17 ...ple.CoreServices.CarbonCore 0x96237b8d SMInitIntlSpec + 17
18 ...ple.CoreServices.CarbonCore 0x962377a2 LMGetIntlSpec + 76
19 ...ple.CoreServices.CarbonCore 0x96238b2c GetScriptManagerVariable
+ 28
20 ...ple.CoreServices.CarbonCore 0x962410cd
LocaleRefOrNULLToTagEntryPtr + 74
21 ...ple.CoreServices.CarbonCore 0x96240f2e LocaleRefGetPartString +
57
22 ...ple.CoreServices.CarbonCore 0x962401c5 SetDefaultLocaleString +
195
23 ...ple.CoreServices.CarbonCore 0x962400e0 _ReloadUnicodeUtilData +
92
24 ...ple.CoreServices.CarbonCore 0x9623ff16 UCRefreshThreadGlobals +
183
25 ...ple.CoreServices.CarbonCore 0x9626fe3f UCCreateCollator + 133
26 libxerces-c.28.dylib 0x0059b1cf
xercesc_2_8::MacOSUnicodeConverter::MacOSUnicodeConverter() + 79
27 libxerces-c.28.dylib 0x00598d7a
xercesc_2_8::XMLPlatformUtils::makeTransService() + 64
28 libxerces-c.28.dylib 0x005ab68d
xercesc_2_8::XMLPlatformUtils::Initialize(char const*, char const*,
xercesc_2_8::PanicHandler*, xercesc_2_8::MemoryManager*, bool) + 347
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
Re: Xerces crashes after fork on OS X 10.5?
Posted by John Snelson <jo...@oracle.com>.
Hi Scott,
I think you've compiled Xerces-C using the Mac OS X native net accessor.
You should be able to configure it to run using the socket net accessor
instead, which means Xerces-C won't be using CoreFoundation calls.
John
Scott Cantor wrote:
> There appears to be a problem in Xerces when used inside of software that
> forks, Apache being one such. Xerces is using CoreFoundation calls, and
> those can't be used with fork by itself.
>
> On 10.5, you get this error:
>
> "The process has forked and you cannot use this CoreFoundation
> functionality safely. You MUST exec(). Break on
> __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALIT
> Y___YOU_MUST_EXEC__() to debug."
>
> Now, Apache's not changing. So I don't see any choice but to find these
> calls and replace them in the OS X port. Either that or I guess my code
> won't run under Apache until I change parsers anyway.
>
> Do any Mac maintainers know anything about the feasibility or extent of the
> changes?
>
> -- Scott
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: c-dev-help@xerces.apache.org
>
--
John Snelson, Oracle Corporation http://snelson.org.uk/john
Berkeley DB XML: http://www.oracle.com/database/berkeley-db/xml
XQilla: http://xqilla.sourceforge.net
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org