Skip to content

Bug/Regression: frida compiler not calling on_output on fail since 17.1.0 #1177

@goolmoos

Description

@goolmoos

on new version of frida, if the ts results in an error, on_output does not get called.
among other things, this breaks frida-tools repl if we pass a bad .ts as compilation never ends. (which is how I found this)

reproduction with frida-tools is easy (pass a bad ts), without:

tested using frida-python in a fresh venv.
with 17.1.0 (and after) we only get on_diagnostic, but with 17.0.7 (and before) we also get on_output

test.py

import frida
import sys
print(frida.__version__)

session = frida.attach(0)
script = None

def on_output(bundle):
    print("on_output")

def on_diagnostics(diag):
    print("on_diagnostics")

compiler = frida.Compiler()
compiler.on("diagnostics", on_diagnostics)
compiler.on("output", on_output) # when failing, never called >= 17.1.0, but is called on <=17.0.7
compiler.watch("/add/dir/here/agent.ts", "/add/dir/here/frida_stuck_demo")

sys.stdin.read()

agent.ts

bad_func()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions