I am trying to run a app using gdb in emulator shell. I use following command

gdb <path of exe>

However, The app does not launch and I get following error

Starting program: <path of exe>
[Thread debugging using libthread_db enabled]

Program exited normally.

However, when I attach a running process to gdb, it works fine.

gdb -pid <process_id>

What could be the reason?


(gdb) b _start
Breakpoint 1 at 0xb40
(gdb) b main
Breakpoint 2 at 0xc43
(gdb) catch syscall exit
Catchpoint 3 (syscall 'exit' [1])
(gdb) catch syscall exit_group
Catchpoint 4 (syscall 'exit_group' [252])
(gdb) r
Starting program: <exe path>
[Thread debugging using libthread_db enabled]

Breakpoint 1, 0x80000b40 in _start ()
(gdb) c
Breakpoint 2, 0x80000c43 in main ()
(gdb) c

Catchpoint 4 (call to syscall 'exit_group'), 0xb7fe1424 in __kernel_vsyscall

(gdb) c

Program exited normally.

What does Catchpoint 4 (call to syscall 'exit_group'), 0xb7fe1424 in __kernel_vsyscall this mean? I probed further and i found this

Single stepping until exit from function main,
which has no line number information.
__libc_start_main (main=0xb6deb030 <main>, argc=1, ubp_av=0xbffffce4, 
    init=0x80037ab0 <__libc_csu_init>, fini=0x80037b10 <__libc_csu_fini>, 
    rtld_fini=0xb7ff1000 <_dl_fini>, stack_end=0xbffffcdc) at libc-start.c:258
258 libc-start.c: No such file or directory.
    in libc-start.c

However, libc.so is present and i have exported its path also using


Why is not loading?

  • 3
    Please give the exact command you are using to launch gdb. Including the name/path of the executable. And I believe gdb will have given much more output that what you mention. Do not post what YOU think is relevant output. Put the whole thing here. – darnir Apr 10 '13 at 9:12
  • Hi, I edited the post. I am giving gdb <path of exe> and the output I mentioned is the only output I am getting. – Yogi Apr 10 '13 at 9:15
  • What do you get when you run simply path of exe from the command line, in exactly the same way you are starting it through gdb? – a CVn Apr 10 '13 at 9:19
  • if i run from command prompt, its running fine. – Yogi Apr 10 '13 at 9:51
  • See eg. stackoverflow.com/questions/344829/what-is-kernel-vsyscall and man exit_group. – goldilocks Apr 12 '13 at 9:33

Of course it won't stop, you didn't even set a break point.

i.e b __libc_start_main

Look at this message: Program exited normally. means gdb started it, and completed execution normally.

| improve this answer | |
  • I tried this also, I am getting this error. "libc-start.c: No such file or directory." I dont think its necessary to put breakpoint.If I dont put breakpoint it should run the app normally. Also, gdb -pid <process_id> is working fine without putting breakpoint. – Yogi Apr 12 '13 at 9:10
  • I have updated the question. Please have a look. – Yogi Apr 12 '13 at 9:25

Is the program normally started with arguments? It's possible that when your run it in gdb you aren't supplying the same arguments that are used to start the process that you attach to manually.

You can identify any arguments a running instance has been launched with using the following command:

ps aux | grep [process_name]

The arguments will be listed in the output like:

auser      1114  2.8  6.8 316652 139928 ?       SLl  Aug07   3:24 /usr/local/bin/a_program arg1 arg2 arg3

You can set the arguments in gdb using set args:

(gdb) set args arg1 arg2 arg3
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.