New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ext/POSIX/t/wrappers.t fails when compiling on OpenLDAP user because of getgrgid() + fork() interaction #13779
Comments
From lvaliukas@cyber.law.harvard.eduCreated by lvaliukas@cyber.law.harvard.eduWhen compiling Perl-blead with Perlbrew, the ext/POSIX/t/wrappers.t unit test fails with: ext/POSIX/t/wrappers .......................................... # Failed test 'getc' I suspect that the unit test doesn't pass because fork() silently fails right after the getgrgid() call. For example, when running this script: use strict; my $pid = fork(); fail("fork failed: $!") unless defined $pid; if ($pid) { The *expected* output is: group id: 10018 113 10018 But the *actual* output I get with Perl-blead is: group id: 10018 113 10018 I should also note that we're building Perl on an OpenLDAP user, and that the sample script (or the unit test) doesn't fail on a "normal" user (the one from /etc/passwd). Also, Perl v5.16.3 provides the *expected* output for the test script listed above. I would be very thankful if you could provide me with any tips and hints on how I could debug / help you to fix this issue. Perl Info
|
From @eserteDana Pon 28. Tra 2014, 09:24:40, lvaliukas@cyber.law.harvard.edu reče:
I also saw this problem in an environment where LDAP for user authentication is in use. My current workaround is: if ($] >= 5.018) { The problem does not appear with perl 5.16.3 on the same system. Regards, |
The RT System itself - Status changed from 'new' to 'open' |
From lvaliukas@cyber.law.harvard.eduOn Fri May 02 07:01:31 2014, slaven@rezic.de wrote:
Thanks Slaven! It's good to see that we're not the only ones who encounter this bug! The workaround would probably do fine in our own code (at least temporary), but I'm worried that dependency CPAN modules (which we do not control) might be using getgrgid() themselves and potentially crashing Perl / introducing security issues to the rest of the system. Would you be able to comment on your OpenLDAP infrastructure? In other words, have you found a way to replicate a bug on a "clean" system? |
From @eserteDana Pet 02. Svibanj 2014, 11:22:19, lvaliukas@cyber.law.harvard.edu reče:
I am just a user in a company LDAP setup. Actually I wasn't aware that LDAP was in use, until I stumbled over this problem and tried to find out what's going on using strace. I found out that some Linux component was opening the LDAP connection when the perl process was calling getpwuid(). After a fork() strange things happen to the (also forked) LDAP connection, leading to a SIGPIPE and the child being killed. This smells like a bug in the LDAP implementation. But nevertheless it would be a good thing if it could be workaround in the Perl interpreter. Regards, |
From @LeontOn Fri, May 2, 2014 at 11:34 PM, slaven@rezic.de via RT <
Indeed it does. I'm guessing the a shutdown(2) is involved. This is a Swapping libnss-ldap/libnss-ldapd might help (but may not be an option in Leon |
From bitcard@larochelle.nameAccording to The Open Group Specification getpwuid() is not thread safe. ( See http://pubs.opengroup.org/onlinepubs/009695399/functions/getpwuid.html). I realize the fork()ing is very different from threads but I wonder if getpwuid_r(), the thread-safe version of getpwuid() should be used instead. On Fri May 02 14:34:40 2014, slaven@rezic.de wrote:
|
From @LeontOn Mon, May 5, 2014 at 11:57 PM, dlarochelle via RT <
The reentrant APIs are already used on threaded perls (in a rather Leon |
From @lizmatOn 06 May 2014, at 12:09, Leon Timmermans <fawaka@gmail.com> wrote:
Still, some XS might want to do threads on a non-threaded perl: for those cases it would make sense to also use the re-entrant versions. And are we talking about hot paths here? Liz |
From @LeontOn Tue, May 6, 2014 at 12:46 PM, Elizabeth Mattijsen <liz@dijkmat.nl> wrote:
Agreed. It can be enabled on non-threaded perls with the -Dusereentrant Leon |
From lvaliukas@cyber.law.harvard.eduOn Tue May 06 05:16:26 2014, LeonT wrote:
I've recompiled Perl-blead with "-Dusereentrant", but the bug is still present. |
From @LeontOn Tue, May 13, 2014 at 5:39 PM, Linas Valiukas via RT <
We were getting side-tracked, of course that didn't fix it. Everything Leon |
Migrated from rt.perl.org#121755 (status was 'open')
Searchable as RT121755$
The text was updated successfully, but these errors were encountered: