Skip to contentSkip to conversation

New: monit doesn't start with glibc 2.19 because geteuid() fails

Buildroot bugzilla at busybox.net 1 participant 14 messages Sep 3, 2014 – Sep 6, 2014

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=7364

Summary: monit doesn't start with glibc 2.19 because geteuid()
fails
Product: buildroot
Version: 2014.08
Platform: PC
OS/Version: Linux
Status: NEW
Severity: minor
Priority: P5
Component: Other
AssignedTo: unassigned at buildroot.uclibc.org
ReportedBy: syntheticpp at gmx.net
CC: buildroot at uclibc.org
Estimated Hours: 0.0

monit exits in src/env.c:

struct passwd *pw;

  /* Get password struct */
  if ( ! (pw= getpwuid(geteuid())) ) {
    LogError("%s: You don't exist. Go away.\n", prog);
    exit(1);
  }

Only happens with glibc and eglibc 2.19 (tested with GCC 4.9.1), 2.18 is fine.

GCC warns while linking:
y.tab.c:(.text+0x379c): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

Somehow libnss related?

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#1 lore raw

[Buildroot] [Bug 7364] monit doesn't start with glibc 2.19 because geteuid() fails

https://bugs.busybox.net/show_bug.cgi?id=7364

--- Comment #1 from syntheticpp at gmx.net 2014-09-03 18:02:48 UTC --- Logging in via ssh is delayed, looks like it runs into a timeout. (strace shows that a select() on the client IP is paused)

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#2 lore raw

[Buildroot] [Bug 7364] monit doesn't start with glibc 2.19 because geteuid() fails

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7364

Yann E. MORIN <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |yann.morin.1998 at free.fr

--- Comment #2 from Yann E. MORIN <[email protected]> 2014-09-03 18:57:16 UTC --- Normally, static linking with glibc is not possible, just because of
this issue: all that has to deal with names (usernames, groups, hostnames...) need dynamic linking, becasue glibc uses libnss, which dlopen()s the backend libraries, such as libnss_files.so.

How did you manage to have a statically-linked monit when using a glibc toolchain? Care to share your .config, please?

Regards,
Yann E. MORIN.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#3 lore raw

[Buildroot] [Bug 7364] monit doesn't start with glibc 2.19 because geteuid() fails

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7364

--- Comment #3 from syntheticpp at gmx.net 2014-09-04 12:22:51 UTC ---

Quoted 4 lines

How did you manage to have a statically-linked monit when using a glibc toolchain? Care to share your .config, please?

It's the configuration of 2014.08 no changes by me.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#4 lore raw

[Buildroot] [Bug 7364] monit doesn't start with glibc 2.19 because geteuid() fails

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7364

--- Comment #4 from syntheticpp at gmx.net 2014-09-04 12:27:59 UTC ---

Quoted 5 lines

GCC warns while linking:
y.tab.c:(.text+0x379c): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

This warning also shows up in the build which works (eglibc 2.18)

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#5 lore raw

[Buildroot] [Bug 7364] monit doesn't start with glibc 2.19 because geteuid() fails

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7364

--- Comment #5 from Yann E. MORIN <[email protected]> 2014-09-04 15:52:07 UTC ---

Quoted 1 line

It's the configuration of 2014.08 no changes by me.

Sorry, this does not make sense:
- there is no default configuration in Buildroot;
- the default C library is uClibc, not glibc/eglibc.

So, yes, you did some configuration.
Please provide your .config file.

Regards,
Yann E. MORIN.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#6 lore raw

[Buildroot] [Bug 7364] monit doesn't start with glibc 2.19 because geteuid() fails

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7364

--- Comment #6 from syntheticpp at gmx.net 2014-09-05 08:43:42 UTC --- Created attachment 5588
--> https://bugs.busybox.net/attachment.cgi?id=5588
defconfig

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#7 lore raw

[Buildroot] [Bug 7364] monit doesn't start with glibc 2.19 because geteuid() fails

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7364

--- Comment #7 from syntheticpp at gmx.net 2014-09-05 08:44:35 UTC --- Created attachment 5594
--> https://bugs.busybox.net/attachment.cgi?id=5594
generated .config

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#8 lore raw

[Buildroot] [Bug 7364] monit doesn't start with glibc 2.19 because geteuid() fails

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7364

--- Comment #8 from Yann E. MORIN <[email protected]> 2014-09-05 10:26:22 UTC --- Indeed, the build warns about the use os the NSS functions in statically linked applications.

However, this is only a warning, and not a build failure.

monit should not build a static application to start with. Changing the subject to reflect the real issue.

Regards,
Yann E. MORIN.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#9 lore raw

[Buildroot] [Bug 7364] monit builds a static application, even though BR2_PREFER_STATIC_LIB is not set, and with glibc.

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7364

Yann E. MORIN <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

            Summary|monit doesn't start with    |monit builds a static
                   |glibc 2.19 because          |application, even though
                   |geteuid() fails             |BR2_PREFER_STATIC_LIB is
                   |                            |not set, and with glibc.
Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#10 lore raw

[Buildroot] [Bug 7364] monit builds a static application, even though BR2_PREFER_STATIC_LIB is not set, and with glibc.

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7364

--- Comment #9 from Yann E. MORIN <[email protected]> 2014-09-05 10:30:26 UTC --- When the C library is glibc/eglibc, we copy those files to the target:

    LIB_EXTERNAL_LIBS+=libnss_files.so.* libnss_dns.so.*

Can you confirm those files are present in your target?

Regarding the delay to login: what is your authentication method? Maybe there are a few other libnss files tht should be copied over...

Regards,
Yann E. MORIN.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#11 lore raw

[Buildroot] [Bug 7364] monit builds a static application, even though BR2_PREFER_STATIC_LIB is not set, and with glibc.

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7364

--- Comment #10 from Yann E. MORIN <[email protected]> 2014-09-05 11:18:45 UTC --- I have a patch I'm currently testing...

Regards,
Yann E. MORIN.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#12 lore raw

[Buildroot] [Bug 7364] monit builds a static application, even though BR2_PREFER_STATIC_LIB is not set, and with glibc.

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7364

--- Comment #11 from syntheticpp at gmx.net 2014-09-05 12:38:10 UTC --- (In reply to comment #9)

Quoted 4 lines

When the C library is glibc/eglibc, we copy those files to the target:

    LIB_EXTERNAL_LIBS+=libnss_files.so.* libnss_dns.so.*

Can you confirm those files are present in your target?

Yes, they are.

Quoted 3 lines

Regarding the delay to login: what is your authentication method? Maybe there are a few other libnss files tht should be copied over...

In meantime I saw it also with the other build, so not related to this bug here.

Quoted 3 lines

Regards,
Yann E. MORIN.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#13 lore raw

[Buildroot] [Bug 7364] monit builds a static application, even though BR2_PREFER_STATIC_LIB is not set, and with glibc.

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7364

Yann E. MORIN <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #12 from Yann E. MORIN <[email protected]> 2014-09-06 21:48:40 UTC --- Hello!

We believe this isuue has now been fixed with this changeset:

http://git.buildroot.org/buildroot/commit/?id=03f388619a4dfa2835774702a54504b56e2e00e0

I'm closing the issue now. If you believe this does not fix your problem, be sure to re-open this issue for further investigations.

Thank you for the report! :-)

Regards,
Yann E. MORIN.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.