public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* After building 4.5 from trunk can't run firefox
@ 2009-12-24 11:11 Patrick Horgan
  2009-12-28 12:22 ` Ian Lance Taylor
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick Horgan @ 2009-12-24 11:11 UTC (permalink / raw)
  To: GCC-help

On Linux dell 2.6.31-17-generic #54-Ubuntu SMP Thu Dec 10 16:20:31 UTC 
2009 i686 GNU/Linux
gcc (GCC) 4.5.0 20091224 (experimental)
Mozilla Firefox 3.5.7pre, Copyright (c) 1998 - 2009 mozilla.org

After building gcc trunk, when I tried to run firefox the next time I 
got this error:

/usr/lib/firefox-3.5.7pre/firefox: error while loading shared libraries: 
libstdc++.so.6: failed to map segment from shared object: Permission denied

and from strace here's where the attempt to open fails:

open("/usr/local/lib/libstdc++.so.6", O_RDONLY) = 3
read(3, 
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\37\4\0004\0\0\0"..., 
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=4419480, ...}) = 0
mmap2(NULL, 939000, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 
0) = -1 EACCES (Permission denied)
close(3)                                = 0
writev(2, [{"/usr/lib/firefox-3.5.7pre/firefo"..., 33}, {": ", 2}, 
{"error while loading shared libra"..., 36}, {": ", 2}, 
{"libstdc++.so.6", 14}, {": ", 2}, {"failed to map segment from 
share"..., 40}, {": ", 2}, {"Permission denied", 17}, {"\n", 1}], 
10/usr/lib/firefox-3.5.7pre/firefox: error while loading shared 
libraries: libstdc++.so.6: failed to map segment from shared object: 
Permission denied
) = 149
exit_group(127)                         = ?`


if I remove /usr/local/lib/libstdc++*  the same error happens on libgcc 
(amusingly enough, Thunderbird wanted to correct libgcc to Liberace;).  
If I remove that as well, then firefox starts fine using system 
libraries.  I removed my build directory and did an update and a new 
configure into a build directory, and a make install.  Then firefox 
failed to run just the same way.

Anyone have any ideas?  The man page for mmap2 says that EACCES implies:

       EACCES A file descriptor refers to a non-regular file.  Or  
MAP_PRIVATE
              was  requested,  but  fd is not open for reading.  Or 
MAP_SHARED
              was requested and PROT_WRITE is set,  but  fd  is  not  
open  in
              read/write (O_RDWR) mode.  Or PROT_WRITE is set, but the 
file is
              append-only.

The file descriptor is open for reading as you see above, MAP_SHARED was 
not requested, and PROT_WRITE is not set, which implies a problem with 
the file itself.

Patrick

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: After building 4.5 from trunk can't run firefox
  2009-12-24 11:11 After building 4.5 from trunk can't run firefox Patrick Horgan
@ 2009-12-28 12:22 ` Ian Lance Taylor
  2009-12-31 16:04   ` Patrick Horgan
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Lance Taylor @ 2009-12-28 12:22 UTC (permalink / raw)
  To: phorgan1; +Cc: GCC-help

Patrick Horgan <phorgan1@yahoo.com> writes:

> On Linux dell 2.6.31-17-generic #54-Ubuntu SMP Thu Dec 10 16:20:31 UTC
> 2009 i686 GNU/Linux
> gcc (GCC) 4.5.0 20091224 (experimental)
> Mozilla Firefox 3.5.7pre, Copyright (c) 1998 - 2009 mozilla.org
>
> After building gcc trunk, when I tried to run firefox the next time I
> got this error:
>
> /usr/lib/firefox-3.5.7pre/firefox: error while loading shared
> libraries: libstdc++.so.6: failed to map segment from shared object:
> Permission denied

I see that this is being somehow caused by using a new version of gcc,
but I have no idea what could be causing it.  gcc creates the shared
libraries in the usual way, and an ordinary shared library should not
fail with an EACCES error.  I have no idea what could cause that.

You may get farther if you ask people familiar with GNU/Linux or with
the dynamic linker, which on Debian is part of glibc or eglibc.

Ian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: After building 4.5 from trunk can't run firefox
  2009-12-28 12:22 ` Ian Lance Taylor
@ 2009-12-31 16:04   ` Patrick Horgan
  0 siblings, 0 replies; 3+ messages in thread
From: Patrick Horgan @ 2009-12-31 16:04 UTC (permalink / raw)
  Cc: GCC-help

Ian Lance Taylor wrote:
> Patrick Horgan <phorgan1@yahoo.com> writes:
>
>   
>> On Linux dell 2.6.31-17-generic #54-Ubuntu SMP Thu Dec 10 16:20:31 UTC
>> 2009 i686 GNU/Linux
>> gcc (GCC) 4.5.0 20091224 (experimental)
>> Mozilla Firefox 3.5.7pre, Copyright (c) 1998 - 2009 mozilla.org
>>
>> After building gcc trunk, when I tried to run firefox the next time I
>> got this error:
>>
>> /usr/lib/firefox-3.5.7pre/firefox: error while loading shared
>> libraries: libstdc++.so.6: failed to map segment from shared object:
>> Permission denied
>>     
>
> I see that this is being somehow caused by using a new version of gcc,
> but I have no idea what could be causing it. 
Turns out it had nothing to do with gcc.  On ubuntu apparmor is set up 
by default to not allow firefox access to /usr/local/lib/*.  To fix it I 
had to add a line to /etc/apparmor.d with the content /usr/local/lib/** 
rm, then do /etc/init.d/apparmor restart, as root or with sudo of 
course.  I'm only posting it here because someone might search and find 
the thread, so I thought I should close it.  Sorry for the noise.

Patrick

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-31 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-24 11:11 After building 4.5 from trunk can't run firefox Patrick Horgan
2009-12-28 12:22 ` Ian Lance Taylor
2009-12-31 16:04   ` Patrick Horgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).