Bug #18609 2012-05-11 21:18

secks

New debugger doesn't play nice with gnome-terminal

I previously had Settings - General settings - Terminal set to:

gnome-terminal -t $TITLE --geometry=140x50 -x

Once I updated to the latest code the debugger stopped working. If I add a breakpoint the program with terminate at that breakpoint. It's almost as if the SIGINT that is supposed to be sent to the debugee, is being sent to the sleep command or the terminal itself.

Also, depending on if gnome-terminal factory is enabled (reusing terminal windows instead of new processes,) the gdb process will start but the actual process never starts.

Category
Debugger
Group
Platform:Linux
Status
Closed
Close date
2013-10-04 21:27
Assigned to
tpetrov
secks 2012-05-11 22:25

The build that I experienced this on was svn7957

secks 2012-05-14 18:30
There are actually two issues here
--------------------
#1
--------------------
there is a hard coded check that has been added in cbplugin.cpp
wxString cbDebuggerPlugin::GetConsoleTty(int ConsolePid)
.. the culprit is this:
if (psCmd.Contains(wxT("-T"))) {

-T is only valid if using xterm .. also, the terminal is a setting so that if statement can't be based on a  hard coded value.  it needs to be based on whatever is in the setting:
app -> /console_terminal


-------------------
#2
-------------------
this happens when app/console_terminal is set to gnome-terminal, --disable-factory is not set, and there is already an instance of gnome-terminal running that would be reused.  what happens is gnome-terminal starts, finds the previous instance that is running, sends the command to the first terminal to run.. the second gnome-terminal then stops .. the function RunNixConsole sends a kill 0 signal to that process id to see if it's really running .. BOOM! there is a comment above the kill that states:
        // For some reason wxExecute returns PID>0, when the command cannot be launched.
        // Here we check if the process is alive and the PID is really a valid one.

i did some testing and it appears that wxExecute is returning the pid of the vforked process, which is correct if the command to be executed is valid.  i propose better parsing in GetConsoleTty() instead of requiring the pid to exist (as this bug shows, the pid can be different)

secks 2012-05-14 21:18

I have submitted a patch for this bug:

Patch #3291

tpetrov 2012-10-01 21:13

As far as I can see r8048 has fixed the first issue.

See here for the details: http://svn.berlios.de/wsvn/codeblocks/trunk/?op=revision&rev=8048

Is the second issue still relevant?

What are the steps needed to reproduce it?

Does it happen with older gnome-terminals (the one in centos 5.xx for example)?

tpetrov 2013-10-04 21:27

Report is closed.

Note: This is a preformatted standard message.

Possible reasons for closing this report are:

* the developer in charge of the issue

- could not reproduce it despite trying several times

- did not get sufficient information

- got no reply to an inquiry for specific information

* the report is quite a bit dated of now, and

- no user comments have been added for several weeks

- significant changes have been made to the code

- no other developer could reproduce it either

It is assumed that the problem does not persist and the report

can be closed.

If the problem reappears in future releases, please feel free to

re-open this report and provide precise information on how to

reproduce it.