Created attachment 359035 [details] An input file to reproduce the bug<1> Description of problem: cscope gets "Segmentation fault". Version-Release number of selected component (if applicable): rpm -qi cscope Name : cscope Relocations: (not relocatable) Version : 15.6 Vendor: Fedora Project Release : 3.fc11 Build Date: Tue 24 Feb 2009 07:03:50 PM JST How reproducible: Run cscope with given input file Steps to Reproduce: 1. Save attachment equal.txt and colon.txt to /tmp 2. Run cscope like $ cscope /tmp/equal.txt (or $ cscope /tmp/colon.txt) Actual results: $ cscope /tmp/equal.txt cscope /tmp/equal.txt Building cross-reference... Segmentation fault Expected results: Rejecting or ignoring such broken files Additional info: See the attached patch to avoid the bug.
Created attachment 359036 [details] An input file to reproduce the bug<2>
Created attachment 359038 [details] A patch fixing the bug I reported. Both rules for = and :, check a buffer (my_yytext) is allocated or not.
looks good, thank you!
wait, I'm not sure I see how we're getting into the lexer here without setting my_yytext, and your reproducer files appear empty( they're both 2 bytes long). Can you reattach them please?
Please use the files to reproduce the bug. The files are not empty. They are both 2 bytes long. Even 2 bytes they are enough as input to reproduce the segv.
Hmm, ok I see the contents now, but I'm more hesitant to fix this now. What you've effectively done is told cscope that a non-c file is a c-file. As a result you get bad results. As such, I think we can probably do something here, but just checking for NULL and glossing over the problem isn't the right solution. If we enter the processing of either of those tokens and my_yytext isn't set I think we need to abort processing, as thats a lexer error.
I agree with you. Aborting to process the current input file is better than my patch. I will submit a patch to do so next week. Thanks.
Created attachment 359077 [details] patch to detect lexer errors This is what I just comitted upstream and will commit to F-11 shortly. I've verified that it fixes the errors that were reported here.
Thanks. I'll test at home.
fixed in 15.6-4. Thanks!
cscope-15.6-4.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/cscope-15.6-4.fc11
cscope-15.6-4.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.