undefined reference to PROG on Gentoo (was: sigfd_init: Invalid argument) #239

Closed
rodbegbie opened this Issue Apr 24, 2012 · 15 comments

Comments

Projects
None yet
6 participants
@rodbegbie

Getting an error when trying to start mosh-server on my Gentoo linux box.

rod@hearty ~ $ mosh-server new -v

MOSH CONNECT 60001 4x7T8vUVt1kLXMUkGFTgwQ

mosh-server (mosh 1.1.97)
Copyright 2012 Keith Winstein <mosh-devel@mit.edu>
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

[mosh-server detached, pid = 5243]
rod@hearty ~ $ sigfd_init: Invalid argument

[mosh-server is exiting.]
@kmcallister

This comment has been minimized.

Show comment Hide comment
@kmcallister

kmcallister Apr 24, 2012

Contributor

Can you run

$ strace -e signalfd,signalfd4 -f mosh-server new -v

and show us any calls to signalfd or signalfd4?

Are you running an old Linux kernel (2.6.26 or earlier)? Those lack support for the flags argument to signalfd.

Contributor

kmcallister commented Apr 24, 2012

Can you run

$ strace -e signalfd,signalfd4 -f mosh-server new -v

and show us any calls to signalfd or signalfd4?

Are you running an old Linux kernel (2.6.26 or earlier)? Those lack support for the flags argument to signalfd.

@rodbegbie

This comment has been minimized.

Show comment Hide comment
@rodbegbie

rodbegbie Apr 24, 2012

Ah, the kernel version is the problem.

rod@flaming ~ $ uname -a
Linux flaming 2.6.18-128.7.1.el5xen #1 SMP Mon Aug 24 10:08:55 EDT 2009 i686 Intel(R) Xeon(R) CPU E5520 @ 2.27GHz GenuineIntel GNU/Linux

(I'm on a xen virtual host, so sadly kernel upgrades are outside of my control)

Will close this issue. Thanks.

Ah, the kernel version is the problem.

rod@flaming ~ $ uname -a
Linux flaming 2.6.18-128.7.1.el5xen #1 SMP Mon Aug 24 10:08:55 EDT 2009 i686 Intel(R) Xeon(R) CPU E5520 @ 2.27GHz GenuineIntel GNU/Linux

(I'm on a xen virtual host, so sadly kernel upgrades are outside of my control)

Will close this issue. Thanks.

@rodbegbie rodbegbie closed this Apr 24, 2012

@keithw

This comment has been minimized.

Show comment Hide comment
@keithw

keithw Apr 24, 2012

Owner

Yes, this happens when your glibc is new enough to have signalfd() but your kernel doesn't.

The fix is probably to run:

./configure ac_cv_have_decl_signalfd=no

Then edit config.h and comment out #define HAVE_PIPE2_CLOEXEC 1

Then run make as normal.

Owner

keithw commented Apr 24, 2012

Yes, this happens when your glibc is new enough to have signalfd() but your kernel doesn't.

The fix is probably to run:

./configure ac_cv_have_decl_signalfd=no

Then edit config.h and comment out #define HAVE_PIPE2_CLOEXEC 1

Then run make as normal.

@bfolkens

This comment has been minimized.

Show comment Hide comment
@bfolkens

bfolkens May 1, 2012

I tried commenting out those options above and had other issues. Any way to include an option to build this for 2.6.18? I have that installed on a bunch of machines.

bfolkens commented May 1, 2012

I tried commenting out those options above and had other issues. Any way to include an option to build this for 2.6.18? I have that installed on a bunch of machines.

@kmcallister

This comment has been minimized.

Show comment Hide comment
@kmcallister

kmcallister May 1, 2012

Contributor

other issues

Which?

Any way to include an option to build this for 2.6.18?

This problem occurs because we detect the presence of features in libc at compile time, and assume the kernel has the corresponding features at runtime. If you build and run on the same machine, it should work fine (unless that machine has a weird configuration).

I've built Mosh in a CentOS 5.8 VM with a 2.6.18 kernel. It should also work in an appropriate chroot, because we're testing header files and not the running kernel itself.

If you are building and running on the same machine, and still get this error, we can help you track it down.

Contributor

kmcallister commented May 1, 2012

other issues

Which?

Any way to include an option to build this for 2.6.18?

This problem occurs because we detect the presence of features in libc at compile time, and assume the kernel has the corresponding features at runtime. If you build and run on the same machine, it should work fine (unless that machine has a weird configuration).

I've built Mosh in a CentOS 5.8 VM with a 2.6.18 kernel. It should also work in an appropriate chroot, because we're testing header files and not the running kernel itself.

If you are building and running on the same machine, and still get this error, we can help you track it down.

@bfolkens

This comment has been minimized.

Show comment Hide comment
@bfolkens

bfolkens May 1, 2012

Thanks a lot for the help - here's some output... It's a Gentoo "machine" hosted on EC2, and I installed it form the net-misc/mosh-1.2 ebuild.

$ uname -a

Linux app1 2.6.18-xenU-ec2-v1.0 #2 SMP Tue Feb 19 10:51:53 EST 2008 i686 Intel(R) Xeon(R) CPU E5345 @ 2.33GHz GenuineIntel GNU/Linux
$ mosh-server new -v

MOSH CONNECT 60001 485FaayUSxuwRAkmQfxIeA

mosh-server (mosh 1.2)
Copyright 2012 Keith Winstein <mosh-devel@mit.edu>
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

[mosh-server detached, pid = 16260]
$ sigfd_init: Invalid argument

[mosh-server is exiting.]

bfolkens commented May 1, 2012

Thanks a lot for the help - here's some output... It's a Gentoo "machine" hosted on EC2, and I installed it form the net-misc/mosh-1.2 ebuild.

$ uname -a

Linux app1 2.6.18-xenU-ec2-v1.0 #2 SMP Tue Feb 19 10:51:53 EST 2008 i686 Intel(R) Xeon(R) CPU E5345 @ 2.33GHz GenuineIntel GNU/Linux
$ mosh-server new -v

MOSH CONNECT 60001 485FaayUSxuwRAkmQfxIeA

mosh-server (mosh 1.2)
Copyright 2012 Keith Winstein <mosh-devel@mit.edu>
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

[mosh-server detached, pid = 16260]
$ sigfd_init: Invalid argument

[mosh-server is exiting.]
@kmcallister

This comment has been minimized.

Show comment Hide comment
@kmcallister

kmcallister May 1, 2012

Contributor

Okay, I think the problem is that Gentoo's userspace assumes a newer kernel than you have.

What happened when you tried keithw's workaround?

Contributor

kmcallister commented May 1, 2012

Okay, I think the problem is that Gentoo's userspace assumes a newer kernel than you have.

What happened when you tried keithw's workaround?

@bfolkens

This comment has been minimized.

Show comment Hide comment
@bfolkens

bfolkens May 1, 2012

The resulting ./configure line (through the ebuild) is:

./configure --prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --with-skalibs=/ --with-skalibs-include=/usr/include/skalibs --with-skalibs-libdir=/usr/lib/skalibs --enable-client --enable-server --disable-examples --with-utempter ac_cv_have_decl_signalfd=no

Then the compile fails with the error:

/usr/lib/skalibs/libstddjb.so: undefined reference to `PROG'
collect2: ld returned 1 exit status
make[3]: *** [mosh-client] Error 1

bfolkens commented May 1, 2012

The resulting ./configure line (through the ebuild) is:

./configure --prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --with-skalibs=/ --with-skalibs-include=/usr/include/skalibs --with-skalibs-libdir=/usr/lib/skalibs --enable-client --enable-server --disable-examples --with-utempter ac_cv_have_decl_signalfd=no

Then the compile fails with the error:

/usr/lib/skalibs/libstddjb.so: undefined reference to `PROG'
collect2: ld returned 1 exit status
make[3]: *** [mosh-client] Error 1

kmcallister added a commit to kmcallister/mosh that referenced this issue May 1, 2012

Define PROG, for newer versions of skalibs
Needed to build from our source tarball on some Gentoo systems.

Closes #239.
@kmcallister

This comment has been minimized.

Show comment Hide comment
@kmcallister

kmcallister May 1, 2012

Contributor

This seems to be an incompatibility between Mosh and some versions of the skalibs library (newer than we'd tested previously). @bfolkens, can you try this patch on top of mosh-1.2? You can get a tarball here.

Contributor

kmcallister commented May 1, 2012

This seems to be an incompatibility between Mosh and some versions of the skalibs library (newer than we'd tested previously). @bfolkens, can you try this patch on top of mosh-1.2? You can get a tarball here.

@kmcallister kmcallister reopened this May 1, 2012

@bfolkens

This comment has been minimized.

Show comment Hide comment
@bfolkens

bfolkens May 2, 2012

Thanks - worked great! FWIW I was using the dev-libs/skalibs-1.2.7 ebuild of skalibs.

I can finally connect using mosh now ;)

(also created a sample ebuild with the fixes at: https://github.com/bfolkens/gentoo-bfolkens-layman/tree/master/net-misc/mosh in the 1.2-r1 ebuild)

bfolkens commented May 2, 2012

Thanks - worked great! FWIW I was using the dev-libs/skalibs-1.2.7 ebuild of skalibs.

I can finally connect using mosh now ;)

(also created a sample ebuild with the fixes at: https://github.com/bfolkens/gentoo-bfolkens-layman/tree/master/net-misc/mosh in the 1.2-r1 ebuild)

@kmcallister

This comment has been minimized.

Show comment Hide comment
@kmcallister

kmcallister May 2, 2012

Contributor

Cool, thanks for testing! We'll merge that patch and it should be in Mosh 1.3.

Happy moshing :)

Contributor

kmcallister commented May 2, 2012

Cool, thanks for testing! We'll merge that patch and it should be in Mosh 1.3.

Happy moshing :)

@xmw

This comment has been minimized.

Show comment Hide comment
@xmw

xmw May 2, 2012

wrt Gentoo, please take a look at my patches at http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-misc/mosh/files/

afaik this has nothing to do with skalib versions, just with static build (as shipped third does) and dynamic linked (as external does).

xmw commented May 2, 2012

wrt Gentoo, please take a look at my patches at http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-misc/mosh/files/

afaik this has nothing to do with skalib versions, just with static build (as shipped third does) and dynamic linked (as external does).

@xmw

This comment has been minimized.

Show comment Hide comment
@xmw

xmw May 2, 2012

ftr, i removed the the skalibs dep from the ebuild and the fatal skalib error from configure.ac

  • [AC_MSG_ERROR([Unable to find skalibs.])])
    
  • [AC_MSG_WARN([Unable to find skalibs.])])
    

xmw commented May 2, 2012

ftr, i removed the the skalibs dep from the ebuild and the fatal skalib error from configure.ac

  • [AC_MSG_ERROR([Unable to find skalibs.])])
    
  • [AC_MSG_WARN([Unable to find skalibs.])])
    
@kmcallister

This comment has been minimized.

Show comment Hide comment
@kmcallister

kmcallister May 2, 2012

Contributor

afaik this has nothing to do with skalib versions, just with static build (as shipped third does) and dynamic linked (as external does).

Oh, well, we only tested it with static build because that's all Debian's version of skalibs supports. :)

Contributor

kmcallister commented May 2, 2012

afaik this has nothing to do with skalib versions, just with static build (as shipped third does) and dynamic linked (as external does).

Oh, well, we only tested it with static build because that's all Debian's version of skalibs supports. :)

kmcallister added a commit to kmcallister/mosh that referenced this issue May 3, 2012

Define PROG, for newer versions of skalibs
Needed to build from our source tarball on some Gentoo systems.

Closes #239.
@nriley

This comment has been minimized.

Show comment Hide comment
@nriley

nriley May 13, 2012

Since it wasn't entirely clear from the above, a note: I was in the same position as @rodbegbie (old Xen kernel with newer userland) and @keithw's fix worked just fine.

nriley commented May 13, 2012

Since it wasn't entirely clear from the above, a note: I was in the same position as @rodbegbie (old Xen kernel with newer userland) and @keithw's fix worked just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment