Bug 546832

Summary: cscope segfaults when multiple options are given in one argument
Product: [Fedora] Fedora Reporter: Watanabe, Yuki <magicant.starmen>
Component: cscopeAssignee: Neil Horman <nhorman>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: nhorman
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-12-14 14:09:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
core file none

Description Watanabe, Yuki 2009-12-12 06:25:41 UTC
Description of problem:
After updating to cscope-15.6-6.fc12 (i686), cscope does not correctly parse multiple options given after a single hyphen.
For example, "cscope -b -R" is OK, but "cscope -bR" segfaults.

Version-Release number of selected component (if applicable):
cscope-15.6-6.fc12 (i686)

How reproducible:
Cscope segfaults for most combinations of options, but not all.
"cscope -ld" does not segfault.

Comment 1 Neil Horman 2009-12-14 01:02:58 UTC
do you have a backtrace?

Comment 2 Watanabe, Yuki 2009-12-14 12:15:32 UTC
Created attachment 378194 [details]
core file

Attaching a core file created by "cscope -bR".
Cscope was run in a directory containing a dummy empty file "temp.c" only.

Backtrace:
#0  strchr () at ../sysdeps/i386/strchr.S:67
#1  0x0805170c in compath (pathname=<value optimized out>) at compath.c:69
#2  0x080529e4 in infilelist (path=<value optimized out>) at dir.c:623
#3  0x08053787 in makefilelist () at dir.c:280
#4  0x0805af18 in main (argc=-1, argv=<value optimized out>) at main.c:688

Comment 3 Neil Horman 2009-12-14 13:19:51 UTC
I don't see how this is happening.  specifying multiple options like that should result in an error exit condition, and not get to this point.  Are you using an existing cscope.out file when this occurs?  Also, what version of glibc are you running with?

Comment 4 Neil Horman 2009-12-14 13:21:53 UTC
Also, not that I purposely changed the implementation of how cscope operates to use the gnu getopt_long interface because the current implementation was filled with possible errors that led to stack overflows.  As the latest implementation of getopt long doesn't support the specification of multiple options in 1 argument, doing so in cscope won't be supported any more.

Comment 5 Neil Horman 2009-12-14 13:24:35 UTC
scratch that last comment, I just got it to reproduce.

Comment 6 Neil Horman 2009-12-14 14:09:18 UTC
ok, found the problem, and it identical to another bug I have, I'm closing this a duplicate of that.

*** This bug has been marked as a duplicate of bug 547023 ***