Re: Solution: Re: Sudden X/Performer problem

New Message Reply Date view Thread view Subject view Author view

Sharon Clay (src++at++rose.asd.sgi.com)
Tue, 21 Jan 1997 01:22:25 -0800


+>---- On Jan 14, 3:29pm, Christopher R Volpe wrote:
> Subject: Solution: Re: Sudden X/Performer problem
->
->Christopher R Volpe (that's me) wrote:
->>
->So, I decided to ensure that I had enough mallocable space by malloccing
->and freeing some memory prior to initializing the shared arena. I
->mallocced and freed 16MB, under the assumption that this would be enough
->to shift the brk point a little, leaving enough room for whatever pfInit
->needed. But I noticed that the arena base was now placed 128Mb beyond
->the brk point, no longer right at the brk point.
->
->So, maybe just moving the brk point at all causes the bug to disappear
->and allows the shared arena base to be placed where it should, 128MB
->beyond the brk point. I tested this by scrapping the malloc/free of 16MB
->and replaced it with sbrk(1), i.e. move the brk point by one byte. Sure
->enough, this did the trick.
->
->So, if anyone else runs into this problem, before hardcoding virtual
->addresses for the shared arena with pfSharedArenaBase(), try putting a
->sbrk(1) before your pfInit() call.

Yup - if you can edit your program to call API anyway, then this is a better soln.
FYI, I'll go ahead and put the "tricky rld WAR previously requested
at the end of this email.

->
->Now, the question on my mind is: What on earth would tell Irix to
->allocate shared arena right at the brk point, and why does it only do
->this under certain circumstances?

An IRIX bug that is fixed in IRIX 6.4.

->
->-Chris
->
->--
->
->Chris Volpe Phone: (518) 387-7766
->GE Corporate R&D Fax: (518) 387-6560
->PO Box 8 Email: volpecr++at++crd.ge.com
->Schenectady, NY 12301 Web: http://www.crd.ge.com/~volpecr

rld init WAR (thx Don Hatch)

This causes rld to load a DSO with a fix routine in it and upon loading that
DSO call the routine pfInitFix().

Notes:
1) separate compiled versions will be needed for N32 and O32
2) on ficus between different methods of just compiling perfly
        different base addresses are needed and so these addresses
        may not even work for all programs.

======== shell script to run pf program:

#!/bin/csh
#
# runpf shell script to set Performer shared arena base
# to run:
# runpf progname progargs

setenv _RLD_LIST ./pfInitFix.so:DEFAULT
#setenv PFSHAREDBASE 0x5fa80000 # for DSO
setenv PFSHAREDBASE 0x18000000 # for static built
$*

========= pfInitFix.c

/*
 * Compile with:
       cc -g -fullwarn -shared -Wl,-init,pfInitFix pfInitFix.c -o pfInitFix.so
 * Run with:
       setenv PFSHAREDBASE 0xWhatever
       setenv _RLD_LIST ./pfInitFix.so:DEFAULT
 * or
       setenv _RLD_LIST libdmalloc.so:./pfInitFix.so:DEFAULT
 */
#include <stdlib.h>
#include <dlfcn.h>
#include <Performer/pr.h>
pfInitFix()
{
    void *myself = dlopen(NULL, RTLD_LAZY);
    if (dlsym(myself, "pfSharedArenaBase"))
    {
        char *e = getenv("PFSHAREDBASE");
        if (e != NULL)
        {
            void *base = (*e ? (void *)strtoull(e, NULL, 0) : 0);
            pfNotify(PFNFY_INFO, PFNFY_PRINT,
                     "Requesting shared arena base %#0*llx",
                     2+2*sizeof(base),
                     (unsigned long long)base);
            pfSharedArenaBase(base);
        }
    }
    dlclose(myself);
}

-- 
-----{-----{---++at++   -----{----{---++at++   -----{----{---++at++   -----{----{---++at++
Sharon Rose Clay (Fischler) - Silicon Graphics, Advanced Systems Dev.
src++at++sgi.com  (415) 933 - 1002  FAX: (415) 965 - 2658  MS 8U-590
-----{-----{---++at++   -----{----{---++at++   -----{----{---++at++   -----{----{---++at++
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/
            Submissions:  info-performer++at++sgi.com
        Admin. requests:  info-performer-request++at++sgi.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:24 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.