There are multiple ways to obtain a process name in Linux:
1. /proc/PID/cmdline: The command line arguments that were passed (including argv which is the process name)
2. /proc/PID/comm: The name of the command used, that can be initially equal to argv.
Method (1) is read by "ps -ef", and the way for a program to overwrite it is via questionable code like:
Method (2) is read by "ps -e" or top and the way for a program to overwrite it is via prctl(PR_SET_NAME).
When overwriting the process name using prctl() or the setproctitle() above, only one of the /proc entries is updated leaving multiple names on a single process. That makes process name changing on a Linux system an interesting adventure. Some programs use the setproctitle() hack, while others the prctl() call, making process listing inconsistent. That is, some overwritten names show in ps -e for some programs, while for other programs they show in ps -ef. The procps maintainers believe that this isn't an issue of procps but rather of the kernel itself (see #1107682), and I tend to concur.
I believe there should be a simple way for applications to overwrite their name.
Please take this to the upstream kernel developers.