AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20070115104915.37cdc8ee@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:onstor-exch02.onstor.net
NSV:
SSH:
R:<chris.vandever@onstor.com>,<larry.scheer@onstor.com>,<tim.gardner@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	BB375AF679D4A34E9CA8DFA650E2B04E0138C3FC@onstor-exch02.onstor.net
X-Sylpheed-End-Special-Headers: 1
Date: Mon, 15 Jan 2007 10:50:11 -0800
From: Andrew Sharp <andy.sharp@onstor.com>
To: "Chris Vandever" <chris.vandever@onstor.com>
Cc: "Larry Scheer" <larry.scheer@onstor.com>, "Tim Gardner"
 <tim.gardner@onstor.com>
Subject: Re: do_system() seg faulting
Message-ID: <20070115105011.0412b60d@ripper.onstor.net>
In-Reply-To: <BB375AF679D4A34E9CA8DFA650E2B04E0138C3FC@onstor-exch02.onstor.net>
References: <BB375AF679D4A34E9CA8DFA650E2B04E0A9474@onstor-exch02.onstor.net>
	<BB375AF679D4A34E9CA8DFA650E2B04E0138C3FC@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

In Larry's case, it was pilot error ~:^)

Cheers,

a

On Mon, 15 Jan 2007 10:47:39 -0800 "Chris Vandever"
<chris.vandever@onstor.com> wrote:

> The problem I had was with trying to print a ulonglong using %llx.
> The parameters would get screwed up on the stack, usually because the
> compiler would get confused and pass an earlier 32-bit quantity as
> 64-bits.  The details are in defect #16454.  I've seen problems in
> both the caller and callee, but either way it ends up with a SEGV in
> strlen().
> 
> I don't know if it's the same thing you're seeing, but it sounds
> similar.  This really is something we need to fix, because we use this
> construct throughout the code, pretty much whenever we print a
> volId.  I hacked around it for the file I had problems with, but did
> not modify any other files.  So, what we'll see in the field is an
> app on the SSC crashing when it's trying to do an innocuous elog.
> 
> ChrisV
> 
> _____________________________________________
> From: Larry Scheer 
> Sent: Saturday, January 13, 2007 6:59 PM
> To: Andy Sharp; Chris Vandever
> Cc: Tim Gardner
> Subject: do_system() seg faulting
> 
> Andy,
>    I was trying to get nfxsh running my script but the do_system
> function you bolted into the nfxsh code is getting a segmentation
> fault. I remember Chris running into a problem with the varargs calls
> doing that on the ssc. I think she figured out what was needed to get
> it working but I don't recall what the trick was. It may have had
> something to do with the va_start.
> 
> Chris here is the do_system call. Does any of this look familiar?
> 
> do_system(const char *format, ...)
> {
>     va_list va;
>     char command[1024];
>     int s;
> 
>     va_start(va, format);
>     s = vsnprintf(command, sizeof(command), format, va);
>     va_end(va);
> #ifdef DEBUG
>     printf("Shell command '%s'\n", command);
>     fflush(stdout);
> #endif
>     if (s >= sizeof(command)) {
>         return E2BIG;
>     } else if (s > 0) {
>         return system(command);
>     }
> 
>     /* whatever */
>     return -ESRCH;
> }
> 
> I did this as a test to trigger the seg fault in cmd_upgrade.c
> 
> rc = do_system("ls -al") ;
> 
> Any help would be appreciated,
> 
> Larry
