Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1452032

Summary: when the /etc/hosts file has a line longer than 1028 characters getent ahostsv4 and ahostsv6 will stop working.
Product: Red Hat Enterprise Linux 6 Reporter: Raul Mahiques <rmahique>
Component: glibcAssignee: glibc team <glibc-bugzilla>
Status: CLOSED WONTFIX QA Contact: qe-baseos-tools-bugs
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.9CC: ashankar, brubisch, cww, fweimer, mnewsome, pfrankli, rmahique
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1452034 (view as bug list) Environment:
Last Closed: 2017-08-16 16:18:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1452034    
Bug Blocks:    

Description Raul Mahiques 2017-05-18 08:12:16 UTC
Description of problem:
when the /etc/hosts file has a line longer than 1028 characters getent ahostsv4 and ahostsv6 will stop working for hostsnames present in /etc/hosts.
This happens even if the line is a comment.

Version-Release number of selected component (if applicable):
Tested in RHEL 6.9 and RHEL 7.3
glibc-2.17-157
glibc-2.12-1

How reproducible:
Always




Steps to Reproduce:
With this oneliner you can see how it stops resolving after the line reaches 1028 characters, even if it's commented.
echo -n '#' >>/etc/hosts ; for i in $(seq 1 1030); do echo -n "$i - "; echo -n 'a' >>/etc/hosts ; getent ahostsv4 `hostname -f`; done


Actual results:
It stops working after 1028 characters.

Expected results:
It continues working and at least ignores the commented line

Additional info:

Comment 2 Florian Weimer 2017-05-18 08:20:10 UTC
(In reply to Raul Mahiques from comment #0)
> Version-Release number of selected component (if applicable):
> Tested in RHEL 6.9 and RHEL 7.3
> glibc-2.17-157
> glibc-2.12-1
> 
> How reproducible:
> Always

Please provide the exact glibc versions where you reproduced this.  Thanks.

Comment 3 Raul Mahiques 2017-05-18 08:39:26 UTC
I reproduced it on both versions.
note that the result of `hostname -f` must be present in /etc/hosts otherwise replace it with a hostname present in /etc/hosts.

Comment 4 Florian Weimer 2017-05-18 09:04:57 UTC
(In reply to Raul Mahiques from comment #3)
> I reproduced it on both versions.
> note that the result of `hostname -f` must be present in /etc/hosts
> otherwise replace it with a hostname present in /etc/hosts.

Please post the output of “rpm -q glibc” and attach the final contents of /etc/hosts and /etc/nsswitch.conf.  Thanks.

Comment 5 Raul Mahiques 2017-05-18 09:35:41 UTC
glibc-2.17-157.el7_3.1.x86_64


Final content
#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa



/etc/nsswitch.conf
hosts:      files dns myhostname

Comment 8 Florian Weimer 2017-05-18 15:52:20 UTC
Note: The use of `hostname -f` in the reproducer in comment #0 hides the presence of the issue in a default configuration.

Comment 11 Raul Mahiques 2017-05-29 08:37:54 UTC
(In reply to Florian Weimer from comment #8)
> Note: The use of `hostname -f` in the reproducer in comment #0 hides the
> presence of the issue in a default configuration.

it does not if you have the FQDN in your /etc/hosts file.