fix integer truncation bugs in error logger path
fix integer truncation bugs in error logger path

Sending a large term to the error logger has two problems related
to the size and sign of the variables used to represent lengths:

- the API functions (erts_send_error_term_to_logger() et al) perform
  an unchecked narrowing conversion from size_t to int when passing
  dsbufp->str_len to the internal functions; this may both truncate
  the length and make it negative

- do_send_term_to_logger() and do_send_to_logger() multiply the
  int-typed length by 2 before widening it to Uint and adding a few
  more values; the intermediate product may overflow causing loss
  of high bits and a change of sign; if the intermediate product is
  negative the final size will be an extremely large positive value

The end result is that the computed buffer size can be arbitrarily
wrong, either too small or too large.

While reviewing this code I also found and fixed a potential narrowing
bug in erts_set_hole_marker().

RoadRunnr/otp,lrascao/otp,rlipscombe/otp,dgud/otp,cobusc/otp,g-andrade/otp,lrascao/otp,saleyn/otp,vinoski/otp,RoadRunnr/otp,dgud/otp,bjorng/otp,saleyn/otp,emacsmirror/erlang,dgud/otp,bsmr-erlang/otp,mikpe/otp,jj1bdx/otp,jj1bdx/otp,ferd/otp,dumbbell/otp,getong/otp,potatosalad/otp,rlipscombe/otp,RoadRunnr/otp,electricimp/otp,fenollp/otp,electricimp/otp,uabboli/otp,emacsmirror/erlang,uabboli/otp,ferd/otp,potatosalad/otp,mikpe/otp,aboroska/otp,emacsmirror/erlang,uabboli/otp,RaimoNiskanen/otp,jj1bdx/otp,erlang/otp,saleyn/otp,g-andrade/otp,vinoski/otp,jj1bdx/otp,jj1bdx/otp,erlang/otp,mikpe/otp,legoscia/otp,vladdu/otp,dgud/otp,emacsmirror/erlang,g-andrade/otp,mikpe/otp,mikpe/otp,RoadRunnr/otp,ferd/otp,kvakvs/otp,emacsmirror/erlang,potatosalad/otp,g-andrade/otp,erlang/otp,potatosalad/otp,legoscia/otp,dgud/otp,cobusc/otp,RoadRunnr/otp,lrascao/otp,tuncer/otp,electricimp/otp,legoscia/otp,isvilen/otp,lrascao/otp,RaimoNiskanen/otp,getong/otp,tuncer/otp,vinoski/otp,legoscia/otp,tuncer/otp,erlang/otp,ferd/otp,uabboli/otp,mikpe/otp,bsmr-erlang/otp,bjorng/otp,aboroska/otp,bjorng/otp,kvakvs/otp,vladdu/otp,tuncer/otp,mikpe/otp,RoadRunnr/otp,getong/otp,saleyn/otp,saleyn/otp,aboroska/otp,bsmr-erlang/otp,isvilen/otp,kvakvs/otp,vinoski/otp,saleyn/otp,erlang/otp,legoscia/otp,bsmr-erlang/otp,lrascao/otp,isvilen/otp,RaimoNiskanen/otp,emacsmirror/erlang,potatosalad/otp,electricimp/otp,kvakvs/otp,cobusc/otp,bjorng/otp,isvilen/otp,g-andrade/otp,vinoski/otp,isvilen/otp,dumbbell/otp,mikpe/otp,g-andrade/otp,vinoski/otp,rlipscombe/otp,aboroska/otp,isvilen/otp,jj1bdx/otp,vladdu/otp,saleyn/otp,saleyn/otp,getong/otp,dgud/otp,rlipscombe/otp,uabboli/otp,RaimoNiskanen/otp,dumbbell/otp,vladdu/otp,getong/otp,emacsmirror/erlang,vladdu/otp,vinoski/otp,ferd/otp,dumbbell/otp,lrascao/otp,tuncer/otp,bsmr-erlang/otp,RoadRunnr/otp,g-andrade/otp,dgud/otp,RaimoNiskanen/otp,rlipscombe/otp,erlang/otp,legoscia/otp,dumbbell/otp,potatosalad/otp,fenollp/otp,lrascao/otp,rlipscombe/otp,ferd/otp,fenollp/otp,electricimp/otp,cobusc/otp,aboroska/otp,dgud/otp,fenollp/otp,bjorng/otp,emacsmirror/erlang,dgud/otp,vladdu/otp,jj1bdx/otp,dumbbell/otp,isvilen/otp,cobusc/otp,getong/otp,mikpe/otp,saleyn/otp,dumbbell/otp,uabboli/otp,vladdu/otp,kvakvs/otp,potatosalad/otp,emacsmirror/erlang,jj1bdx/otp,rlipscombe/otp,fenollp/otp,RaimoNiskanen/otp,fenollp/otp,ferd/otp,vinoski/otp,dumbbell/otp,vladdu/otp,electricimp/otp,ferd/otp,legoscia/otp,aboroska/otp,emacsmirror/erlang,bsmr-erlang/otp,uabboli/otp,electricimp/otp,tuncer/otp,rlipscombe/otp,g-andrade/otp,bsmr-erlang/otp,bjorng/otp,bsmr-erlang/otp,mikpe/otp,isvilen/otp,bjorng/otp,fenollp/otp,legoscia/otp,vinoski/otp,getong/otp,erlang/otp,legoscia/otp,cobusc/otp,bjorng/otp,vladdu/otp,potatosalad/otp,dgud/otp,tuncer/otp,dumbbell/otp,getong/otp,bjorng/otp,electricimp/otp,cobusc/otp,kvakvs/otp,kvakvs/otp,RoadRunnr/otp,bjorng/otp,electricimp/otp,cobusc/otp,tuncer/otp,rlipscombe/otp,bsmr-erlang/otp,potatosalad/otp,aboroska/otp,tuncer/otp,kvakvs/otp,getong/otp,RoadRunnr/otp,fenollp/otp,RaimoNiskanen/otp,lrascao/otp,jj1bdx/otp,fenollp/otp,potatosalad/otp,g-andrade/otp,aboroska/otp,isvilen/otp,dumbbell/otp,getong/otp,erlang/otp,g-andrade/otp,RaimoNiskanen/otp,jj1bdx/otp,rlipscombe/otp,ferd/otp,vinoski/otp,lrascao/otp,aboroska/otp,uabboli/otp,isvilen/otp,RaimoNiskanen/otp,uabboli/otp,erlang/otp,kvakvs/otp,erlang/otp