Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Debug fails with cygwin in Eclipce, but program runs successfully(Debug fails with cygwin in Eclipce, but program runs successfully)
Debug fails with cygwin in Eclipce, but program runs successfully [message #1538116] Wed, 31 December 2014 06:14 Go to next message
amit chaudhary is currently offline amit chaudharyFriend
Messages: 6
Registered: October 2014
Junior Member
Hello,

I am running Posix C++ code in Windows in Eclipse Luna. I am able to run the program successfully, but I get SIGSEGV error when I try to debug the same.

Upon pressing Debug, I get the following message:

[New Thread 1132.0x1298]
[New Thread 1132.0x172c]

Temporary breakpoint 1, main (argc=1, argv=0x22aaf0) at ../src/Main.cpp:96
96		unsigned int port = 7496;

Program received signal SIGSEGV, Segmentation fault.


Then when I click on step, I get the following message and program terminates

Single stepping until exit from function cygstdc++-6!_ZNKSs7compareEPKc,
which has no line number information.
      1 [main] hello 1132 cygwin_exception::open_stackdumpfile: Dumping stack trace to hello.exe.stackdump
[Inferior 1 (process 1132) exited with code 0105400]


Additonal Information

A simple hello world program successfully debug. There after I commented out major piece of my program and it also successfully debugs. But when I add the following piece of code, the program fails to debug.

for (int i=0;i<1000;i++) {
//Commented out additional code
}



Please help me in fixing this.
Re: Debug fails with cygwin in Eclipce, but program runs successfully [message #1538123 is a reply to message #1538116] Wed, 31 December 2014 06:18 Go to previous messageGo to next message
amit chaudhary is currently offline amit chaudharyFriend
Messages: 6
Registered: October 2014
Junior Member
Also, note that while loop and if conditions have no problem with debugging. As soon as, for loop is entered, the program fails to run.

The following two blocks of code work when starting debug.

	if(argc>1){
     date=std::atoi(argv[1]);

    contractName=argv[2];
	}

    while(!isWeekDay(date) || exist_filePath(date,contractName) || isHoliday(date)){
    	date=nextDate(date);
    }


But the following piece of code when entered into the program fails to start debug program at the first line of main
	for (int i=0;i<1;i++) {
}
Re: Debug fails with cygwin in Eclipce, but program runs successfully [message #1538172 is a reply to message #1538123] Wed, 31 December 2014 06:58 Go to previous messageGo to next message
amit chaudhary is currently offline amit chaudharyFriend
Messages: 6
Registered: October 2014
Junior Member
Solved the issue. Please ignore this.

I created a new hello world project and then copied source files from old project to new project. This solved my issue. Must have been some odd project configuration in the old project. Not spending more time to figure out the issue with old project.
Re: Debug fails with cygwin in Eclipce, but program runs successfully [message #1793955 is a reply to message #1538172] Tue, 21 August 2018 07:26 Go to previous message
Yishai E is currently offline Yishai EFriend
Messages: 1
Registered: August 2018
Junior Member
I had a similar problem, that was caused by an expression watch. Clear those out and I think you're golden.
Previous Topic:How setup debugging with LLDB and Eclipse Photon under macOS 10.13.5
Next Topic:Exclude Directory/Files from indexing - failure
Goto Forum:
  


Current Time: Thu Apr 18 02:24:54 GMT 2024

Powered by FUDForum. Page generated in 0.02017 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top