Remi Arnaud (remi++at++remi.asd.sgi.com)
Thu, 10 Oct 1996 16:24:38 -0700
It maybe a typo, but here you declare G_cbuf,
> G_cbuf = new(pfGetSharedArena()) pfCycleBuffer(sizeof(myDataStruct));
And here, you use G_cycle_buffer ?
> myDataStruct *curr_data = (myDataStruct *)
G_cycle_buffer->getCurData();
>
> // initialize curr_data here
>
> G_cbuf->init(G_cycle_buffer->getData());
>
>
> In APP, during main sim loop, just before pfFrame:
>
> curr_data = (myDataStruct *) G_cycle_buffer->getCurData();
> // update data here
> G_cycle_buffer->changed();
>
>
> In DRAW callback:
>
> myDataStruct *draw_data (myDataStruct *) G_cycle_buffer->getCurData();
> // do something with the data here
You cannot acces to G_cbuf from here, as the Draw process is forked BEFORE the
Cycle buffer is declared. So the G_cbuf is not initialized for DRAW.
>
> When I run this, I get the following message and a core dump (bus error):
>
> PF Notice: Caught SIGCHLD. Exiting due to death of child with pid 4103.
>
> And dbx reports the following:
>
> PC value from core file (0x40d7f0) is not part of the program.
> Assuming return register value (0x40d7f0) usable to locate PC.
> Core from signal SIGBUS: Bus error
> (dbx) where
> > 0 drawChannel(pfChannel*,void*)(0x1807b0d0, 0x0, 0x0, 0x3f800000)
["pfchannels.C":229, 0x40d7f0]
> 1 pfChannel::pf_callDrawFunc(void)(0x181a62e0, 0x0, 0x0, 0x3f800000)
["../../../lib/libpf/pfChannel.C":1996, 0x5b33e04c]
> 2 doDraw(pfChannel*,pfPipe*,int*)(0x181a62e0, 0x1807fdf0, 0x7fff28d4,
0x3f800000) ["../../../lib/libpf/pfProcess.C":4493, 0x5b379018]
> 3 mpDraw(void)(0x0, 0x0, 0x0, 0x3f800000)
["../../../lib/libpf/pfProcess.C":4924, 0x5b37a16c]
> 4 pfConfig(0x0, 0x1807ad00, 0x0, 0x3f800000)
["../../../lib/libpf/pfProcess.C":1765, 0x5b37264c]
> 5 ::initializePerformer(void)(0x0, 0x0, 0x0, 0x3f800000)
["pfchannels.C":99, 0x40cecc]
> 6 main(0x7fff2e98, 0x7fff2f04, 0x0, 0x3f800000) ["main.C":87, 0x409ae0]
> 7 __istart() ["crt1tinit.s":13, 0x409740]
>
>
> Line 229 in drawChannel() is the first line in the DRAW callback snippet
above.
Yes, And I bet G_cycle_buffer is NULL
> Also note: I have a 2 processor IR, I am using PFMP_APPCULL_DRAW,
> and G_cbuf->getConfig() returns 4. (????)
This is ok.
>
>
> As always, any help is greatly appreciated,
> scott
To solve this problem, allocate a pointer to a pfCyclebuffer in shared memory,
before pfConfig. All processes will have a pointeur to a (pfCycleBuffer*) in
shared memory.
-- Remi
--
o o Remi ARNAUD - Silicon Graphics, Performer, Advanced Systems Dev o o o o Mail Stop 590 - 2011 N. Shoreline Boulevard, Mountain View, CA94043 o o o o Email: remi++at++asd.sgi.com - Tel: (415) 933 6208 - Fax: (415) 965 2658 o o
======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:53:45 PDT