double-clicking on an executable created with gcc6 opens an error message

Bug #1635376 reported by Hadrien
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Nautilus
Unknown
Medium
nautilus (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Ubuntu 16.10 x64 with Nautilus 3.20.3

* Open a terminal
* Install gcc: sudo apt install build-essential
* Build an executable: printf "int main() { return 1; }" | gcc -x c -
* Open a Nautilus window on the current directory: nautilus .
* Double-click on the generated executable: a.out

Expected result: Nautilus starts the executable. No error is displayed.
Actual result: Nautilus displays an error message:

   Could not display "a.out".
   There is no application installed for shared library files.
   Do you want to search for an application to open this file?

Also, all executable files compiled with gcc6 have a generic icon instead of the purple lozenge.

Hadrien (psydk)
description: updated
Revision history for this message
Hadrien (psydk) wrote :
description: updated
Revision history for this message
Khurshid Alam (khurshid-alam) wrote :

Does a.out have execution permission? What is the expected result? Open terminal and show output of a.out?

Hadrien (psydk)
description: updated
description: updated
Revision history for this message
Hadrien (psydk) wrote :

@Khurshid Alam:
 - a.out has execution permission
 - the expected result is: no error message (I updated the bug description)

Obviously the a.out does nothing. I gave the most minimal way to reproduce the problem. I could put an example of a program that opens a window I you think it would make the bug easier to understand.

I have several projects I built recently since I installed Ubuntu 16.10 and they all gave me executables I cannot launch from Nautilus. There is no problem when I launch them from a terminal.

Revision history for this message
Hadrien (psydk) wrote :

I did a test. I built the same program with gcc5 and gcc6, then I compared the output of "readelf -a". It happens that Nautilus is right. gcc on Ubuntu 16.10 creates a shared library by default instead of an executable (the Type field in the ELF header is different).

Revision history for this message
Hadrien (psydk) wrote :
Revision history for this message
Hadrien (psydk) wrote :

Executables are now linked with the -pie option, which lead to a file type that is nearly indistinguishable from a shared library. I learned that this is an expected consequence.

The only difference is the presence of an 'interpreter' for executable files, but nothing forbids a .so to have an 'interpreter' too (for example the libc.so on my system has one):

$ file plop.so:
plop.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked

$ file plop.ex:
plop.ex: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32

In conclusion we should look into Nautilus to solve the issue (I closed the bug for gcc).

Revision history for this message
Hadrien (psydk) wrote :
Changed in nautilus (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Trent Gamblin (goobliata) wrote :

Have the same issue FWIW. Even many apps that ship with Ubuntu can't be clicked anymore. If nothing else perhaps keying of 'interpreter' would be more reasonable as none of the shared libraries I've checked have one.

Changed in nautilus:
importance: Unknown → Medium
status: Unknown → Confirmed
Changed in nautilus:
status: Confirmed → Unknown
Revision history for this message
erio (eri0) wrote :

This is still present in Nautilus on Ubuntu 18.04.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.