Searched the bugs database. Didn't see bug reports that were obviously quite like this. Looked for updates to RPM and didn't see any listed under Red Hat Linux 7.0 With RPM 4.0 in a non-updated, stock installation running on a consumer P100, the following command: rpm -qp "${package}" --queryformat '[%{DIRINDEXES}\t%{DIRNAMES}\n]\n' causes the following error message to be printed: Segmentation fault (core dumped) while this command does not: rpm -qp "${package}" --queryformat '[%{DIRNAMES}\t%{DIRINDEXES}\n]\n' and neither does this: rpm -qp "${package}" --queryformat '[%{DIRINDEXES}\n]\n'
What's happening is that the '[' array iterator expects tags for identically sized arrays, that's not the case with DIRINDEXES (no. of files) and DIRNAMES (no of dirs). The fix is going to be to detect different sized arrays and print an error.
Fixed in rpm-4.2-0.49