nodejs / llnode

An lldb plugin for Node.js and V8, which enables inspection of JavaScript states for insights into Node.js processes and their core dumps.
Other
1.15k stars 99 forks source link

[help] Using llnode with Deno #288

Closed bartlomieju closed 5 years ago

bartlomieju commented 5 years ago

I'm trying to use llnode to debug deno.

I do realize that's not the scope of this lib, but I hope you guys might be able to help.

Unfortunately backtrace using v8 bt gives exactly same output as backtrace, neither v8 findjsobjects nor v8 source list work.

Here's my excerpt from my building config:

  symbol_level = 2

  is_win_fastlink = true
  use_lld = false
  is_debug = true
  v8_optimized_debug = false
  v8_enable_backtrace = true
  v8_deprecation_warnings = false
  v8_enable_gdbjit = false
  v8_enable_i18n_support = false
  v8_enable_shared_ro_heap = false  # See #2624
  v8_experimental_extra_library_files = []
  v8_extra_library_files = []
  v8_imminent_deprecation_warnings = false
  v8_monolithic = false
  v8_untrusted_code_mitigations = false
  v8_use_external_startup_data = false
  v8_use_snapshot = true
  v8_postmortem_support = true

Here's output from llnode:

(llnode) backtrace
    frame #0: 0x000000010f1b1722 libv8.dylib`v8::internal::Handle<v8::internal::OrderedHashMap>::operator*(this=0x00007ffee57e0d88) const at handles.h:144
    frame #1: 0x000000010f1b1413 libv8.dylib`v8::internal::Handle<v8::internal::OrderedHashMap>::operator->(this=0x00007ffee57e0d88) const at handles.h:138
    frame #2: 0x000000010fa61006 libv8.dylib`v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, 2>::Rehash(isolate=0x0000000115138000, table=Handle<v8::internal::OrderedHashMap> @ 0x00007ffee57e0d88, new_capacity=8) at ordered-hash-table.cc:216
    frame #3: 0x000000010fa5a75b libv8.dylib`v8::internal::OrderedHashMap::Rehash(isolate=0x0000000115138000, table=Handle<v8::internal::OrderedHashMap> @ 0x00007ffee57e0dd0, new_capacity=8) at ordered-hash-table.cc:243
    frame #4: 0x000000010fa5a860 libv8.dylib`v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, 2>::Shrink(isolate=0x0000000115138000, table=Handle<v8::internal::OrderedHashMap> @ 0x00007ffee57e0e30) at ordered-hash-table.cc:67
    frame #5: 0x000000010fb93104 libv8.dylib`v8::internal::__RT_impl_Runtime_MapShrink(args=Arguments @ 0x00007ffee57e0f08, isolate=0x0000000115138000) at runtime-collections.cc:49
    frame #6: 0x000000010fb92d83 libv8.dylib`v8::internal::Runtime_MapShrink(args_length=1, args_object=0x00007ffee57e0fe8, isolate=0x0000000115138000) at runtime-collections.cc:44
    frame #7: 0x000000011096df80 libv8.dylib`Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit + 64
    frame #8: 0x000000011085c417 libv8.dylib`Builtins_MapPrototypeDelete + 19191
  * frame #9: 0x000000e8c1485e32
    frame #10: 0x00000001106fa7fc libv8.dylib`Builtins_ArgumentsAdaptorTrampoline + 188
    frame #11: 0x0000000110706b5d libv8.dylib`Builtins_JSEntryTrampoline + 93
    frame #12: 0x0000000110706938 libv8.dylib`Builtins_JSEntry + 120
    frame #13: 0x000000010f803ddc libv8.dylib`v8::internal::GeneratedCode
...

I assume frame #9 is a JS frame, but I couldn't find a way to actually annotate it using llnode.

I suspect the problem is with build config, any tips would be highly appreciated :pray:

mmarchini commented 5 years ago

This might be due to an unsupported V8 version. Which V8 version is your deno using?

bartlomieju commented 5 years ago

@mmarchini we're currently running V8 7.7.200

cjihrig commented 5 years ago

That version is not yet supported. Take a look at the issues in this repo labeled V8 Changes... you'll see llnode is increasingly drifting behind.

bartlomieju commented 5 years ago

@cjihrig duh! Thanks for the tip, my bad. Closing this issue for now.

mmarchini commented 5 years ago

Hopefully in the future we can leverage the new postmortem API which landed in V8 a few days ago (https://chromium-review.googlesource.com/c/v8/v8/+/1717090), but right now llnode is only work to V8 versions up to 6.8.