Community
Participate
Working Groups
Build Identifier: I20100608-0911 When running (not debugging) a program which causes a seg-fault, this is not shown in any way in the eclipse-console (whereas a normal system console does). The feedback is definitely irritating since I cannot see any difference between a correct and none correct running program. I am supervising C++ classes at my university and not reporting a seg-fault causes my students to see CDT as bad product. I suppose that this is not what CDT wants to be!? By the way, I am aware that there is the duplicate Bug 26048. Since the problem was ignored there I deliberately report it again here. Reproducible: Always Steps to Reproduce: 1. run the following program: int main() { main(); }
I'm going to mark this not eclipse. The seg-fault message comes from the Java VM.
(In reply to comment #1) > I'm going to mark this not eclipse. The seg-fault message comes from the Java > VM. I'm not very happy with your "solution". I'm trying to help improve CDT here. If you like to have CDT seen as bad software by newcomers then just leave this bug closed. Is there no interest in having CDT be simple and informative also for new C++ developers? There should be a way to handle that seg-fault coming from Java VW by CDT. Apparently there is such a way since one can see ( -> in CDT ) that a seg-fault occurred when running in debugging via CDT.
since the problem is neither "non-eclipse" (in my point of view) nor "solved" in any way, I reopen the ticket.
Yes,I agree that this bug can be annoying, especially for university students who often use their terminal for debugging, they won't see it in Eclipse console.
This ticket is quiet old, however I think the use case is still valid. It would indeed be nice to get some kind of feedback in the console if a segmentation fault occurs. As far as I know usually the exit code 139 implies a segmentation fault. I would expect this code to appear in the little text field at the top of the console. However (at least on my CentOS 8 machine) the exit code for programs failing with a segmentation fault is always displayed as -1. Therefore I did some debugging; I'm not sure if this is intended or a bug, but there seems to be a difference between the exitValue() function of org.eclipse.cdt.utils.spawner.Spawner and the exitValue() of java.lang.UNIXProcess. Launching an executable with CDTs LocalRunLaunchDelegate in most cases uses the Spawner class, which has native implementations for different operating systems. I tried using a custom LaunchDelegate implementation which creates a UNIXProcess and in this case indeed 139 is returned by exitValue(). So I assume this is either a bug in the wait0() method in org.eclipse.cdt/core/org.eclipse.cdt.core.native/native_src/unix/exec_unix.c or this behavior is intended. Can anyone provide more information about the native spawner?