free(): invalid pointer on -o & -q
$ ps -o pid -q 1,2,
free(): invalid pointer
Signal 6 (ABRT) caught by ps (3.3.17).
ps:ps/display.c:70: please report this bug
$ gdb ps
GNU gdb (GDB) 13.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ps...
(No debugging symbols found in ps)
(gdb) set args -o pid -q 1,2,
(gdb) r
Starting program: /nix/store/vnkyhypn1z2ndp8cxcryswgbpk3n3wwi-system-path/bin/ps -o pid -q 1,2,
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/nix/store/j6mwswpa6zqhdm1lm2lv9iix3arn774g-glibc-2.38-27/lib/libthread_db.so.1".
free(): invalid pointer
Program received signal SIGABRT, Aborted.
0x00007ffff7e2dd7c in __pthread_kill_implementation () from /nix/store/j6mwswpa6zqhdm1lm2lv9iix3arn774g-glibc-2.38-27/lib/libc.so.6
(gdb) bt
#0 0x00007ffff7e2dd7c in __pthread_kill_implementation () from /nix/store/j6mwswpa6zqhdm1lm2lv9iix3arn774g-glibc-2.38-27/lib/libc.so.6
#1 0x00007ffff7dde9c6 in raise () from /nix/store/j6mwswpa6zqhdm1lm2lv9iix3arn774g-glibc-2.38-27/lib/libc.so.6
#2 0x00007ffff7dc78fa in abort () from /nix/store/j6mwswpa6zqhdm1lm2lv9iix3arn774g-glibc-2.38-27/lib/libc.so.6
#3 0x00007ffff7dc8767 in __libc_message.cold () from /nix/store/j6mwswpa6zqhdm1lm2lv9iix3arn774g-glibc-2.38-27/lib/libc.so.6
#4 0x00007ffff7e37a45 in malloc_printerr () from /nix/store/j6mwswpa6zqhdm1lm2lv9iix3arn774g-glibc-2.38-27/lib/libc.so.6
#5 0x00007ffff7e39bc4 in _int_free () from /nix/store/j6mwswpa6zqhdm1lm2lv9iix3arn774g-glibc-2.38-27/lib/libc.so.6
#6 0x00007ffff7e3c323 in free () from /nix/store/j6mwswpa6zqhdm1lm2lv9iix3arn774g-glibc-2.38-27/lib/libc.so.6
#7 0x0000000000409ee2 in parse_list ()
#8 0x000000000040b2e3 in parse_all_options ()
#9 0x000000000040b945 in arg_parse ()
#10 0x00000000004037b4 in main ()
This is with /nix/store/gb18gj7zpbhdavmsdr5090rx7lsvxvyk-procps-3.3.17/bin/ps on x86_64.