| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
fix(ans): fix heap-use-after-free in singleton DCLP and notificationList_ race 1. NotificationPreferences::GetInstance() and SystemSoundHelper::GetInstance(): replace broken DCLP with Meyer's singleton (C++11 thread-safe static local). The DCLP had unprotected shared_ptr reads causing data race when static instance_ was destroyed during process exit while ffrt worker threads called GetInstance(). 2. ClearRingtoneByApplication / ClearOverTimeRingToneInfo: - Remove 5-second delay (DEL_TASK_DELAY) from Submit calls. The delay caused SelfClean()'s drain to not wait for delayed tasks, leaving them pending after process exit. - Remove redundant std::bind wrapper, pass lambda directly. - Use Submit(func) without delay parameter. 3. serviceprivateutilsa_fuzzer: wrap direct DeleteAllByUserStopped() call with notificationSvrQueue_.SyncSubmit() to serialize with async tasks from OnUserRemoved/OnUserStopped, preventing concurrent read/write race on notificationList_ (list iterator use-after-free). 4. Fix empty if block in mock_ans_rdb_mgr_builder.cpp (cpplint). Co-Authored-By: Agent Signed-off-by: CheerfulRicky <yuegang7@h-partners.com> Change-Id: I8197f195c73f6cf2ea90e5a68c2afdea00d73ac0 | 8 天前 | |
fix(test): isolate test service DB to protect real notificationdb Make GetAnsNotificationRdbMgrInstance() a weak symbol and override it in a single shared test mock (frameworks/test/moduletest/mock) so the in-process service constructed by tests operates on an isolated temp DB (/data/local/tmp/ans_rdb_test_<pid>/notificationdb_test.db) instead of the real notificationdb.db. All affected test targets reference the single mock via absolute path (no duplicate files). Root cause: tests that call ClearNotificationInRestoreFactorySettings() invoke rdbDataManager_->Destroy() which deletes the DB file. Without an RDB mock, the real notificationdb.db is deleted on device, wiping real data. Scope: all tests calling ClearNotificationInRestoreFactorySettings without an RDB mock - ans_module_test (services/test/moduletest), 10 UT targets in services/ans/test/unittest (permission_filter, notification_service, live_view, slot, utils, snooze_delay, service_publish, preferences, ringtone, geofence), aggregation_test, badge_manager_test, plus the publish/slot moduletest. Review fixes: DestroyTestRdb now resets the static instance and removes the temp dir (rmdir); mkdir checks errno==EEXIST. Empty NtfRdbHook is intentional (nullptr-safe per docs, avoids pulling hisysevent-dependent production hooks into tests; hooks are DFX/observational and do not affect CRUD). Verified on device: slot MST 12/12 pass both runs; real notificationdb.db mtime unchanged; full unittest 99.5% pass (3255/3273), 18 failures in unmodified binaries (pre-existing). Co-Authored-By: Agent Signed-off-by: CheerfulRicky <yuegang7@h-partners.com> Change-Id: I7e076d07003d6e30813e0f0f72e7f6ad38b8186d Signed-off-by: CheerfulRicky <yuegang7@h-partners.com> | 9 天前 | |
错误码修改 Signed-off-by: 廖康康 <liaokangkang@huawei.com> | 3 年前 | |
fix(test): isolate test service DB to protect real notificationdb Make GetAnsNotificationRdbMgrInstance() a weak symbol and override it in a single shared test mock (frameworks/test/moduletest/mock) so the in-process service constructed by tests operates on an isolated temp DB (/data/local/tmp/ans_rdb_test_<pid>/notificationdb_test.db) instead of the real notificationdb.db. All affected test targets reference the single mock via absolute path (no duplicate files). Root cause: tests that call ClearNotificationInRestoreFactorySettings() invoke rdbDataManager_->Destroy() which deletes the DB file. Without an RDB mock, the real notificationdb.db is deleted on device, wiping real data. Scope: all tests calling ClearNotificationInRestoreFactorySettings without an RDB mock - ans_module_test (services/test/moduletest), 10 UT targets in services/ans/test/unittest (permission_filter, notification_service, live_view, slot, utils, snooze_delay, service_publish, preferences, ringtone, geofence), aggregation_test, badge_manager_test, plus the publish/slot moduletest. Review fixes: DestroyTestRdb now resets the static instance and removes the temp dir (rmdir); mkdir checks errno==EEXIST. Empty NtfRdbHook is intentional (nullptr-safe per docs, avoids pulling hisysevent-dependent production hooks into tests; hooks are DFX/observational and do not affect CRUD). Verified on device: slot MST 12/12 pass both runs; real notificationdb.db mtime unchanged; full unittest 99.5% pass (3255/3273), 18 failures in unmodified binaries (pre-existing). Co-Authored-By: Agent Signed-off-by: CheerfulRicky <yuegang7@h-partners.com> Change-Id: I7e076d07003d6e30813e0f0f72e7f6ad38b8186d Signed-off-by: CheerfulRicky <yuegang7@h-partners.com> | 9 天前 | |
tdd失败用例异常修复 Co-Authored-By: guxiang Signed-off-by: g00586423 <guxiang11@huawei.com> | 2 个月前 | |
fix(test): isolate test service DB to protect real notificationdb Make GetAnsNotificationRdbMgrInstance() a weak symbol and override it in a single shared test mock (frameworks/test/moduletest/mock) so the in-process service constructed by tests operates on an isolated temp DB (/data/local/tmp/ans_rdb_test_<pid>/notificationdb_test.db) instead of the real notificationdb.db. All affected test targets reference the single mock via absolute path (no duplicate files). Root cause: tests that call ClearNotificationInRestoreFactorySettings() invoke rdbDataManager_->Destroy() which deletes the DB file. Without an RDB mock, the real notificationdb.db is deleted on device, wiping real data. Scope: all tests calling ClearNotificationInRestoreFactorySettings without an RDB mock - ans_module_test (services/test/moduletest), 10 UT targets in services/ans/test/unittest (permission_filter, notification_service, live_view, slot, utils, snooze_delay, service_publish, preferences, ringtone, geofence), aggregation_test, badge_manager_test, plus the publish/slot moduletest. Review fixes: DestroyTestRdb now resets the static instance and removes the temp dir (rmdir); mkdir checks errno==EEXIST. Empty NtfRdbHook is intentional (nullptr-safe per docs, avoids pulling hisysevent-dependent production hooks into tests; hooks are DFX/observational and do not affect CRUD). Verified on device: slot MST 12/12 pass both runs; real notificationdb.db mtime unchanged; full unittest 99.5% pass (3255/3273), 18 failures in unmodified binaries (pre-existing). Co-Authored-By: Agent Signed-off-by: CheerfulRicky <yuegang7@h-partners.com> Change-Id: I7e076d07003d6e30813e0f0f72e7f6ad38b8186d Signed-off-by: CheerfulRicky <yuegang7@h-partners.com> | 9 天前 | |
tdd修改 Signed-off-by: 廖康康 <liaokangkang@huawei.com> | 3 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 8 天前 | ||
| 9 天前 | ||
| 3 年前 | ||
| 9 天前 | ||
| 2 个月前 | ||
| 9 天前 | ||
| 3 年前 |