You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by James Peach <jp...@apache.org> on 2014/05/08 18:09:01 UTC

TS-2624: Divide by zero check

Hi Phil,

Can you give me some more details on how the call to hwloc_get_nbobjs_by_type() could return 0? I can see how a system could have 0 NUMA nodes, but that case falls through to sockets, and I would have thought that every platform would have at least 1 socket.

Additionally, I think that if the configuration asked for a thread affinity binding and we could not apply it, we should issue a warning rather than silently doing nothing.

J

Re: TS-2624: Divide by zero check

Posted by Phil Sorber <so...@apache.org>.
On Thu, May 8, 2014 at 10:09 AM, James Peach <jp...@apache.org> wrote:

> Hi Phil,
>
> Can you give me some more details on how the call to
> hwloc_get_nbobjs_by_type() could return 0? I can see how a system could
> have 0 NUMA nodes, but that case falls through to sockets, and I would have
> thought that every platform would have at least 1 socket.
>
>
THB, I don't think it can. The reason for this addition was static analysis
throwing up a red flag. I presume clang. I figured it can't hurt to check
there.


> Additionally, I think that if the configuration asked for a thread
> affinity binding and we could not apply it, we should issue a warning
> rather than silently doing nothing.
>
>
Since I didn't think this could happen in practice, I didn't think to throw
a warning, but you are right. If we are going to check for, and have a case
when it is zero, we should at least handle it properly. I'll add something.


> J
>