Community
Participate
Working Groups
Invoking a quickfix on a code (with a misplaced semicolon) below causes Eclipse to freeze: ''' #include <stdio.h> #include <stdlib.h> typedef enum { MY_ENUM_VAL0 = 0,/**< MY_ENUM_VAL0 */ MY_ENUM_VAL1 = 1 /**< MY_ENUM_VAL1 */ }; MY_ENUM_T /** invoke quickfix -> eclipse freezes*/ int main(void) { puts("!!!Hello World!!!"); return EXIT_SUCCESS; } ''' Steps to reproduce: 1) run Eclipse 2) create new Hello World ANSI C project 3) replace auto-created source with code above and save 4) build the project 5) set focus to line with comment: /** invoke quickfix -> eclipse freezes*/ 6) press ctrl+1, select 'Add semicolon' quickfix Eclipse freezes, no error in workspace log appears. My configuration: Eclipse platform 4.15 (I20200305-0155) Eclipse CDT 9.11.0.202003091030
I can't reproduce this problem because the output from GCC is make all Building file: ../main.c Invoking: GCC C Compiler gcc -O0 -g3 -pedantic -Wall -Wextra -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.o" -o "main.o" "../main.c" ../main.c:15:1: warning: useless storage class specifier in empty declaration }; MY_ENUM_T /** invoke quickfix -> eclipse freezes*/ ^ ../main.c:17:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’ int main(void) { ^~~ make: *** [subdir.mk:20: main.o] Error 1 "make all" terminated with exit code 2. Build might be incomplete. So quickfix is not shown at all for me. It could help if you can get a stack trace.
(In reply to Marco Stornelli from comment #1) > I can't reproduce this problem because the output from GCC is > > make all > Building file: ../main.c > Invoking: GCC C Compiler > gcc -O0 -g3 -pedantic -Wall -Wextra -c -fmessage-length=0 -MMD -MP > -MF"main.d" -MT"main.o" -o "main.o" "../main.c" > ../main.c:15:1: warning: useless storage class specifier in empty declaration > }; MY_ENUM_T /** invoke quickfix -> eclipse freezes*/ > ^ > ../main.c:17:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ > before ‘int’ > int main(void) { > ^~~ > make: *** [subdir.mk:20: main.o] Error 1 > "make all" terminated with exit code 2. Build might be incomplete. > > So quickfix is not shown at all for me. My build fails as well (which is expected, since there is syntax error), but after the build fails, I can see the line highlighted and quickfix available (attaching screenshot). My gcc (9.2.1 20190827) says more or less the same: ''' make all Building file: ../src/testC.c Invoking: GCC C Compiler gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/testC.d" -MT"src/testC.o" -o "src/testC.o" "../src/testC.c" ../src/testC.c:7:1: warning: useless storage class specifier in empty declaration 7 | }; MY_ENUM_T /** invoke quickfix -> eclipse freezes*/ | ^ ../src/testC.c:7:13: error: expected ‘;’ before ‘int’ 7 | }; MY_ENUM_T /** invoke quickfix -> eclipse freezes*/ | ^ | ; 8 | 9 | int main(void) { | ~~~ make: *** [src/subdir.mk:20: src/testC.o] Error 1 "make all" terminated with exit code 2. Build might be incomplete. ''' > > It could help if you can get a stack trace. Eclipse freezes, while stack trace is not produced in workspace log. I don't know if I can get the stack trace...
Created attachment 282310 [details] screenshot
QuickFix is triggered by "./src/testC.c:7:13: error: expected ‘;’ before ‘int’". As you can see I haven't got this warning, possible related with Gcc version however. I think you can get a stacktrace anyway debugging eclipse, I don't remember the procedure however. @Jonah can you help here?
You can get a stack trace from a hanging Java process using jstack: https://wiki.eclipse.org/How_to_report_a_deadlock#Using_jps_.2F_jstack_.28requires_JDK_1.6_or_later.29
Created attachment 282311 [details] stack trace
Thank you both, attaching the stack trace...