From: SourceForge.net <no...@so...> - 2008-04-17 03:34:40
|
Bugs item #1756561, was opened at 2007-07-19 04:16 Message generated for change (Settings changed) made by broeker You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104664&aid=1756561&group_id=4664 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: C lexer/parser Group: None >Status: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: Peyman Taher (peyman_taher) Assigned to: Hans-Bernhard Broeker (broeker) Summary: Segmentation Fault Initial Comment: Here is the sequence of events that cause the segmentation fault: I created the cscope.files file for Linux kernel version 2.6.21.5 directory tree and removed the files for all arch/ except for i386 and also all Documentation/ but I didn't remove the script/ directory. I traced the execution of cscope -b -q using strace in Debian Etch and here is the last few lines before segmentation fault: ######################################## open("scripts/Makefile.headersinst", O_RDONLY) = 7 fcntl64(7, F_SETFD, FD_CLOEXEC) = 0 fstat64(7, {st_mode=S_IFREG|0644, st_size=7007, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f12000 read(7, "# =============================="..., 8192) = 7007 read(7, "", 4096) = 0 write(6, "\"S.R>` \"S.Q|\nstrip \"S.R> \"S.Q|\n"..., 4096) = 4096 write(3, "his\n \nadds\n\n\n49 #\250\n\t`$\n(\nobj\n\350\n\264"..., 4096) = 4096 access(" ; \\ echo \"\\#ifndef $$STUBDEF\" ; \\ echo \"\\#define $$STUBDEF\" ; \\ echo \"\\#if $(ARCHDEF)\" ; \\ if [ -r $(subst /$(_dst)/,/include/$(archasm)/,$@) ]; then \\ echo \"\\#include <$(archasm)/$$FNAME", R_OK) = -1 ENOENT (No such file or directory) access("/usr/include/ ; \\ echo \"\\#ifndef $$STUBDEF\" ; \\ echo \"\\#define $$STUBDEF\" ; \\ echo \"\\#if $(ARCHDEF)\" ; \\ if [ -r $(subst /$(_dst)/,/include/$(archasm)/,$@) ]; then \\ echo \"\\#include <$(archasm)/$$FNAME", R_OK) = -1 ENOENT (No such file or directory) access(" ; \\ echo \"\\#ifndef $$STUBDEF\" ; \\ echo \"\\#define $$STUBDEF\" ; \\ echo \"\\#if $(ARCHDEF)\" ; \\ if [ -r $(subst /$(_dst)/,/include/$(archasm)/,$@) ]; then \\ echo \"\\#include <$(archasm)/$$FNAME>\" ; \\ else \\ echo \"\\#error $(archasm)/$$FNAME does not exist in\" \\http://sourceforge.net/tracker/?func=add&group_id=4664&atid=104664 \"the $(ARCH) architecture\" ; \\ fi ; \\ echo \"\\#elif $(ALTARCHDEF)\" ; \\ if [ -r $(subst /$(_dst)/,/include/$(altarchasm)/,$@) ]; then \\ echo \"\\#include <$(altarchasm)/$$FNAME", R_OK) = -1 ENOENT (No such file or directory) --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++ Process 5364 detached ############################################ So apparently segmentation fault occurs when cscope tries to parse the script/Makefile.headersinst file at line 135 of the file. I have attachede the cscope.files file. ---------------------------------------------------------------------- Comment By: Peyman Taher (peyman_taher) Date: 2007-07-20 09:00 Message: Logged In: YES user_id=1848490 Originator: YES I don't think when one buys a calculator expects it crashes whenever you divide something by zero, right? This is called exception handling and a program like cscope is supposed to handle it what so ever. So I guess I'll follow what nhorman said or will check the source of the problem by my own. Thanks anyway. ---------------------------------------------------------------------- Comment By: Hans-Bernhard Broeker (broeker) Date: 2007-07-19 22:01 Message: Logged In: YES user_id=27517 Originator: NO > I created the cscope.files file for Linux kernel version 2.6.21.5 directory > tree and removed the files for all[...] The root of your problem lies right here. You created a cscope.files without considering what should go into it. What on earth is a _Makefile_ doing in your input list for cscope? Is it really so hard to guess that any 'find' command that generates a cscope.files list should include a qualifier like '-name "*.[ch]"' to reduce it to actual C source files? Maybe you'll be better off just using the script 'cscope-indexer' that comes with the program as part of xcscope.el. ---------------------------------------------------------------------- Comment By: Neil Horman (nhorman) Date: 2007-07-19 12:46 Message: Logged In: YES user_id=827328 Originator: NO I'm not quite sure what you've done, but the strace above looks completely garbled with some other garbage. What would be helpful in determing what caused your core dump would be a backtrace. why don't you build your cscope binary with -g (if its not already), disable yor coredump rlim, capture a core file when the SIGSEGV happens, load it into gdb, and post the resultant backtrace. That will tell us much more accurately whats gone wrong here. Thanks! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104664&aid=1756561&group_id=4664 |