rizinorg / cutter

Free and Open Source Reverse Engineering Platform powered by rizin
https://cutter.re
GNU General Public License v3.0
15.79k stars 1.15k forks source link

Crash when saving a VxWorks project #2166

Closed brainstorm closed 3 years ago

brainstorm commented 4 years ago

Environment information

Describe the bug

To Reproduce

Steps to reproduce the behavior:

Following the steps outlined in this blogpost:

https://blogs.nopcode.org/brainstorm/anritsu-ms2721b-spectrum-analyzer-repair-part-2/

For an online demo/talk... When I try to save the project, the crash and backtrace below in "Screenshots" occurred.

Expected behavior

I should be able to save a project without crashes. In addition, when working with the built-in console, I cannot switch to a python virtual environment via conda... is it possible to load .bashrc beforehand somehow? I need the python3 virtual environment setup for VxHunter as in r2 CLI:

$ r2 -a sh -b 32 ~/dev/anritsu/firmware/fresh/OS/VxWorks.bin
[0x00000000]> #!pipe python3 /Users/romanvg/ghidra_scripts/vxhunter/firmware_tools/vxhunter_r2_py3.py

Screenshots

Date/Time:        2020-04-23 13:31:32 +1000
End time:         2020-04-23 13:33:54 +1000
OS Version:       Mac OS X 10.15.3 (Build 19D76)
Architecture:     x86_64h
Report Version:   29

Data Source:      Stackshots
Shared Cache:     0x91d000 67247547-86EF-3DC2-8ADE-28BD6B9E8FCF

Command:          Cutter.bin
Path:             /Applications/Cutter.app/Contents/MacOS/Cutter.bin
Version:          ??? (???)
Parent:           bash [5066] [unique pid 602298]
Responsible:      bash [5066] [unique pid 602298]
PID:              5090

Event:            hang
Duration:         141.26s
Duration Sampled: 1.10s (process was unresponsive for 140 seconds before sampling)
Steps:            11 (100ms sampling interval)

Hardware model:   MacBook10,1
Active cpus:      4

Time Awake Since Boot: 180000s
Time Since Wake:  22000s

--------------------------------------------------
Timeline format: stacks are sorted chronologically
Use -i and -heavy to re-report with count sorting
--------------------------------------------------

Heaviest stack for the main thread of the target process:
  11  start + 8 (libdyld.dylib + 108548) [0x7fff63b82804]
  11  exit + 55 (libsystem_c.dylib + 370460) [0x7fff63c2b71c]
  11  __cxa_finalize_ranges + 319 (libsystem_c.dylib + 369734) [0x7fff63c2b446]
  11  ??? (Cutter.bin + 226534) [0x108cd04e6]
  11  CutterCore::~CutterCore() + 14 (Cutter.bin + 64414) [0x108ca8b9e]
  11  CutterCore::~CutterCore() + 87 (Cutter.bin + 63895) [0x108ca8997]
  11  r_core_free + 32 (libr_core.dylib + 68208) [0x10902da70]
  11  r_core_fini + 73 (libr_core.dylib + 67369) [0x10902d729]
  11  r_core_task_join + 440 (libr_core.dylib + 1606008) [0x1091a5178]
  11  ??? (libr_core.dylib + 1606257) [0x1091a5271]
  11  sem_wait + 10 (libsystem_kernel.dylib + 138242) [0x7fff63ce3c02]
 *11  hndl_unix_scall64 + 22 (kernel + 930310) [0xffffff80002e3206]
 *11  unix_syscall64 + 650 (kernel + 7975050) [0xffffff800099b08a]
 *11  sem_wait_nocancel + 187 (kernel + 7397979) [0xffffff800090e25b]
 *11  ??? (kernel + 1475525) [0xffffff80003683c5]
 *11  thread_block_reason + 175 (kernel + 1425263) [0xffffff800035bf6f]
 *11  ??? (kernel + 1431409) [0xffffff800035d771]
 *11  machine_switch_context + 200 (kernel + 2490744) [0xffffff8000460178]

Process:          Cutter.bin [5090] [unique pid 602322]
UUID:             604F090E-CFAC-3B60-B8C1-86E24EAB9879
Path:             /Applications/Cutter.app/Contents/MacOS/Cutter.bin
Architecture:     x86_64
Parent:           bash [5066] [unique pid 602298]
Responsible:      bash [5066] [unique pid 602298]
UID:              501
Footprint:        71.73 MB
Start time:       2020-04-23 13:33:53 +1000
End time:         2020-04-23 13:33:54 +1000
Num samples:      11 (1-11)
Note:             Unresponsive for 140 seconds before sampling
Note:             1 idle work queue thread omitted

  Thread 0x2688db    DispatchQueue "com.apple.main-thread"(1)    11 samples (1-11)    priority 0 (base 4)
  <thread QoS utility (requested user interactive), process unclamped, process received importance donation from WindowServer [291], IO tier 1>
  11  start + 8 (libdyld.dylib + 108548) [0x7fff63b82804] 1-11
    11  exit + 55 (libsystem_c.dylib + 370460) [0x7fff63c2b71c] 1-11
      11  __cxa_finalize_ranges + 319 (libsystem_c.dylib + 369734) [0x7fff63c2b446] 1-11
        11  ??? (Cutter.bin + 226534) [0x108cd04e6] 1-11
          11  CutterCore::~CutterCore() + 14 (Cutter.bin + 64414) [0x108ca8b9e] 1-11
            11  CutterCore::~CutterCore() + 87 (Cutter.bin + 63895) [0x108ca8997] 1-11
              11  r_core_free + 32 (libr_core.dylib + 68208) [0x10902da70] 1-11
                11  r_core_fini + 73 (libr_core.dylib + 67369) [0x10902d729] 1-11
                  11  r_core_task_join + 440 (libr_core.dylib + 1606008) [0x1091a5178] 1-11
                    11  ??? (libr_core.dylib + 1606257) [0x1091a5271] 1-11
                      11  sem_wait + 10 (libsystem_kernel.dylib + 138242) [0x7fff63ce3c02] 1-11
                       *11  hndl_unix_scall64 + 22 (kernel + 930310) [0xffffff80002e3206] 1-11
                         *11  unix_syscall64 + 650 (kernel + 7975050) [0xffffff800099b08a] 1-11
                           *11  sem_wait_nocancel + 187 (kernel + 7397979) [0xffffff800090e25b] 1-11
                             *11  ??? (kernel + 1475525) [0xffffff80003683c5] 1-11
                               *11  thread_block_reason + 175 (kernel + 1425263) [0xffffff800035bf6f] 1-11
                                 *11  ??? (kernel + 1431409) [0xffffff800035d771] 1-11
                                   *11  machine_switch_context + 200 (kernel + 2490744) [0xffffff8000460178] 1-11
xarkes commented 3 years ago

We've changed our projects backend so I guess this issue is fixed, let us know if you can try it again and confirm it.

brainstorm commented 3 years ago

ENOTIME, r2 via cmdline works just fine ;)