Bug 72547 - kdevelop doesn't chekc file permissions: no error message if file not executable
Summary: kdevelop doesn't chekc file permissions: no error message if file not executable
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: CPP Debugger (show other bugs)
Version: 3.0.0b2
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-13 13:58 UTC by Daniel Franke
Modified: 2005-08-19 12:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Franke 2004-01-13 13:58:03 UTC
Version:           3.0.0b2 (using KDE 3.1.4)
Installed from:    compiled sources
Compiler:          gcc version 3.2.2
OS:          SunOS (sun4u) release 5.8

CVS 2004/01/12

-rw-rwxr-x    1 franke   users        9648 Jul 23 00:07 zombie
./zombie
bash: ./zombie: Permission denied

(kdevelop project 'zombie', these file permissions are NOT set by kdevelop, but by another app)

Try to run zombie within it's project, nothing happens. A _very_ silent error message appears in application-tab (without raising it).

Try to debug the project: 
-- GDB --
gdb /home/franke/devel/zombie/src/zombie -fullname -nx -quiet
(gdb) set edit off 
(gdb) set confirm off 
(gdb) (gdb) 
(gdb) set print static-members off 
(gdb) tty /dev/ttyp1 
(gdb) set width 0 
(gdb) set height 0 
(gdb) set stop-on 1 
(gdb) handle SIG32 pass nostop noprint 
(gdb) handle SIG43 pass nostop noprint 
(gdb) set print asm-demangle on 
(gdb) cd /home/franke/devel/zombie/src 
(gdb) break zombie.c:11 
Breakpoint 1 at 0x10688: file zombie.c, line 11.
(gdb) run 

Program exited with code 01.
-- 

Running 'zombie' in gdb:
(gdb) run
Starting program: /home/franke/devel/zombie/src/zombie
/usr/bin/bash: /home/franke/devel/zombie/src/zombie: Permission denied
/usr/bin/bash: /home/franke/devel/zombie/src/zombie: Permission denied

To know about the reason of 'Program exited with code 01.' would really be appreciated!
Comment 1 Jens Dagerbo 2004-01-13 15:07:35 UTC
Hmm.. yeah, I can verify that this happens.

KDevelop reports "Permission denied" when you attempt to run the program, but only shows the "code 01" string when you attempt to debug it.
Comment 2 Daniel Franke 2005-01-14 14:44:12 UTC
kdevelop-3.1.91, KDE-3.3.91 (beta1), CVS 050113

On execution: a konsole window appears that tells the user that the binary was sucessfully not executed ... *ähem* ...  more or less something like this ;)

debugging is still answered with "Program exited with code 01" in the status bar - no more information.

(I know, that's a wierd one)
Comment 3 Vladimir Prus 2005-08-19 12:48:51 UTC
SVN commit 450870 by vprus:

Before running debugger, check if application is indeed executable.

BUG: 72547


 M  +19 -1     gdbcontroller.cpp  


--- branches/KDE/3.5/kdevelop/languages/cpp/debugger/gdbcontroller.cpp #450869:450870
@@ -1472,7 +1472,25 @@
             // Note: script could contain "run" or "continue"
         }
         else {
-            queueCmd(new GDBCommand("run", RUNCMD, NOTINFOCMD, 0));
+
+            // The program is run locally. Need the make sure it's executable,
+            // just in case.
+            QFileInfo app(application_);
+            if (app.isExecutable())
+            {
+                queueCmd(new GDBCommand("run", RUNCMD, NOTINFOCMD, 0));
+            }
+            else
+            {
+                KMessageBox::error(
+                    0, QString(
+                        i18n("<b>Could not run application '%1'.</b>"
+                             "<p>The application does not have the executable bit set. "
+                             "Try rebuilding the project, or change permissions "
+                             "manually."
+                            )).arg(app.fileName()),
+                    i18n("Could not run application"));
+            }
         }
     }
     else {