Skip to content

[windows] fix notification callback string deallocation and add sanitizer coverage - #4

Merged
palmoni5 merged 4 commits into
windows-worker-thread-lazy-libraryfrom
palmoni5/fix-windows-notification-memory-integration-20261107
Nov 9, 2026
Merged

palmoni5 merged 4 commits into
windows-worker-thread-lazy-libraryfrom
palmoni5/fix-windows-notification-memory-integration-20261107

Conversation

@palmoni5

@palmoni5 palmoni5 commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Native allocation ownership fix (first PR in Windows stack)

Base: windows-worker-thread-lazy-library@e0bb5ad238c26c9e86e44759cc5e34e5a4c633e7
Head: 3a30cafe42c917ce8428f4a2667f7dcfbbd92c70

toNativeString() allocates callback input-map keys, values and payload with new char[]; the original callback cleanup incorrectly used scalar delete for keys and values. This PR changes the cleanup to delete[].

The two existing C ABI deallocators move unchanged in name/signature to src/ffi_memory.cpp, which is linked into the production DLL and can be compiled independently under sanitizers. The public FFI header is unchanged (blob b2cfe4d7fc427ae93cb3f9519ffb78115a5677de).

QA (verified)

  • Windows/Linux memory ownership succeeded: MSVC ASan with alloc_dealloc_mismatch=1, GCC ASan/UBSan/LSan, production deallocator, empty/payload-only callback cases and 10,000 string-map callbacks.
  • Full validate on this HEAD succeeded, including Windows unit tests and example builds.
  • Regression was reproduced with the original wrong scalar delete before correction; the test then passed with the real production free functions.
  • Native worker, WinRT ownership, lazy-DLL loading and all public Dart APIs are preserved.

Stack / release decision

  1. Review and merge [windows] fix notification callback string deallocation and add sanitizer coverage #4 into the integration branch only with explicit approval.
  2. Review stacked windows: run blocking notification queries on helper isolates #5, which adds helper-isolate queries, async teardown and late-COM-callback guarding.
  3. Finally review app #4516, pinned to the complete verified [windows] fix notification callback string deallocation and add sanitizer coverage #4 → windows: run blocking notification queries on helper isolates #5 sequence.

No automatic merge, and no merge action is performed in this task.

palmoni5 and others added 2 commits November 8, 2026 00:08
Preserve worker-thread and lazy-library integration and public FFI ABI.
Add sanitizer tests using the actual production deallocators.

palmoni5 commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

עדכון אימות בפועל

ה־HEAD הנבדק הוא 3a30cafe42c917ce8428f4a2667f7dcfbbd92c70. הקומיט הנוסף של Clang format נבדק: מחיקת שורה ריקה בלבד, ללא שינוי סמנטי.

ה־workflow Windows FFI memory ownership — run 42419253232 הסתיים בהצלחה:

  • Linux: קומפילציה והרצה של פונקציות השחרור מקוד הייצור עם ASan/UBSan, כולל בדיקת דליפות.
  • Windows: קומפילציה והרצה ב־MSVC עם ASan ו־alloc_dealloc_mismatch=1.

שתי הבדיקות כוללות את 10,000 מחזורי ה־callback. אלו בדיקות ownership ממוקדות, לא בנייה מלאה של DLL/Flutter ולא בדיקת שירות ההתראות מקצה לקצה. תהליך validate הכללי עדיין היה בתור בבדיקה האחרונה. אין סוכן QA עצמאי זמין בסשן; CI אינו מוצג כתחליף לכך.

לא השתנה pin באוצריא, אין מיזוג, וה־PR נשאר Draft עד השלמת האימות הנוסף. ניסיון הגשת התיקון הנפרד ל־upstream עדיין חסום בהרשאת החיבור (403).

The push trigger pointed at a temporary personal branch pattern. Pull requests still trigger the workflow.
palmoni5 added a commit that referenced this pull request Nov 9, 2026
@palmoni5
palmoni5 merged commit cf9188b into windows-worker-thread-lazy-library Nov 9, 2026
29 of 44 checks passed
@palmoni5

palmoni5 commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

QA לפני מיזוג: התיקון אומת (שחזור alloc-dealloc-mismatch ב-MSVC ASan לפני, עובר אחרי). נוסף 0deee95: טריגר ה-push של windows_ffi_memory עבר מענף אישי זמני לענף המשולב. CI מלא ירוק בפורק האישי (palmoni5#1, ראש שכולל את #4 ו-#5).

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