[CRIU] [PATCH] util-fd: Use standard BUG_ON instead of hand-made

Cyrill Gorcunov gorcunov at gmail.com
Thu Feb 26 12:42:22 PST 2015


On Thu, Feb 26, 2015 at 11:27:37PM +0300, Pavel Emelyanov wrote:
> >>  		 * into files which do not have glibc and a couple of
> >>  		 * sys_write_ helpers. Meawhile opencoded BUG_ON here.
> >>  		 */
> >> -		if (unlikely(min_fd > CR_SCM_MAX_FD))
> >> -			*(volatile unsigned long *)NULL = 0xdead0000 + __LINE__;
> >> +		BUG_ON(min_fd > CR_SCM_MAX_FD);
> > 
> > Have you tried to trigger it intentionally and verify that output is still readable?
> 
> No :) I assume that BUG_ON() is already checked to work properly in this case.

That's why there is a comment explaining why it was implemented handmade. But
maybe indeed it's already properly encoded in native BUG_ON ;)


More information about the CRIU mailing list