This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/15677] New: Cannot find bounds of current function after executing strrchr in glibc

            Bug ID: 15677
           Summary: Cannot find bounds of current function  after
                    executing strrchr in glibc
           Product: glibc
           Version: 2.17
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: vijunag at gmail dot com
                CC: drepper.fsp at gmail dot com

I am trying to debug my executable created from gcc-4.7.2(i686-pc-linux-gnu). 
gdb throws an error "cannot find bounds of current function error" the moment
the program steps into strrchr function and Im not able to debug my executable
after that point. Im not sure if the dwarf records are corrupted or if the
problem is with glibc.  I did disassemble the code and noticed that
epilogue/prologue sequence for the same was replaced with a call to  "86b4900
<__x86.get_pc_thunk.bx>".  I'm also unable to debug the executable after calls
to few functions which have hand-written assembly in glibc.

(gdb) r
Failed to read a valid object file image from memory.
Breakpoint 1, main (argc=5, argv=0xbffff784, env=0xbffff79c) at main.c:205
205    int main(int argc, char **argv, char **env) {
(gdb) n
220        FILE *rva = fopen("/proc/sys/kernel/randomize_va_space", "r+");
(gdb) n
221        if (rva) {
222          int val=0;
224          if (1==fscanf(rva, "%d", &val)) {
225        if (val) {
237          fclose(rva);
242          } else if (val) {
273      main_config.argv0short = strrchr(argv[0], '/');
0x08048430 in ?? ()
Cannot find bounds of current function
Cannot find bounds of current function

However if I step-into strrchr function I can continue with debugging.
 I'm not sure if the problem is with gdb or If I'm missing some
flags while compiling glibc.

Below is the dwarfdump output of strrchr and let me know if it is
missing some important info.

arange starts at 0x1478ac40, length of 0x00000045, cu_die_offset = 0x1a6047c2
187417594 arange end
187417595 COMPILE_UNIT<header overall offset = 0x1a604872>:
187417596 < 0><0x0000000b>  DW_TAG_compile_unit
187417597                     DW_AT_stmt_list             0x01e23163
187417598                     DW_AT_ranges                0x004d5d88
187417599     ranges: 4 at .debug_ranges offset 5070216 (0x004d5d88) (32 bytes)
187417600       [ 0] addr selection 0xffffffff 0x00000000
187417601       [ 1] range entry    0x1478ac90 0x1478ae99
187417602       [ 2] range entry    0x086b4900 0x086b4904
187417603       [ 3] range end      0x00000000 0x00000000
187417604                     DW_AT_name
187417605                     DW_AT_comp_dir
187417606                     DW_AT_producer              GNU AS 2.23.1
187417607                     DW_AT_language             

You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]