httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: 100% CPU on Win32 processing chunked encoding (trunk)
Date Tue, 20 Jan 2015 21:42:11 GMT
Hi Edward,

On Tue, Jan 20, 2015 at 9:36 PM, Edward Lu <chaosed0@gmail.com> wrote:
>
> ctx->state is only ever set to enum values, so it should never become -3;
> however, it turns out that there's an insidious catch relating to bit-fields
> and enum values in the Visual Studio compiler. It represents bitfields of
> enum types as signed, while the enum values themselves can be unsigned. The
> net result is that assigning 5 to a bitfield enum of size 3 actually assigns
> -3, even if all of the possible enum values are positive. Apparently, this
> behavior is technically compliant with the standard; search around on the
> web for "enum bitfield signdness".
>
> Back in Apache, I tracked the bug down to r1484852, which introduces the
> bitfield enum: https://svn.apache.org/viewvc?view=revision&revision=1484852
>
> I'm not sure how to go about fixing this. The easiest method appears to be
> simply removing the bitfield definition. Hoping for some more experienced
> folks to jump in.

I already "fixed" (to unsigned) the eos_sent bitfield just below in
r1603863, but did not notice the enum was also a bitfield...
Please remove it, this is not a public struct anyhow, it can't break the API.

Regards,
Yann.

Mime
View raw message