Command "df -hP" segmentation fault if path with non-utf8 characters is mounted

Solution Verified - Updated -

Issue

  • If system mounted NFS with non-utf8 characters in path (eg. gbk), df -P will segfault. For example, mounting a NFS with Chinese words in its mount path.
[root@df-debug ~]# mount 192.168.122.71:`echo "/vx/pub06/2008年9月"| iconv -f utf-8 -t gbk` /mnt/nfs/
[root@df-debug ~]# df -hP
Filesystem                          Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root        6.7G  1.1G  5.3G  17% /
tmpfs                               499M     0  499M   0% /dev/shm
/dev/sda1                           485M   33M  427M   8% /boot
Segmentation fault  <<-------
  • df -hP dumps a core like below:
Core was generated by `df -hP'.
Program terminated with signal 11, Segmentation fault.
#0  __strlen_sse2 () at ../sysdeps/x86_64/strlen.S:32
32      movdqu  (%rdi), %xmm1

Environment

  • Red Hat Enterprise Linux 6
  • coreutils-8.4-46.el6.x86_64

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content