From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29612 invoked by alias); 22 Oct 2014 09:08:31 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 29601 invoked by uid 89); 22 Oct 2014 09:08:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail.triagens-gmbh.de Received: from telekom.triagens-gmbh.de (HELO mail.triagens-gmbh.de) (80.152.136.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 Oct 2014 09:08:28 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.triagens-gmbh.de (Postfix) with ESMTP id ADF0414202A for ; Wed, 22 Oct 2014 11:08:25 +0200 (CEST) Received: from mail.triagens-gmbh.de ([127.0.0.1]) by localhost (triagens.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VJLt-c0zYylU for ; Wed, 22 Oct 2014 11:08:20 +0200 (CEST) Received: from [192.168.173.80] (bruecklinux [192.168.173.80]) by mail.triagens-gmbh.de (Postfix) with ESMTPSA id A2B4A14200D for ; Wed, 22 Oct 2014 11:08:20 +0200 (CEST) Message-ID: <5447741A.9000000@arangodb.org> Date: Wed, 22 Oct 2014 09:08:00 -0000 From: Wilfried Goesgens User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.5.0 MIME-Version: 1.0 To: gdb@sourceware.org Subject: GDB Crashes with V8 & JIT debugging Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00087.txt.bz2 Hi everyone, I'm trying to get javascript V8 function names displayed in gdb while running arangodb as described here: https://code.google.com/p/v8/wiki/GDBJITInterface I'm doing this with the devel-branch of: https://github.com/triAGENS/ArangoDB which compiles its own V8. I experienced GDB crashes with the 7.7 in debian jessie, I compiled 7.8 from experimental, the problem persists. I'm configuring arangodb with: export CFLAGS="-O0 -ggdb -DENABLE_GDB_JIT_INTERFACE";export CXXFLAGS="-O0 -ggdb -DENABLE_GDB_JIT_INTERFACE"; ./configure --enable-relative --enable-maintainer-mode --enable-all-in-one-icu --with-backtrace then compile using gcc (Debian 4.9.1-16) 4.9.1 Now try to run it in GDB with the JIT-Facility in V8 enabled: mkdir /var/tmp/data gdb GNU gdb (Debian 7.8-1) 7.8 ... gdb> file bin/arangod Reading symbols from bin/arangod...done. gdb> run /var/tmp/data/ --console --no-server --javascript.gc-frequency 1000000 --javascript.gc-interval 65536 --server.threads=1 --scheduler.threads=1 --javascript.v8-options="--gdbjit" Starting program: /local/home/willi/src/ArangoAql2/bin/arangod /var/tmp/data/ --console --no-server --javascript.gc-frequency 1000000 --javascript.gc-interval 65536 --server.threads=1 --scheduler.threads=1 --javascript.v8-options="--gdbjit" [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". 2014-10-22T08:52:05Z [14749] INFO ArangoDB 2.3.0-devel 64bit maintainer mode -- ICU 52.1, V8 3.16.14, OpenSSL 1.0.1i 6 Aug 2014 ..... 2014-10-22T08:52:06Z [14749] INFO JavaScript using startup './js', application './js/apps' 2014-10-22T08:52:06Z [14749] INFO using V8 options '--gdbjit' [New Thread 0x7ffff7ff7700 (LWP 14761)] Dwarf Error: Could not find abbrev number 118 [in module ] Dwarf Error: Could not find abbrev number 267968 [in module ] Dwarf Error: Could not find abbrev number 58 [in module ] Dwarf Error: Could not find abbrev number 112 [in module ] Segmentation fault (core dumped) So I had a look at the coredump... gdb'ing gdb: gdb `which gdb` /var/tmp/core-gdb-14747-1413967926 Reading symbols from /usr/bin/gdb...Reading symbols from /usr/lib/debug/.build-id/c0/bff72b24569dcc4faa261e4a4993b911eb2d5e.debug...done. done. [New LWP 14747] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `gdb'. Program terminated with signal SIGSEGV, Segmentation fault. #0 read_unsigned_leb128 (abfd=, bytes_read_ptr=, buf=) at /local/home/willi/src/deb/gdb-7.8/gdb/dwarf2read.c:16449 16449 byte = bfd_get_8 (abfd, buf); gdb> bt full #0 read_unsigned_leb128 (abfd=, bytes_read_ptr=, buf=) at /local/home/willi/src/deb/gdb-7.8/gdb/dwarf2read.c:16449 byte = result = num_read = shift = #1 peek_die_abbrev (info_ptr=info_ptr@entry=0x7f06d19 , bytes_read=bytes_read@entry=0x7fffaf10a6d4, cu=0x7ea0f00, cu=0x7ea0f00) at /local/home/willi/src/deb/gdb-7.8/gdb/dwarf2read.c:7118 abfd = abbrev_number = #2 0x00000000005f97ab in skip_children (reader=reader@entry=0x7fffaf10a900, info_ptr=0x7f06d19 , info_ptr@entry=0x7eb8219 "\004__myenv__") at /local/home/willi/src/deb/gdb-7.8/gdb/dwarf2read.c:7146 cu = 0x7ea0f00 abbrev = bytes_read = 1 #3 0x00000000006052c5 in locate_pdi_sibling (info_ptr=, orig_pdi=0x7ee1c90, reader=0x7fffaf10a900) at /local/home/willi/src/deb/gdb-7.8/gdb/dwarf2read.c:7307 info_ptr = 0x7eb8219 "\004__myenv__" orig_pdi = 0x7ee1c90 reader = 0x7fffaf10a900 #4 load_partial_dies (reader=0x7fffaf10a900, info_ptr=, building_psymtab=) at /local/home/willi/src/deb/gdb-7.8/gdb/dwarf2read.c:15461 cu = objfile = part_die = 0x7ee1d00 parent_die = last_die = 0x7ee1c90 first_die = 0x7fff00000001 abbrev = bytes_read = 1 load_all = nesting_level = __PRETTY_FUNCTION__ = "load_partial_dies" #5 0x0000000000607cb9 in process_psymtab_comp_unit_reader (reader=0x7fffaf10a900, info_ptr=0x7fffaf10a6d4 "\001", comp_unit_die=0x7ee1960, has_children=132779856, data=0x2, data@entry=0x7fffaf10a980) at /local/home/willi/src/deb/gdb-7.8/gdb/dwarf2read.c:5911 first_die = 0x7f06d19 lowpc = 18446744073709551615 highpc = 0 cu = 0x7ea0f00 objfile = 0x7ea12a0 baseaddr = 0 best_lowpc = 49377499982304 best_highpc = 49377499982976 pst = 0x7ed3d90 has_pc_info = 2 filename = 0x7fffaf10a6d4 "\001" __PRETTY_FUNCTION__ = "process_psymtab_comp_unit_reader" #6 0x0000000000600349 in init_cutu_and_read_dies (this_cu=this_cu@entry=0x7ed3d40, abbrev_table=abbrev_table@entry=0x0, use_existing_cu=use_existing_cu@entry=0, keep=keep@entry=0, die_reader_func=die_reader_func@entry=0x607900 , data=data@entry=0x7fffaf10a980) at /local/home/willi/src/deb/gdb-7.8/gdb/dwarf2read.c:5529 objfile = section = abfd = cu = 0x7ea0f00 begin_info_ptr = info_ptr = 0x7eb81f8 "\003\bv8value" reader = {abfd = 0x7ea1560, cu = 0x7ea0f00, dwo_file = 0x0, die_section = 0x7ed3ab0, buffer = 0x7eb8190 "7\002", buffer_end = 0x7eb83cb "\004", comp_dir = 0x0} comp_unit_die = 0x7ee1960 has_children = 1 attr = cleanups = 0x4acf010 free_cu_cleanup = sig_type = __PRETTY_FUNCTION__ = "init_cutu_and_read_dies" #7 0x0000000000603091 in process_psymtab_comp_unit (this_cu=0x7ed3d40, want_partial_unit=0, pretend_language=language_minimal) at /local/home/willi/src/deb/gdb-7.8/gdb/dwarf2read.c:5998 info = {want_partial_unit = 0, pretend_language = language_minimal} #8 0x0000000000612349 in dwarf2_build_psymtabs_hard (objfile=0x7ea12a0) at /local/home/willi/src/deb/gdb-7.8/gdb/dwarf2read.c:6397 per_cu = back_to = 0x7e9f620 addrmap_cleanup = 0x4b2fdc0 temp_obstack = {chunk_size = 4064, chunk = 0x7ee0960, object_base = 0x7ee0a30 "", next_free = 0x7ee0a30 "", chunk_limit = 0x7ee1940 "", temp = 2921728485028692480, alignment_mask = 15, chunkfun = 0x69c690 , freefun = 0x69c760 , extra_arg = 0x288c1093c0468200, use_extra_arg = 0, maybe_empty_object = 0, alloc_failed = 0} i = 0 #9 dwarf2_build_psymtabs (objfile=0x7ea12a0) at /local/home/willi/src/deb/gdb-7.8/gdb/dwarf2read.c:4173 cleanups = 0x7a3400 except = {reason = 0, error = GDB_NO_ERROR, message = 0x0} #10 0x000000000057d37e in require_partial_symbols (objfile=objfile@entry=0x7ea12a0, verbose=verbose@entry=0) at /local/home/willi/src/deb/gdb-7.8/gdb/psymtab.c:92 No locals. #11 0x00000000005825d4 in read_symbols (objfile=objfile@entry=0x7ea12a0, add_flags=add_flags@entry=0) at /local/home/willi/src/deb/gdb-7.8/gdb/symfile.c:902 No locals. #12 0x0000000000582158 in syms_from_objfile_1 (add_flags=0, addrs=0x48891d0, objfile=0x7ea12a0) at /local/home/willi/src/deb/gdb-7.8/gdb/symfile.c:1080 local_addr = 0x0 old_chain = 0x7d3fae0 mainline = 0 #13 syms_from_objfile (add_flags=0, addrs=0x48891d0, objfile=0x7ea12a0) at /local/home/willi/src/deb/gdb-7.8/gdb/symfile.c:1096 No locals. #14 symbol_file_add_with_addrs (abfd=abfd@entry=0x7ea1560, name=, add_flags=add_flags@entry=0, addrs=addrs@entry=0x48891d0, flags=flags@entry=66, parent=parent@entry=0x0) at /local/home/willi/src/deb/gdb-7.8/gdb/symfile.c:1193 objfile = 0x7ea12a0 from_tty = 0 mainline = 0 should_print = #15 0x0000000000582625 in symbol_file_add_from_bfd (abfd=abfd@entry=0x7ea1560, name=, add_flags=add_flags@entry=0, addrs=addrs@entry=0x48891d0, flags=flags@entry=66, parent=parent@entry=0x0) at /local/home/willi/src/deb/gdb-7.8/gdb/symfile.c:1282 No locals. #16 0x0000000000699302 in jit_bfd_try_read_symtab (code_entry=, code_entry=, gdbarch=, entry_addr=50657840) at /local/home/willi/src/deb/gdb-7.8/gdb/jit.c:931 sai = 0x48891d0 sec = 0x0 objfile = i = old_cleanups = 0x0 b = #17 jit_register_code (gdbarch=, entry_addr=50657840, code_entry=) at /local/home/willi/src/deb/gdb-7.8/gdb/jit.c:959 success = #18 0x0000000000699850 in jit_event_handler (gdbarch=0x3b0af30) at /local/home/willi/src/deb/gdb-7.8/gdb/jit.c:1412 descriptor = {version = 1, action_flag = 1, relevant_entry = 50657840, first_entry = 50657840} code_entry = {next_entry = 51697840, prev_entry = 0, symfile_addr = 50657872, symfile_size = 1896} entry_addr = 50657840 objf = #19 0x000000000053c85a in handle_jit_event () at /local/home/willi/src/deb/gdb-7.8/gdb/breakpoint.c:5615 frame = gdbarch = #20 bpstat_what (bs_head=0x7e3e1e0) at /local/home/willi/src/deb/gdb-7.8/gdb/breakpoint.c:5796 retval = {main_action = BPSTAT_WHAT_SINGLE, call_dummy = STOP_NONE, is_longjmp = 0} jit_event = bs = #21 0x0000000000598e64 in process_event_stop_test (ecs=ecs@entry=0x7fffaf10b210) at /local/home/willi/src/deb/gdb-7.8/gdb/infrun.c:4349 stop_pc_sal = frame = gdbarch = jmp_buf_pc = 0 what = __PRETTY_FUNCTION__ = "process_event_stop_test" #22 0x000000000059b0b8 in handle_inferior_event (ecs=0x7fffaf10b210) at /local/home/willi/src/deb/gdb-7.8/gdb/infrun.c:3446 regcache = #23 0x000000000059d4c2 in fetch_inferior_event (client_data=client_data@entry=0x0) at /local/home/willi/src/deb/gdb-7.8/gdb/infrun.c:2921 ecss = {ptid = {pid = 14749, lwp = 14749, tid = 0}, event_thread = 0x2615e60, ws = {kind = TARGET_WAITKIND_STOPPED, value = {integer = 5, sig = GDB_SIGNAL_TRAP, related_pid = {pid = 5, lwp = 0, tid = 0}, execd_pathname = 0x5 , syscall_number = 5}}, stop_func_filled_in = 0, stop_func_start = 0, stop_func_end = 0, stop_func_name = 0x0, wait_some_more = 0, stepped_after_stopped_by_watchpoint = 0, hit_singlestep_breakpoint = 0} ecs = 0x7fffaf10b210 old_chain = 0x7a3400 ts_old_chain = 0x21f0f00 was_sync = 1 cmd_done = 0 #24 0x00000000005b40b2 in inferior_event_handler (event_type=INF_REG_EVENT, client_data=0x0) at /local/home/willi/src/deb/gdb-7.8/gdb/inf-loop.c:58 ex = {reason = 0, error = GDB_NO_ERROR, message = 0x0} cleanup_if_error = 0x7a3400 #25 0x00000000005b2181 in process_event () at /local/home/willi/src/deb/gdb-7.8/gdb/event-loop.c:343 event_ptr = proc = 0x5b1680 data = {ptr = 0x7, integer = 7} #26 0x00000000005b257a in gdb_do_one_event () at /local/home/willi/src/deb/gdb-7.8/gdb/event-loop.c:395 event_source_head = 0 current = 3 #27 0x00000000005b27ee in start_event_loop () at /local/home/willi/src/deb/gdb-7.8/gdb/event-loop.c:432 ex = {reason = 0, error = GDB_NO_ERROR, message = 0x0} result = 0 #28 0x00000000005abb13 in captured_command_loop (data=data@entry=0x0) at /local/home/willi/src/deb/gdb-7.8/gdb/main.c:302 No locals. #29 0x00000000005a8c1a in catch_errors (func=func@entry=0x5abb00 , func_args=func_args@entry=0x0, errstring=errstring@entry=0x762bc9 "", mask=mask@entry=RETURN_MASK_ALL) at /local/home/willi/src/deb/gdb-7.8/gdb/exceptions.c:506 val = 0 exception = {reason = 0, error = GDB_NO_ERROR, message = 0x0} saved_uiout = 0x23b40c0 #30 0x00000000005acb86 in captured_main (data=data@entry=0x7fffaf10b580) at /local/home/willi/src/deb/gdb-7.8/gdb/main.c:1155 argc = argv = quiet = 0 set_args = 0 inhibit_home_gdbinit = 0 symarg = 0x0 execarg = 0x0 pidarg = 0x0 corearg = 0x0 pid_or_core_arg = 0x0 cdarg = 0x0 ttyarg = 0x0 print_help = 0 print_version = 0 print_configuration = 0 cmdarg_vec = 0x0 cmdarg_p = 0x0 dirarg = 0x21d6e80 dirsize = ndir = system_gdbinit = 0x23366a0 "/etc/gdb/gdbinit" home_gdbinit = 0x2336260 "/local/home/willi/.gdbinit" local_gdbinit = 0x0 i = save_auto_load = objfile = pre_stat_chain = 0x7a3400 #31 0x00000000005a8c1a in catch_errors (func=func@entry=0x5ac120 , func_args=func_args@entry=0x7fffaf10b580, errstring=errstring@entry=0x762bc9 "", mask=mask@entry=RETURN_MASK_ALL) at /local/home/willi/src/deb/gdb-7.8/gdb/exceptions.c:506 val = 0 exception = {reason = 0, error = GDB_NO_ERROR, message = 0x0} saved_uiout = 0xbac840 #32 0x00000000005ad05b in gdb_main (args=args@entry=0x7fffaf10b580) at /local/home/willi/src/deb/gdb-7.8/gdb/main.c:1163 No locals. #33 0x0000000000457345 in main (argc=, argv=) at /local/home/willi/src/deb/gdb-7.8/gdb/gdb.c:33 args = {argc = 1, argv = 0x7fffaf10b688, interpreter_p = 0x756144 "console"} Any hints what else I should do to resolve this are welcome. After over a decade of using GDB on a daily basis my first serious issue ;-) Cheers Willi