Bug 235335 - Debugger frontend claims to not have enough permissions on /dev/pty or /dev/tty
Summary: Debugger frontend claims to not have enough permissions on /dev/pty or /dev/tty
Status: RESOLVED DUPLICATE of bug 204638
Alias: None
Product: kdevelop
Classification: Applications
Component: CPP Debugger (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-25 12:11 UTC by Gunther Piez
Modified: 2012-01-15 17:45 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
console log (17.01 KB, text/plain)
2010-04-25 16:45 UTC, Gunther Piez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gunther Piez 2010-04-25 12:11:33 UTC
Version:           3.10.2 (using KDevPlatform 0.10.2) (using 4.4.2 (KDE 4.4.2), Gentoo)
Compiler:          x86_64-pc-linux-gnu-gcc
OS:                Linux (x86_64) release 2.6.33.2

When configuring a launch with "Use separate terminal for I/O" and debugging that launch, a dialogbox pops up with "GDB cannot use the tty* or pty*...".

Permission have been set to 777, and the user is in the tty group, the error persists.

gdb is 

GNU gdb (Gentoo 7.0 p2) 7.0
This GDB was configured as "x86_64-pc-linux-gnu".
Comment 1 Niko Sams 2010-04-25 15:38:45 UTC
Please provide steps how to reproduce the issue.

And please enable gdb output in kdebugdialog and post the console output.
Comment 2 Gunther Piez 2010-04-25 16:45:07 UTC
Created attachment 43024 [details]
console log
Comment 3 Gunther Piez 2010-04-25 16:49:18 UTC
1. Project/New From Template...
2. Choose C++/No GUI/Simple CMake...
3. Enter an application name
4. Click Next, then Finish
5. Select Run/Configure Launches
6. Choose your app, click on "+"
7. Insert the name of the application in Executable/Project Target (why isn't this filled with a default?)
8. Select "Debug" in the Launch Configuration
9. Make sure, "Enable separate terminal for application IO" is checked
10. Click OK
11. Select Run/Debug Launch
12. Dismiss Dialog Box stating that gdb can't use any ttys and ptys


Additionally, kdevelop crashed afterwards. This was not repeatable. kdevelop and kdevplatform build is from current svn with cleaned build directories. Frame stack from the crash:



Application: KDevelop (kdevelop.bin), signal: Segmentation fault
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib64/libgobject-2.0.so.0.2200.4-gdb.py", line 9, in <module>
    from gobject import register
  File "/usr/share/glib-2.0/gdb/gobject.py", line 3, in <module>
    import gdb.backtrace
ImportError: No module named backtrace
[Current thread is 1 (Thread 0x7f1b240b4760 (LWP 16038))]

Thread 3 (Thread 0x7f1b0e13c710 (LWP 16039)):
#0  pthread_cond_timedwait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:211
#1  0x00007f1b20844a88 in QWaitConditionPrivate::wait (this=<value optimized out>, mutex=0xafcfe0, time=200000) at thread/qwaitcondition_unix.cpp:85
#2  QWaitCondition::wait (this=<value optimized out>, mutex=0xafcfe0, time=200000) at thread/qwaitcondition_unix.cpp:159
#3  0x00007f1b1d31709e in KDevelop::DUChainPrivate::CleanupThread::run (this=0xafcfc0) at /home/gpiez/src/kdevplatform/language/duchain/duchain.cpp:286
#4  0x00007f1b208439aa in QThreadPrivate::start (arg=0xafcfc0) at thread/qthread_unix.cpp:248
#5  0x00007f1b205b4b24 in start_thread () from /lib/libpthread.so.0
#6  0x00007f1b1eb34f4d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#7  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f1b03e1a710 (LWP 16102)):
#0  pthread_cond_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007f1b20844b23 in QWaitConditionPrivate::wait (this=<value optimized out>, mutex=0x30faf20, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:87
#2  QWaitCondition::wait (this=<value optimized out>, mutex=0x30faf20, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:159
#3  0x00007f1b224e2185 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x30fab30, th=0x3052ab0)
    at /var/tmp/portage/kde-base/kdelibs-4.4.2/work/kdelibs-4.4.2/threadweaver/Weaver/WeaverImpl.cpp:365
#4  0x00007f1b224e5aab in ThreadWeaver::WorkingHardState::applyForWork (this=0x30fb010, th=0x3052ab0)
    at /var/tmp/portage/kde-base/kdelibs-4.4.2/work/kdelibs-4.4.2/threadweaver/Weaver/WorkingHardState.cpp:71
#5  0x00007f1b224e4235 in ThreadWeaver::ThreadRunHelper::run (this=0x7f1b03e19e30, parent=0x30fab30, th=0x3052ab0)
    at /var/tmp/portage/kde-base/kdelibs-4.4.2/work/kdelibs-4.4.2/threadweaver/Weaver/Thread.cpp:87
#6  0x00007f1b224e42e0 in ThreadWeaver::Thread::run (this=0x3052ab0) at /var/tmp/portage/kde-base/kdelibs-4.4.2/work/kdelibs-4.4.2/threadweaver/Weaver/Thread.cpp:142
#7  0x00007f1b208439aa in QThreadPrivate::start (arg=0x3052ab0) at thread/qthread_unix.cpp:248
#8  0x00007f1b205b4b24 in start_thread () from /lib/libpthread.so.0
#9  0x00007f1b1eb34f4d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#10 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f1b240b4760 (LWP 16038)):
[KCrash Handler]
#5  0x00007f1b1c9b6c49 in KDevelop::IBreakpointController::breakpointModel (this=<value optimized out>) at /home/gpiez/src/kdevplatform/debugger/interfaces/ibreakpointcontroller.cpp:62
#6  0x00007f1b1c9b80fc in KDevelop::IBreakpointController::debuggerStateChanged (this=0xbbd980, state=KDevelop::IDebugSession::EndedState)
    at /home/gpiez/src/kdevplatform/debugger/interfaces/ibreakpointcontroller.cpp:69
#7  0x00007f1b1c9b96c2 in KDevelop::IBreakpointController::qt_metacall (this=0xbbd980, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff1e059da0)
    at /home/gpiez/src/kdevplatform/build/debugger/ibreakpointcontroller.moc:80
#8  0x00007f1b093c0120 in GDBDebugger::BreakpointController::qt_metacall (this=0xbbd980, _c=QMetaObject::QueryPropertyStored, _id=503684508, _a=0x7fff1e059da0)
    at /home/gpiez/src/kdevelop/build/debuggers/gdb/breakpointcontroller.moc:70
#9  0x00007f1b20973791 in QMetaObject::activate (sender=0x47a1600, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x7fff1e059da0) at kernel/qobject.cpp:3285
#10 0x00007f1b1c9b63be in KDevelop::IDebugSession::stateChanged (this=0xbbd980, _t1=KDevelop::IDebugSession::EndedState) at /home/gpiez/src/kdevplatform/build/debugger/idebugsession.moc:143
#11 0x00007f1b093cb013 in GDBDebugger::DebugSession::setSessionState (this=0x47a1600, state=KDevelop::IDebugSession::EndedState) at /home/gpiez/src/kdevelop/debuggers/gdb/debugsession.cpp:132
#12 0x00007f1b093cd55d in GDBDebugger::DebugSession::_gdbStateChanged (this=0x47a1600, oldState=) at /home/gpiez/src/kdevelop/debuggers/gdb/debugsession.cpp:255
#13 0x00007f1b093cdef8 in GDBDebugger::DebugSession::setStateOn (this=0x47a1600, stateOn=) at /home/gpiez/src/kdevelop/debuggers/gdb/debugsession.cpp:1325
#14 0x00007f1b093cdf8a in GDBDebugger::DebugSession::gdbExited (this=0x47a1600) at /home/gpiez/src/kdevelop/debuggers/gdb/debugsession.cpp:1245
#15 0x00007f1b093d5415 in GDBDebugger::DebugSession::qt_metacall (this=0x47a1600, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff1e05a1d0)
    at /home/gpiez/src/kdevelop/build/debuggers/gdb/debugsession.moc:204
#16 0x00007f1b20973791 in QMetaObject::activate (sender=0x3cbc070, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x7fff1e059da0) at kernel/qobject.cpp:3285
#17 0x00007f1b093ad370 in GDBDebugger::GDB::processFinished (this=0x3cbc070, exitCode=<value optimized out>, exitStatus=<value optimized out>) at /home/gpiez/src/kdevelop/debuggers/gdb/gdb.cpp:356
#18 0x00007f1b093aca0a in GDBDebugger::GDB::qt_metacall (this=0x3cbc070, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff1e05a390)
    at /home/gpiez/src/kdevelop/build/debuggers/gdb/moc_gdb.cpp:113
#19 0x00007f1b20973791 in QMetaObject::activate (sender=0x33f1fa0, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x7fff1e059da0) at kernel/qobject.cpp:3285
#20 0x00007f1b208e73cf in QProcess::finished (this=0xbbd980, _t1=0, _t2=QProcess::NormalExit) at .moc/debug-shared/moc_qprocess.cpp:142
#21 0x00007f1b208ed3b7 in QProcessPrivate::_q_processDied (this=0x3cc8930) at io/qprocess.cpp:1041
#22 0x00007f1b208ed479 in QProcess::qt_metacall (this=0x33f1fa0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff1e05a540) at .moc/debug-shared/moc_qprocess.cpp:115
#23 0x00007f1b23b27568 in KProcess::qt_metacall (this=0xbbd980, _c=QMetaObject::QueryPropertyStored, _id=503684508, _a=0x7fff1e059da0)
    at /var/tmp/portage/kde-base/kdelibs-4.4.2/work/kdelibs-4.4.2_build/kdecore/kprocess.moc:69
#24 0x00007f1b20973791 in QMetaObject::activate (sender=0x4918390, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x7fff1e059da0) at kernel/qobject.cpp:3285
#25 0x00007f1b209d0efe in QSocketNotifier::activated (this=0xbbd980, _t1=62) at .moc/debug-shared/moc_qsocketnotifier.cpp:89
#26 0x00007f1b2097e933 in QSocketNotifier::event (this=0x4918390, e=0x7fff1e05abf0) at kernel/qsocketnotifier.cpp:317
#27 0x00007f1b1f988450 in QApplicationPrivate::notify_helper (this=0x674a50, receiver=0x4918390, e=0x7fff1e05abf0) at kernel/qapplication.cpp:4300
#28 0x00007f1b1f988771 in QApplication::notify (this=0x7fff1e05b020, receiver=<value optimized out>, e=0x7fff1e05abf0) at kernel/qapplication.cpp:4183
#29 0x00007f1b21145c96 in KApplication::notify (this=0x7fff1e05b020, receiver=0x4918390, event=0x7fff1e05abf0)
    at /var/tmp/portage/kde-base/kdelibs-4.4.2/work/kdelibs-4.4.2/kdeui/kernel/kapplication.cpp:302
#30 0x00007f1b2095c9ab in QCoreApplication::notifyInternal (this=0x7fff1e05b020, receiver=0x4918390, event=0x7fff1e05abf0) at kernel/qcoreapplication.cpp:704
#31 0x00007f1b2098f67a in QCoreApplication::sendEvent (source=0x678750) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#32 socketNotifierSourceDispatch (source=0x678750) at kernel/qeventdispatcher_glib.cpp:110
#33 0x00007f1b19f58e9d in g_main_dispatch (context=0x677520) at gmain.c:1960
#34 IA__g_main_context_dispatch (context=0x677520) at gmain.c:2513
#35 0x00007f1b19f5c858 in g_main_context_iterate (context=0x677520, block=<value optimized out>, dispatch=<value optimized out>, self=<value optimized out>) at gmain.c:2591
#36 0x00007f1b19f5c980 in IA__g_main_context_iteration (context=0x677520, may_block=1) at gmain.c:2654
#37 0x00007f1b2098f323 in QEventDispatcherGlib::processEvents (this=0x6749b0, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:412
#38 0x00007f1b1fa4901e in QGuiEventDispatcherGlib::processEvents (this=0xbbd980, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#39 0x00007f1b2095b4b2 in QEventLoop::processEvents (this=<value optimized out>, flags=) at kernel/qeventloop.cpp:149
#40 0x00007f1b2095b885 in QEventLoop::exec (this=0x7fff1e05ae50, flags=) at kernel/qeventloop.cpp:201
#41 0x00007f1b2095daab in QCoreApplication::exec () at kernel/qcoreapplication.cpp:981
#42 0x000000000040895f in main (argc=<value optimized out>, argv=<value optimized out>) at /home/gpiez/src/kdevelop/app/main_internal.cpp:232
Comment 4 Niko Sams 2010-04-25 20:27:39 UTC
SVN commit 1118709 by nsams:

Hide broken option "Use separate terminal for I/O" for now.

I can't fix this for 4.0 so just hide the option for now.
CCBUG: 235335

 M  +2 -0      debuggerconfigwidget.ui  
 M  +2 -1      debugsession.cpp  
 M  +1 -1      debugsession.h  
 M  +3 -3      gdblaunchconfig.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1118709
Comment 5 Niko Sams 2010-04-25 20:30:13 UTC
Vladimir, could you please comment on this; what should this option do and how is it implemented?
Comment 6 Niko Sams 2010-04-25 20:33:29 UTC
Gunther, please file a new bug for the crash you got.
Did you quit kdevelop before the crash?
Comment 7 Gunther Piez 2010-04-26 10:25:38 UTC
If this option is enabled kdevelop should start a terminal (konsole, xterm or something) and then run the progrram in it. The debugger should attach to the program. At least, this is how I would implement it :-)

This is neccessary for debugging applications which use terminal functions (ncurses) or simply terminal input (stdin, std::cin).

The latter  is what I actually need and the reason I stumbled across this.

A workaround is starting the program in a konsole, fire up qtcreator, attach the debugger to the running process and use qtcreator as a graphical debugger frontend. Which isn't actually that bad, you should really have a look at it... ;-)
Comment 8 Gunther Piez 2010-04-26 10:31:07 UTC
(In reply to comment #6)
> Gunther, please file a new bug for the crash you got.
> Did you quit kdevelop before the crash?

I do not remember what I did when i crashed. It happened while I was in a hurry to create a list of the steps needed to reproduce the bug. Would it still be useful to submit as a bug?
Comment 9 Gunther Piez 2010-04-26 11:16:04 UTC
https://bugs.kde.org/show_bug.cgi?id=235422 may be related to the crash described in #3.
Comment 10 Andreas Pakulat 2010-04-26 11:30:00 UTC
(In reply to comment #7)
> If this option is enabled kdevelop should start a terminal (konsole, xterm or
> something) and then run the progrram in it. The debugger should attach to the
> program. At least, this is how I would implement it :-)

I think Niko was more talking about the actual implementation.
> A workaround is starting the program in a konsole, fire up qtcreator, attach
> the debugger to the running process and use qtcreator as a graphical debugger
> frontend. Which isn't actually that bad, you should really have a look at it...

Just the same as KDevelop can attach to already running processes.

Andreas
Comment 11 Vladimir Prus 2010-04-26 13:38:50 UTC
Niko Sams wrote:
> https://bugs.kde.org/show_bug.cgi?id=235335
> 
> 
> Niko Sams <niko.sams@gmail.com> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |ghost@cs.msu.su
> 
> 
> 
> 
> --- Comment #5 from Niko Sams <niko sams gmail com>  2010-04-25 20:30:13 ---
> Vladimir, could you please comment on this; what should this option do and how
> is it implemented?

Gunther is right as to what this option should do. I believe the current error
message is actually wrong, though. What happens is that stty.cpp tries to run
'xterm' fails, and then produces that error message -- which is wrong. Using
'konsole' by default might be a better idea. If you ping me on IRC in the
evening, when I'm back to my Linux machine, I can send a WIP patch.

- Volodya
Comment 12 Niko Sams 2012-01-15 17:45:10 UTC

*** This bug has been marked as a duplicate of bug 204638 ***