Bug 1961056

Summary: [gssd] "pthread_t tid" print with format specifier "%x" but has type "unsigned long"
Product: Red Hat Enterprise Linux 8 Reporter: Yongcheng Yang <yoyang>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Yongcheng Yang <yoyang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.4CC: xzhou
Target Milestone: betaKeywords: Patch, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nfs-utils-2.3.3-44.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 19:40:03 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:

Description Yongcheng Yang 2021-05-17 06:15:30 UTC
Description of problem:
There is a new defect found by Covscan that the "unsigned long int" should be printed with format specifier "%lu" IMHO:

https://cov01.lab.eng.brq.redhat.com/covscanhub/waiving/60598/181036/#defects
---
1. nfs-utils-2.3.3/utils/gssd/gssd_proc.c:749: invalid_type: Argument "tid" to format specifier "%x" was expected to have type "unsigned int" but has type "unsigned long".
#   747|   	pthread_t tid = pthread_self();
#   748|   
#   749|-> 	printerr(2, "\n%s(0x%x): '%s' (%s)\n", __func__, tid, 
#   750|   		info->lbuf, clp->relpath);
#   751|   

 
Version-Release number of selected component (if applicable):
nfs-utils-2.3.3-40.el8

How reproducible:
always

Steps to Reproduce:
1.
2.
3.

Actual results:
[yoyang@yoyang-pc nfs-utils.git]$ grep pthread_t /usr/include/bits/pthreadtypes.h
typedef unsigned long int pthread_t;      <<<<<<<
[yoyang@yoyang-pc nfs-utils.git]$ grep -w tid vi utils/gssd/gssd_proc.c
grep: vi: No such file or directory
utils/gssd/gssd_proc.c: pthread_t tid = pthread_self();
utils/gssd/gssd_proc.c:         tid, lifetime_rec, acceptor->length, acceptor->value);
utils/gssd/gssd_proc.c: printerr(1, "do_downcall(0x%x): Failed to write downcall!\n", tid);
utils/gssd/gssd_proc.c: pthread_t tid = pthread_self();
utils/gssd/gssd_proc.c: printerr(2, "\n%s(0x%x): '%s' (%s)\n", __func__, tid,
[yoyang@yoyang-pc nfs-utils.git]$

Expected results:


Additional info:
May need an upstream fix also.

Comment 1 Steve Dickson 2021-07-10 15:36:59 UTC
commit b538862a5135f414d5455152c3ae8f5c2771a269 (tag: nfs-utils-2-5-4-rc7)
Author: Steve Dickson <steved>
Date:   Sat May 29 13:36:20 2021 -0400

    gssd: Cleaned up debug messages

Comment 4 Yongcheng Yang 2021-07-30 09:03:49 UTC
https://cov01.lab.eng.brq.redhat.com/covscanhub/waiving/76192/206103/fixed/#defects

This defect has been fixed now.

Comment 7 errata-xmlrpc 2021-11-09 19:40:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (nfs-utils bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4403