On Tue, Jan 27, 2009 at 02:04:54PM -0800, James Litchfield wrote:
> As was pointed out before, it doesn't call waitpid().

then the interposition would have to happen somewhere else.

> The parent creates the file, forks off cpp and then immediately deletes the
> file.
> The only way I could see this working would on a single CPU system where the
> timing might work out that the child had opened the target before the
> parent zapped it.
>

perhaps having an LD_PRELOAD library that does do a waitpid(), or just
delays, after the fork() in the parent would solve the problem.  (there
by providing the child time to run.)

ed

>> 1699:    open("/tmp/idli_HJayud.cc", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
>> <file write elided>
>> 1699:    close(4)                    = 0
>> 1699:    llseek(3, 0, SEEK_CUR)                = 6244
>> 1699:    close(3)                    = 0
>> 1699:    lwp_suspend(2)                    = 0 [144]
>> 1699:    sigprocmask(SIG_SETMASK, 0xFF387C18, 0xFFBEF3E8) = 0
>> 1699:    sigtimedwait(0xFEE7BE50, 0x00000000, 0x00000000) Err#4 EINTR
>> 1699:    fork()                        = 1702
>> 1702:    fork()        (returning as child ...)    = 1699
>> 1702:    getpid()                    = 1702 [1699]
>> 1699:    sigprocmask(SIG_SETMASK, 0xFFBEF3E8, 0x00000000) = 0
>> 1699:    lwp_schedctl(SC_STATE|SC_PREEMPT, 0, 0xFFBEF2BC) = 0
>> 1702:    sigprocmask(SIG_SETMASK, 0xFFBEF3E8, 0x00000000) = 0
>> 1699:    lwp_continue(2)                    = 0
>> 1702:    lwp_schedctl(SC_STATE|SC_PREEMPT, 0, 0xFFBEF2BC) = 0
>> 1702:    lwp_continue(2)                    = 0
>> 1699:    lwp_schedctl(SC_STATE|SC_PREEMPT, 0, 0xFEE7BD64) = 0
>> 1699:    unlink("/tmp/idli_HJayud.cc")            = 0
> Jim
> ---
> Edward Pilatowicz wrote:
>> On Tue, Jan 27, 2009 at 05:19:07AM -0800, Osmar wrote:
>>
>>> Hi
>>>
>>> thanks for the responses
>>>
>>> Unfortunately the settings of the variables LIBTHREAD doesn't resolve the 
>>> problem.
>>> It is the only possibility to have the behavior of the old Solaris 8 
>>> libthread on the branded zone? No way to have the old libthread behavior on 
>>> a branded zones?
>>>
>>>
>>
>> nope.
>>
>> s8 and earlier all use the "old" libthread.  s9 and later all use the
>> "new" libthread.  s8 shipped with the "new" libthread as an alternate
>> threading library in /usr/lib/lwp.  the s8 brand only supports the "new"
>> libthread.
>>
>>
>>> unluckily I can't upgrade the version of the idl application to one newer, 
>>> this is one of the reason for the migration of the system in a branded 
>>> zones.
>>>
>>>
>>
>> this seems to be a problem with the idl code in how it forks and waits
>> for child processes, perhaps in how it deals with SIGCHLD.  if you have
>> access to the idl source, perhaps you could fix it.
>>
>> optionally, you could try trussing it's libc calls to see where it calls
>> fork and/or waitpid.  Then perhaps you could create an interposition
>> library which would delay the process or fudge up return values in some
>> way to avoid the race.
>>
>> ed
>> _______________________________________________
>> brandz-discuss mailing list
>> brandz-discuss at opensolaris.org
>>
>>
>>

Reply via email to