Re: radium segfaults on reading command line options

Carter Bullard via Argus-info <[email protected]>
Newsgroups gmane.network.argus
Message-ID <[email protected]>
Hey Richard,
Hmmmm, yep that is a ‘cut copy paste’ bug.    optarg is a global variable that you get from the getopt.3 facility.
Because overriding global variables with local defines is a common practice, this type of error can be tough to see.

Your fix:
                 if (isdigit((int) *mode->mode))
                   setArgusMarReportInterval (ArgusParser, mode->mode);

Is how I would fix it, so … excellent !! I have put in the fix for this bug which will be in the new release.
Thanks !!!!!
Carter


> On May 5, 2016, at 11:34 PM, Richard Rothwell via Argus-info <[email protected]> wrote:
> 
> Hi Carter
> 
> 
> 
> This command line used to work, but now it segfaults as follows:
> 
> /usr/local/sbin/radium -S cisco://any:9012 -d -e 12 -P 562 -M 60 -- local dur lte 300
> 
> 
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x0000000000405511 in ArgusClientInit (parser=0x7ffff7eab010) at ./radium.c:117
> 117	               if (isdigit(*optarg))
> 
> I have submitted a bug via your bug reporter.
> 
> I am not even sure why it compiles as I can’t locate the definition of optarg.
> Elsewhere its a local variable, but here it seems to be a global without a definition. 
> 
> Regards from Richard
> 
>
smime.p7s (application/pkcs7-signature, 6.1 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.