| Summary: | [abrt] cscope-15.7a-7.fc16: check_for_assignment: Process /usr/bin/cscope was killed by signal 11 (SIGSEGV) | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Peter Portante <pportant> | ||||
| Component: | cscope | Assignee: | Neil Horman <nhorman> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 16 | CC: | nhorman, pportant | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | abrt_hash:c7e1679e9207a6b2f714ec8b47bedc13772ab00b | ||||||
| Fixed In Version: | cscope-15.7a-9.fc16 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2012-04-02 23:30:14 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Attachments: |
|
||||||
|
Description
Peter Portante
2012-03-03 19:15:52 UTC
Created attachment 567323 [details]
File: backtrace
Here is the diff that fixes it, the check_for_assignment routine is not properly looking for ending block marker, and both it and its caller need to account for possibly hitting EOF:
--- /usr/src/debug/cscope-15.7a/src/find.c 2011-06-29 12:20:22.000000000 -0400
+++ ./find.c 2012-03-03 23:23:48.049904994 -0500
@@ -109,51 +109,51 @@
* assignment or not Do this by examining the next character
* or two in blockp */
char *asgn_char = blockp;
- int i = 1; /*skip any leading \n*/
+ unsigned int i = 0;
- while(1) {
- if (asgn_char[i] == blockmark) {
- /* get the next block when we reach the end of
- * the current block */
- asgn_char = read_block();
- i=0;
- }
- while (isspace((unsigned char) asgn_char[i])) {
- /* skip any whitespace or \n */
- i++;
- }
- /* this next character better be one of the assignment
- * characters, ie: =, +=, -=, *=, %=, /=, &=, |=, ^=,
- * ~= if not, then its a notmatched case */
- if ((asgn_char[i] != '=') &&
- (asgn_char[i] != '+') &&
- (asgn_char[i] != '-') &&
- (asgn_char[i] != '*') &&
- (asgn_char[i] != '/') &&
- (asgn_char[i] != '%') &&
- (asgn_char[i] != '&') &&
- (asgn_char[i] != '|') &&
- (asgn_char[i] != '^') &&
- (asgn_char[i] != '~')) {
- return NO;
- } else {
- /* if the first found character is = and the
- * next found character is also =, then this
- * is not an assignment. likewise if the
- * first character is not = (i.e. one of the
- * +,-,*,etc. chars and the next character is
- * not =, then this is not an assignment */
- if ((((asgn_char[i] == '=')
- && (asgn_char[i+1] == '=')))
- || ((asgn_char[i] != '=')
+ while (isspace((unsigned char) asgn_char[i])) {
+ /* skip any whitespace or \n */
+ i++;
+ }
+ if (asgn_char == NULL) return NO;
+ i=0;
+ }
+
+ /* this next character better be one of the assignment
+ * characters, ie: =, +=, -=, *=, %=, /=, &=, |=, ^=,
+ * ~= if not, then its a notmatched case */
+ if ((asgn_char[i] != '=') &&
+ (asgn_char[i] != '+') &&
+ (asgn_char[i] != '-') &&
+ (asgn_char[i] != '*') &&
+ (asgn_char[i] != '/') &&
+ (asgn_char[i] != '%') &&
+ (asgn_char[i] != '&') &&
+ (asgn_char[i] != '|') &&
+ (asgn_char[i] != '^') &&
+ (asgn_char[i] != '~')) {
+ return NO;
+ } else {
+ /* if the first found character is = and the
+ * next found character is also =, then this
+ * is not an assignment. likewise if the
+ * first character is not = (i.e. one of the
+ * +,-,*,etc. chars and the next character is
+ * not =, then this is not an assignment */
+ if ((((asgn_char[i] == '=')
+ && (asgn_char[i+1] == '=')))
+ || ((asgn_char[i] != '=')
&& (asgn_char[i+1] != '='))) {
- return NO;
- }
- /* if we pass all these filters then this is
- * an assignment */
- return YES;
- } /* else(operator char?) */
- } /* while(endless) */
+ return NO;
+ }
+ /* if we pass all these filters then this is
+ * an assignment */
+ return YES;
+ } /* else(operator char?) */
}
/* The actual routine that does the work for findsymbol() and
@@ -341,11 +341,11 @@
else {
putref(0, file, global);
}
- if (blockp == NULL) {
- return NULL;
- }
}
notmatched:
+ if (blockp == NULL) {
+ return NULL;
+ }
cp = blockp;
}
}
For what it is worth, I have forked cscope-15.7a from the original source forge, applied those fixes, and added my changes for pycscope at: https://github.com/portante/cscope. thanks for the patch, its in fedora git now, I'll have an update shorly. I've been meaning to get the assignment search pushed into upstream forever. Thanks for the reminder! cscope-15.7a-8.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/cscope-15.7a-8.fc16 Package cscope-15.7a-8.fc16: * should fix your issue, * was pushed to the Fedora 16 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing cscope-15.7a-8.fc16' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2012-3040/cscope-15.7a-8.fc16 then log in and leave karma (feedback). cscope-15.7a-9.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/cscope-15.7a-9.fc16 cscope-15.7a-9.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report. |