While trying to get the backtrace of all threads I get this from gdb -batch: $ ~/local-gdb/bin/gdb -batch -x ~/test-gdb-commands -p `pidof kwrite` Thread 1 (process 14068): #0 0xc5079a9d in ?? () Backtrace stopped: Cannot access memory at address 0x6668c40 While running it interactively I get: (gdb) thread apply all bt Thread 1 (process 14089): #0 0x00007fba06affa9d in poll () from /lib/libc.so.6 #1 0x00007fba02deff14 in ?? () from /usr/lib64/libglib-2.0.so.0 #2 0x00007fba02df001c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0 #3 0x00007fba0542dc7e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4 #4 0x00007fba05ab1356 in ?? () from /usr/lib64/qt4/libQtGui.so.4 #5 0x00007fba053ffd7f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4 #6 0x00007fba05400075 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4 #7 0x00007fba05405189 in QCoreApplication::exec() () from /usr/lib64/qt4/libQtCore.so.4 #8 0x00007fba06fafdf3 in kdemain () from /usr/lib64/libkdeinit4_kwrite.so #9 0x00007fba06a42a65 in __libc_start_main () from /lib/libc.so.6 #10 0x00000000004006de in _start () The contents of test-gdb-commands are $ more ~/test-gdb-commands thread apply all bt This is $ ~/local-gdb/bin/gdb --version GNU gdb (GDB) 7.8.50.20140829-cvs and this all works correctly in $ gdb --version GNU gdb (Gentoo 7.7 p1) 7.7 One thing I noticed is that my intsalled version (GDB 7.7) prints threads with the format Thread 1 (Thread 0x7f6151f9a780 (LWP 14252)) so it is printing from linux-thread-db.c (thread_db_pid_to_str) while the new version prints from thread.c (normal_pid_to_str) so I wonder if this has anything to do with the inconsistency.