There are warnings of possible riots as overcrowded and understaffed jails subject inmates to "inhuman" treatment amid escalating use of force and assaults.