Attaching jstack to a process can result in an infinite loop, as it reads type definitions, such as:
Warning: the type "jboolean" (declared in the remote VM in VMStructs::localHotSpotVMTypes) had its size declared as -158127939785850880 twice. Continuing.
Warning: the type "jboolean" (declared in the remote VM in VMStructs::localHotSpotVMTypes) had its size declared as -158127939785850880 twice. Continuing.
Warning: the type "jboolean" (declared in the remote VM in VMStructs::localHotSpotVMTypes) had its size declared as -158127939785850880 twice. Continuing.
Warning: the type "jboolean" (declared in the remote VM in VMStructs::localHotSpotVMTypes) had its size declared as -158127939785850880 twice. Continuing.
Warning: the type "jboolean" (declared in the remote VM in VMStructs::localHotSpotVMTypes) had its size declared as -158127939785850880 twice. Continuing.
Warning: the type "jboolean" (declared in the remote VM in VMStructs::localHotSpotVMTypes) had its size declared as -158127939785850880 twice. Conti...
The type-reading loop, if reading bad data, can loop forever: we could implement a limit in that read to protect ourselves.