AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20080417181854.4d988327@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:onstor-exch02.onstor.net
NSV:
SSH:
R:<chris.vandever@onstor.com>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/andys@onstor.net@onstor-exch02.onstor.net/INBOX	0	BB375AF679D4A34E9CA8DFA650E2B04E03E9A7CC@onstor-exch02.onstor.net
X-Sylpheed-End-Special-Headers: 1
Date: Thu, 17 Apr 2008 18:19:03 -0700
From: Andrew Sharp <andy.sharp@onstor.com>
To: "Chris Vandever" <chris.vandever@onstor.com>
Subject: Re: what am i not doing?
Message-ID: <20080417181903.2a701995@ripper.onstor.net>
In-Reply-To: <BB375AF679D4A34E9CA8DFA650E2B04E03E9A7CC@onstor-exch02.onstor.net>
References: <20080417162951.4242dba7@ripper.onstor.net>
	<BB375AF679D4A34E9CA8DFA650E2B04E03E9A7CC@onstor-exch02.onstor.net>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

No, that was all the pointer I needed.  Stupid rmc.

Thanks mucho,

a


On Thu, 17 Apr 2008 16:50:22 -0700 "Chris Vandever"
<chris.vandever@onstor.com> wrote:

> I'll take a closer look later, but your app may need to call
> rmc_init_ex().  See the test app in code/ssc-cluster/cluster-test.c
> for an example.
> 
> ChrisV
> 
> -----Original Message-----
> From: Andy Sharp 
> Sent: Thursday, April 17, 2008 4:30 PM
> To: Chris Vandever
> Subject: what am i not doing?
> 
> Hi Chris,
> 
> I need to enlist your help.
> 
> So, I added this routine cluster_getVsMgmtId() to cluster_vsvr_api.c,
> and it's supposed to return the mgmt vsvr id, but instead it segfaults
> in some rmc routine.  It seems innocent enough to me, but what do I
> know.
> 
> Here is the stack trace:
> 
> (gdb) bt
> #0  0x2b278cd0 in rmc_context_add_sess (cb=0x2b2c3890, sess=0x515da8)
>     at rmc_api.c:248
> #1  0x2b27a254 in rmc_open_shared (sess=0x515da8, my_name=0x0,
> relay=0x0, 
>     dest_addr=0x7fd663dc, max_pending=256, msg=0x7fd66248, mode=16)
>     at rmc_api.c:846
> #2  0x2b279b64 in rmc_open_ex (sess=0x515da8, my_name=0x0, 
>     dest_addr=0x7fd663dc, max_pending=256, msg=0x7fd66248, mode=16)
>     at rmc_api.c:700
> #3  0x2b05c6ac in cluster_rmc_open (sess=0x515da8,
> dest_addr=0x7fd663dc,
> 
>     max_pending=256, mode=16) at cluster-rmc.c:1100
> #4  0x2b05b01c in cluster_lookup_sess (app=0x2b0a2374 "clusterrpc")
>     at cluster-rmc.c:641
> #5  0x2b05b2b4 in cluster_clientSendRmcRpc (buf=0x5164e8, bufLen=44, 
>     rspBuf=0x2b103b28, rspLen=0x7fd664c0, app=0x2b0a2374 "clusterrpc")
>     at cluster-rmc.c:711
> #6  0x2b039360 in cluster_getRecordIdByKey
> (recType=CLUSDB_REC_TYPE_FILER, 
>     recId=0x7fd6666c, keyLen=7, keyVal=0x7fd664f4 "coolcat")
>     at cluster-api.c:852
> #7  0x2b04a23c in cluster_getLocalFilerRecId (recId=0x7fd6666c)
>     at cluster-filer-api.c:200
> #8  0x2b04a2d8 in cluster_getFilerRecId (filerName=0x0, 
>     fUseLocalhost=1 '\001', recId=0x7fd6666c) at
> cluster-filer-api.c:240 #9  0x2b07eda4 in cluster_getFilerMgmtVsvr
> (filerName=0x0, cfgp=0x7fd666b8,
>     buffSize=2168) at cluster-vsvr-api.c:5855
> #10 0x2b07f0a4 in cluster_getVsMgmtId () at cluster-vsvr-api.c:5979
> #11 0x0042586c in dns_basic_lookup ()
> 
> 
> I don't even know if that buffSize=2168 is reasonable.
> 
> Is there some kind of setup routine I need to call first?  nfxsh works
> fine and commands like "vsvr show VS_MGMT_1884" work fine, sit seems
> like things are OK on the filer, it's just my code that is sucking.
> 
> Here is the change I made to cluster-vsvr-api.c, which can be found in
> ~andys/src/dev/nfx-tree/code/ssc-cluster/cluster-vsvr-api.c
> 
> 
> 
> $ p4 diff nfx-tree/code/ssc-cluster/cluster-vsvr-api.c
> ==== //depot/dev/nfx-tree/code/ssc-cluster/cluster-vsvr-api.c#7 -
> /homes/andys/src/dev/nfx-tree/code/ssc-cluster/cluster-vsvr-api.c ====
> 52a53,54
> > static int vs_mgmt_id = VS_ID_INVALID;
> > 
> 5952a5955,5992
> >  * Routine : cluster_getVsMgmtId
> >  *
> >  * Description:
> >  *   Get vs management name buffer.
> >  *
> >  * Arguments:
> >  *
> >  *   NONE
> >  *
> >  * Return Value:
> >  *
> >  *  NFX_OK  - success
> >  *  NFX_ERR - error
> >  *
> >  *--------------------------------------------------------------------
> >  */
> > 
> > int32
> > cluster_getVsMgmtId(void)
> > {
> > 	if (vs_mgmt_id == VS_ID_INVALID) {
> > 		char		buf[VS_RECORD_MAX_LEN];
> > 		vs_rec_t	*vs = (vs_rec_t *)buf;
> > 
> > 		if (cluster_getFilerMgmtVsvr(NULL, vs,
> > sizeof(buf)) !=
> NFX_OK) {
> > 			CLUSTER_PRINTF((
> > 				"%s[%d]: Failed to get Management
> Virtual Server Record\n",
> > 				__FUNCTION__, __LINE__));
> > 			errno = EAGAIN;
> > 		} else {
> > 			vs_mgmt_id = vs->vs_id;
> > 		}
> > 	}
> > 
> >     return vs_mgmt_id;
> > }
> > 
> > /*--------------------------------------------------------------------
