Skip to content

ffi+drain: route OCaml diagnostics to logcat and trace apply call sites - #20

Merged
tiensonqin merged 1 commit into
mainfrom
devin/1790294040-ffi-diagnostics
Sep 24, 2026
Merged

tiensonqin merged 1 commit into
mainfrom
devin/1790294040-ffi-diagnostics

Conversation

@tiensonqin

Copy link
Copy Markdown
Contributor

Summary

Follow-up to the exception-logging fix — the first diagnostic run showed it can't be observed on Android:

  1. stderr never reaches logcat: fprintf(stderr) in the FFI writes to /dev/null on Android (zygote redirects app stdio). Switch to __android_log_print under __ANDROID__ (liblog is already linked by build-android-native.sh); stderr fallback stays for iOS/desktop.
  2. Narrow the wedge: the drain trace showed empty patch from dispatch kind=create-graph (benign) then finish id=2 ... coreResponse messageChars=2025 — and then silence. No empty patch from applySnapshot, no resolveEffect trace, and the create-graph sheet stayed open for the whole timeout. ResolveEffect for CreateGraphEffect is what clears create_graph_open, and it runs after applySnapshot — so applySnapshot either blocked inside the FFI call or the backend applyPatch hung. Add debugPrint entry/exit around applySnapshot/resolveEffect/applyHostUpdate (including the busy-queue path) and applying/applied traces around applyPatch — the next logcat will show exactly which call stops returning.

Failure evidence (main run 36073266693, maestro device-logcat.txt): Dart isolate produces zero log lines after finish id=2; hierarchy still shows layout.graph-create.sheet open.

Note: tail -400 in the failure logcat dump can miss app lines under Maestro's chatter; the device-logcat.txt artifact inside android-maestro-debug has the complete buffer.

Link to Devin session: https://app.devin.ai/sessions/9a91e201984a4d4f96ce3e0f86ac6668
Open in Devin Desktop: https://app.devin.ai/desktop/session/9a91e201984a4d4f96ce3e0f86ac6668?variant=devin
Requested by: @tiensonqin

@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

fprintf(stderr) never reaches logcat on Android (zygote redirects
stdio), so the previous exception logging was invisible there — switch
to __android_log_print under __ANDROID__. The drain's empty-patch
trace showed the create-graph resolution never produced an empty patch
and Dart went silent after 'finish id=2' — so applySnapshot either
blocked inside the FFI call or hung in the backend apply. Add
entry/exit debugPrints around the three drain producers' FFI calls and
before/after drain applyPatch, so the next run names the hang.
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1790294040-ffi-diagnostics branch from d0cb8fe to 23edda0 Compare September 24, 2026 23:54
@tiensonqin
tiensonqin merged commit cb9374b into main Sep 24, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant