executing programs compiled with gcc, don't permissions!

Asked by José Cabo

Binary package hint: gcc

Hi,

I a programmer, student and more... but for various month I didn't had compiled.
when I was in hardy I had and "very rare error" when I tried to execute a simple C program:

#include <stdio.h>

int main(){
printf("hola");
return 0;
}

I had this output!!!!:
bash: ./programa: Permiso denegado

WHATTTTTTT1???!? I have ALL permissions, all needed packages for compile, all!!
WTF is that? I remember that I posted in the ubuntuforums but they don't have idea :S
so when Intrepid was out I updated (formated and updated, eh?). And now... i have the same!!

I need compile, I need practice for the university. I don't have idea what is it. Pleaseee... in hardy I have the same... in Intrepid too?? What i failing? :S

PS: the compilations don't show errors... :(, it's perfect.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gcc-defaults Edit question
Assignee:
No assignee Edit question
Solved by:
José Cabo
Solved:
Last query:
Last reply:

This question was originally filed as bug #303312.

This question was reopened

Revision history for this message
Chris Coulson (chrisccoulson) said :
#1

Thank you for taking the time to report this issue and helping to make Ubuntu better. Examining the information you have given us, this does not appear to be a bug report so we are closing it and converting it to a question in the support tracker. We appreciate the difficulties you are facing, but it would make more sense to raise problems you are having in the support tracker at https://answers.launchpad.net/ubuntu if you are uncertain if they are bugs. For help on reporting bugs, see https://help.ubuntu.com/community/ReportingBugs#When%20not%20to%20file%20a%20bug.

Revision history for this message
Chris Coulson (chrisccoulson) said :
#2

Does your compiled binary have executable permissions? Try doing:

chmod +x ./programa

Revision history for this message
José Cabo (folcwine) said :
#3

Hi, I am not conform... to move this to a question. I think this is a bug... not a question. The problem occur after compile-execute a GTK-C application.

I open in Ubunut Forum a post with information: http://ubuntuforums.org/showthread.php?p=6271955#post6271955

The program have all needed permissions, please, try to execute the "bug".

Revision history for this message
José Cabo (folcwine) said :
#4

Hi, I am not conform... to move this to a question. I think this is a bug... not a question. The problem occur after compile-execute a GTK-C application.

I open in Ubunut Forum a post with information: http://ubuntuforums.org/showthread.php?p=6271955#post6271955

The program have all needed permissions, please, try to execute the "bug".

Revision history for this message
Chris Coulson (chrisccoulson) said :
#5

There is no bug in gcc here. This is a support request.

After doing the compile, what are the permissions on your executable file (what is the output of ls -l programa)?

Revision history for this message
José Cabo (folcwine) said :
#6

The permissions are: -rwxrwxrwx
All executables that I compiled in the "recent past" don't exect... with the same error.
When I was in Hardy I had the same problem :( I don't know why... any sugestion?

PS: read the ubuntuforum post, i comment a think with /bin/ directory... (if the file is in the SUDO "bin" directories they work (with $ programa) but if I add ./ --> $PATH or the absolut directory to $PATH the file appear but I have the same error: bash: ./programa: Permiso denegado

I'm desperate!! :(

Revision history for this message
Kees Cook (kees) said :
#7

Perhaps you are trying to run the program from a directory that is part of a mount that has "noexec" set? Try running:
  mount | grep $(df -hP . | tail -n1 | cut -d" " -f1)

If you see "noexec", that's the problem.

Revision history for this message
José Cabo (folcwine) said :
#8

These was the problem. I need to put "exec" property in mount command and.. works! :D!
Tnx to all ;)

PS: the problem seems to be in pysdm that not set "exec" property in the correspondent enabled option.