This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients koobs, vstinner
Date 2017-07-27.14:07:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1501164456.41.0.517654066354.issue31044@psf.upfronthosting.co.za>
In-reply-to
Content
I'm able to reproduce the bug on koobs's FreeBSD CURRENT:

* stat() returns st_dev = 0xde4d0429ab
* major(0xde4d0429ab) returns 0x29
* minor(0xde4d0429ab) returns 0x4d0400ab

minor() truncates most significant bits. major/minor are defined in sys/types.h:
https://github.com/freebsd/freebsd/blob/master/sys/sys/types.h#L372

#define	major(x)	((int)(((u_int)(x) >> 8)&0xff))	/* major number */
#define	minor(x) ((int)((x)&0xffff00ff)) /* minor number */

The definition of minor() confirms that most significant bits are truncated by "& 0xffff00ff".

I'm surprised that stat().st_dev returns a device larger than INT_MAX: 0xde4d0429ab.
History
Date User Action Args
2017-07-27 14:07:36vstinnersetrecipients: + vstinner, koobs
2017-07-27 14:07:36vstinnersetmessageid: <1501164456.41.0.517654066354.issue31044@psf.upfronthosting.co.za>
2017-07-27 14:07:36vstinnerlinkissue31044 messages
2017-07-27 14:07:36vstinnercreate