Re: [kde-freebsd] after compiling x11/kde4 problems with /usr/local/bin/startkde (SOLVED)

View: New views
9 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: [kde-freebsd] after compiling x11/kde4 problems with /usr/local/bin/startkde (SOLVED)

by Matthias Apitz-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

El día Friday, October 30, 2009 a las 04:17:55PM +0100, Matthias Apitz escribió:

>
> Hello,
>
> I have in a VM a 9-CURRENT and compiled/installed from the ports first
> x11/kde3 (which worked fine) and now in addition x11/kde4 (which comes
> up also fine).
>
> But,
>
> A start of KDE3 from ~/.xinitrc via exec /usr/local/bin/startkde
> complains in the following code:
>
> # We set LD_BIND_NOW to increase the efficiency of kdeinit.
> # kdeinit unsets this variable before loading applications.
> LD_BIND_NOW=true start_kdeinit_wrapper --new-startup +kcminit_startup
> if test $? -ne 0; then
>   # Startup error
>   echo 'startkde: Could not start kdeinit. Check your installation.' 1>&2
>   xmessage -geometry 500x100 "Could not start kdeinit. Check your installation."
> fi
>
> i.e. it brings up this xmessage box and in the log files I can see that
> 'start_kdeinit_wrapper' SIGABORT's. The KDE desktop itself comes up
> fine. This is, as I said, after compiling the port x11/kde4. The file
> /usr/local/bin/start_kdeinit_wrapper is not touched by the port x11/kde4
> and neither the shared libs it is depending:
>
> $ ldd /usr/local/bin/start_kdeinit_wrapper
> /usr/local/bin/start_kdeinit_wrapper:
>         libjpeg.so.10 => /usr/local/lib/libjpeg.so.10 (0x2808e000)
>         libc.so.7 => /lib/libc.so.7 (0x280c2000)
>
> What could cause this behaviour? Thanks

+Cc: freebsd-current

I digged into that deeper with the sources...
start_kdeinit_wrapper -> start_kdeinit -> kdeinit
is (on non-Linux) just an execvp(2) chain of the above three programs; on
FreeBSD it would not even be necessary because non of them runs with
setuid on execution.

As mentioned, the three programs
/usr/local/bin/start_kdeinit_wrapper
/usr/local/bin/start_kdeinit
/usr/local/bin/kdeinit
have been compiled on -CURRENT r197801 and have been untouched and
working since October, 16. On October 30, I compiled in addition the
port x11/kde4, which does not touch the above programs and also not the
shared libs used by them;

after the installation of x11/kde4 the start_kdeinit_wrapper now aborts:

$ /usr/local/bin/start_kdeinit_wrapper
Abort trap: 6

it does not abort when you set

# sysctl security.bsd.map_at_zero=1
security.bsd.map_at_zero: 0 -> 1

I think that security.bsd.map_at_zero was already 0 before compiling
x11/kde4, i.e. no part of KDE4 changed this sysctl value; so it remains
open, what caused this effect, but at least it is working again;

Thx

        matthias

--
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e <guru@...> - w http://www.unixarea.de/
Vote NO to EU The Lisbon Treaty: http://www.no-means-no.eu
_______________________________________________
freebsd-current@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@..."

Re: [kde-freebsd] after compiling x11/kde4 problems with /usr/local/bin/startkde (SOLVED)

by Robert Watson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sun, 1 Nov 2009, Matthias Apitz wrote:

>> i.e. it brings up this xmessage box and in the log files I can see that
>> 'start_kdeinit_wrapper' SIGABORT's. The KDE desktop itself comes up fine.
>> This is, as I said, after compiling the port x11/kde4. The file
>> /usr/local/bin/start_kdeinit_wrapper is not touched by the port x11/kde4
>> and neither the shared libs it is depending:
>>
>> $ ldd /usr/local/bin/start_kdeinit_wrapper
>> /usr/local/bin/start_kdeinit_wrapper:
>>         libjpeg.so.10 => /usr/local/lib/libjpeg.so.10 (0x2808e000)
>>         libc.so.7 => /lib/libc.so.7 (0x280c2000)

Could you show us readelf -l /usr/local/bin/start_kdeinit_wrapper

> it does not abort when you set
>
> # sysctl security.bsd.map_at_zero=1
> security.bsd.map_at_zero: 0 -> 1
>
> I think that security.bsd.map_at_zero was already 0 before compiling
> x11/kde4, i.e. no part of KDE4 changed this sysctl value; so it remains
> open, what caused this effect, but at least it is working again;

Could you confirm you are running with a userspace/kernel of at least r198203
(the date of the last PIE-related fix following a move to disallowing NULL
mappings).

Robert
_______________________________________________
freebsd-current@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@..."

Re: [kde-freebsd] after compiling x11/kde4 problems with /usr/local/bin/startkde (SOLVED)

by Matthias Apitz-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

El día Sunday, November 01, 2009 a las 10:32:24AM +0000, Robert Watson escribió:

>
> On Sun, 1 Nov 2009, Matthias Apitz wrote:
>
> >>i.e. it brings up this xmessage box and in the log files I can see that
> >>'start_kdeinit_wrapper' SIGABORT's. The KDE desktop itself comes up fine.
> >>This is, as I said, after compiling the port x11/kde4. The file
> >>/usr/local/bin/start_kdeinit_wrapper is not touched by the port x11/kde4
> >>and neither the shared libs it is depending:
> >>
> >>$ ldd /usr/local/bin/start_kdeinit_wrapper
> >>/usr/local/bin/start_kdeinit_wrapper:
> >>        libjpeg.so.10 => /usr/local/lib/libjpeg.so.10 (0x2808e000)
> >>        libc.so.7 => /lib/libc.so.7 (0x280c2000)
>
> Could you show us readelf -l /usr/local/bin/start_kdeinit_wrapper

Here we go:

$ readelf -l /usr/local/bin/start_kdeinit_wrapper

Elf file type is EXEC (Executable file)
Entry point 0x8048480
There are 6 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  PHDR           0x000034 0x08048034 0x08048034 0x000c0 0x000c0 R E 0x4
  INTERP         0x0000f4 0x080480f4 0x080480f4 0x00015 0x00015 R   0x1
      [Requesting program interpreter: /libexec/ld-elf.so.1]
  LOAD           0x000000 0x08048000 0x08048000 0x006a8 0x006a8 R E 0x1000
  LOAD           0x0006a8 0x080496a8 0x080496a8 0x00104 0x0010c RW 0x1000
  DYNAMIC        0x0006b8 0x080496b8 0x080496b8 0x000c0 0x000c0 RW  0x4
  NOTE           0x00010c 0x0804810c 0x0804810c 0x00018 0x00018 R   0x4

 Section to Segment mapping:
  Segment Sections...
   00    
   01     .interp
   02     .interp .note.ABI-tag .hash .dynsym .dynstr .gnu.version .gnu.version_ r .rel.plt .init .plt .text .fini .rodata
   03     .data .eh_frame .dynamic .ctors .dtors .jcr .got .bss
   04     .dynamic
   05     .note.ABI-tag

> >it does not abort when you set
> >
> ># sysctl security.bsd.map_at_zero=1
> >security.bsd.map_at_zero: 0 -> 1
> >
> >I think that security.bsd.map_at_zero was already 0 before compiling
> >x11/kde4, i.e. no part of KDE4 changed this sysctl value; so it remains
> >open, what caused this effect, but at least it is working again;
>
> Could you confirm you are running with a userspace/kernel of at least
> r198203 (the date of the last PIE-related fix following a move to
> disallowing NULL mappings).

NAK, userland and kernel is:

$ uname -a
FreeBSD vm-azul.Sisis.de 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r197801: Mon Oct 12 13:33:32 CEST 2009
guru@...:/usr/obj/usr/src/sys/GENERIC  i386

Thx

        matthias
--
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e <guru@...> - w http://www.unixarea.de/
Vote NO to EU The Lisbon Treaty: http://www.no-means-no.eu
_______________________________________________
freebsd-current@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@..."

Re: [kde-freebsd] after compiling x11/kde4 problems with /usr/local/bin/startkde (SOLVED)

by Robert Watson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sun, 1 Nov 2009, Matthias Apitz wrote:

>> Could you confirm you are running with a userspace/kernel of at least
>> r198203 (the date of the last PIE-related fix following a move to
>> disallowing NULL mappings).
>
> NAK, userland and kernel is:
>
> $ uname -a FreeBSD vm-azul.Sisis.de 9.0-CURRENT FreeBSD 9.0-CURRENT #0
> r197801: Mon Oct 12 13:33:32 CEST 2009
> guru@...:/usr/obj/usr/src/sys/GENERIC i386

Sounds like an upgrade should fix this -- if not, please let us know ASAP as
it might be an issue for 8.0 as well.

Robert
_______________________________________________
freebsd-current@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@..."

Re: [kde-freebsd] after compiling x11/kde4 problems with /usr/local/bin/startkde (SOLVED)

by Matthias Apitz-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

El día Sunday, November 01, 2009 a las 10:45:41AM +0000, Robert Watson escribió:

>
> On Sun, 1 Nov 2009, Matthias Apitz wrote:
>
> >>Could you confirm you are running with a userspace/kernel of at least
> >>r198203 (the date of the last PIE-related fix following a move to
> >>disallowing NULL mappings).
> >
> >NAK, userland and kernel is:
> >
> >$ uname -a FreeBSD vm-azul.Sisis.de 9.0-CURRENT FreeBSD 9.0-CURRENT #0
> >r197801: Mon Oct 12 13:33:32 CEST 2009
> >guru@...:/usr/obj/usr/src/sys/GENERIC i386
>
> Sounds like an upgrade should fix this -- if not, please let us know ASAP
> as it might be an issue for 8.0 as well.

Robert, do you have an idea why this (with the same kernel/userland)
only shows up after installing the port x11/kde4?

        matthias
--
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e <guru@...> - w http://www.unixarea.de/
Vote NO to EU The Lisbon Treaty: http://www.no-means-no.eu
_______________________________________________
freebsd-current@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@..."

Re: [kde-freebsd] after compiling x11/kde4 problems with /usr/local/bin/startkde (SOLVED)

by Kostik Belousov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Nov 01, 2009 at 02:08:20PM +0100, Matthias Apitz wrote:

> El d?a Sunday, November 01, 2009 a las 10:45:41AM +0000, Robert Watson escribi?:
>
> >
> > On Sun, 1 Nov 2009, Matthias Apitz wrote:
> >
> > >>Could you confirm you are running with a userspace/kernel of at least
> > >>r198203 (the date of the last PIE-related fix following a move to
> > >>disallowing NULL mappings).
> > >
> > >NAK, userland and kernel is:
> > >
> > >$ uname -a FreeBSD vm-azul.Sisis.de 9.0-CURRENT FreeBSD 9.0-CURRENT #0
> > >r197801: Mon Oct 12 13:33:32 CEST 2009
> > >guru@...:/usr/obj/usr/src/sys/GENERIC i386
> >
> > Sounds like an upgrade should fix this -- if not, please let us know ASAP
> > as it might be an issue for 8.0 as well.
>
> Robert, do you have an idea why this (with the same kernel/userland)
> only shows up after installing the port x11/kde4?
The only way to understand what happen there is to ktrace the whole
process tree, and then look up execve(2) of which binary causes
SIGABRT.


attachment0 (203 bytes) Download Attachment

Re: [kde-freebsd] after compiling x11/kde4 problems with /usr/local/bin/startkde (SOLVED)

by Robert Watson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 1 Nov 2009, at 13:08, Matthias Apitz wrote:

>>> $ uname -a FreeBSD vm-azul.Sisis.de 9.0-CURRENT FreeBSD 9.0-
>>> CURRENT #0
>>> r197801: Mon Oct 12 13:33:32 CEST 2009
>>> guru@...:/usr/obj/usr/src/sys/GENERIC i386
>>
>> Sounds like an upgrade should fix this -- if not, please let us  
>> know ASAP
>> as it might be an issue for 8.0 as well.
>
> Robert, do you have an idea why this (with the same kernel/userland)
> only shows up after installing the port x11/kde4?

KDE uses some pre-linking techniques to reduce startup time for  
applications; I'm not sure what the current version of the code does  
exactly, but it wouldn't surprise me if it involves PIE executables,  
which were known to have problems with our null-mapping prevention  
until recent bug fixes to rtld. If the problem goes away with an  
upgrade to a new userspace/kernel, I wouldn't worry too much about it.  
We added the null-mapping prevention a few weeks ago, and later  
discovered it interacted badly with bugs in our handling of PIE in-
kernel and in rtld. Most likely (if the problem goes away with an  
upgrade), you just ended up with a bad combination of the two that was  
resolved.

Robert
_______________________________________________
freebsd-current@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@..."

Re: [kde-freebsd] after compiling x11/kde4 problems with /usr/local/bin/startkde (SOLVED)

by Matthias Apitz-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

El día Sunday, November 01, 2009 a las 10:45:41AM +0000, Robert Watson escribió:

>
> On Sun, 1 Nov 2009, Matthias Apitz wrote:
>
> >>Could you confirm you are running with a userspace/kernel of at least
> >>r198203 (the date of the last PIE-related fix following a move to
> >>disallowing NULL mappings).
> >
> >NAK, userland and kernel is:
> >
> >$ uname -a FreeBSD vm-azul.Sisis.de 9.0-CURRENT FreeBSD 9.0-CURRENT #0
> >r197801: Mon Oct 12 13:33:32 CEST 2009
> >guru@...:/usr/obj/usr/src/sys/GENERIC i386
>
> Sounds like an upgrade should fix this -- if not, please let us know ASAP
> as it might be an issue for 8.0 as well.

Would this require as well to re-compile all my ~1200 ports or are there
no changes in the ABI since r197801?

        matthias
--
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e <guru@...> - w http://www.unixarea.de/
Vote NO to EU The Lisbon Treaty: http://www.no-means-no.eu
_______________________________________________
freebsd-current@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@..."

Re: [kde-freebsd] after compiling x11/kde4 problems with /usr/local/bin/startkde (SOLVED)

by Robert Watson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 2 Nov 2009, at 10:06, Matthias Apitz wrote:

> El día Sunday, November 01, 2009 a las 10:45:41AM +0000, Robert  
> Watson escribió:
>
>>
>> On Sun, 1 Nov 2009, Matthias Apitz wrote:
>>
>>>> Could you confirm you are running with a userspace/kernel of at  
>>>> least
>>>> r198203 (the date of the last PIE-related fix following a move to
>>>> disallowing NULL mappings).
>>>
>>> NAK, userland and kernel is:
>>>
>>> $ uname -a FreeBSD vm-azul.Sisis.de 9.0-CURRENT FreeBSD 9.0-
>>> CURRENT #0
>>> r197801: Mon Oct 12 13:33:32 CEST 2009
>>> guru@...:/usr/obj/usr/src/sys/GENERIC i386
>>
>> Sounds like an upgrade should fix this -- if not, please let us  
>> know ASAP
>> as it might be an issue for 8.0 as well.
>
> Would this require as well to re-compile all my ~1200 ports or are  
> there
> no changes in the ABI since r197801?

I'm not aware of ABI changes, but that's always a risk when updating  
on the -CURRENT branch. Another approach would be to extract the  
relevant changes and apply them to your current source tree, but there  
are a fair number and you wouldn't want to miss any. I believe they're  
all to either the kernel or rtld.

Robert_______________________________________________
freebsd-current@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@..."