I've Been to Rio and felt quite safe besides concern for pick pockets. Probably not a great comparison as rio tourist areas are safe and beaches safe.
Chicago is safe but reality crime increases when economy/jobs are in the sewer. The best solution educate the youth and give them availability to jobs (even low skill employment) gives them a purpose. Unfortunately, Chicago is so divided between wealth and poverty it is difficult to move tax revenue to the under serve part of their population resulting in that segment leaking into popular areas.
I am much more afraid in Chicago vs NYC due to the higher number of gangs.