Re: [PATCH RESEND 3/3] kunit: Init and run test suites in the right state

2023-10-06 Thread Ruan Jinjie
On 2023/9/29 0:42, Marco Pagani wrote: > > > On 2023-09-28 11:14, Jinjie Ruan wrote: >> As Marco pointed out, commit 2810c1e99867 ("kunit: Fix wild-memory-access >> bug in kunit_free_suite_set()") causes test suites to run while the test >> module is still in MODULE_STATE_COMING. In that state

Re: [PATCH] kunit: Fix a null-ptr-deref bug in kunit_run_case_catch_errors()

2023-09-26 Thread Ruan Jinjie
Ping. On 2023/9/15 15:41, Jinjie Ruan wrote: > Inject fault while probing kunit-test.ko, the below null-ptr-deref > occurs. > > In kunit_run_case_catch_errors(), if the first kunit_try_catch_run() > fails in kthread_run(), the kunit_try_run_case() will not run, so the > kunit_resource_test_init()

Re: [PATCH v2 4/4] kunit: test: Fix the possible memory leak in executor_test

2023-09-22 Thread Ruan Jinjie
On 2023/9/22 15:34, David Gow wrote: > On Thu, 21 Sept 2023 at 09:41, 'Jinjie Ruan' via KUnit Development > wrote: >> >> When CONFIG_KUNIT_ALL_TESTS=y, making CONFIG_DEBUG_KMEMLEAK=y and >> CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected. >> >> If kunit_filter_suites() succ

Re: [PATCH v2 4/4] kunit: test: Fix the possible memory leak in executor_test

2023-09-21 Thread Ruan Jinjie
On 2023/9/22 3:50, Rae Moar wrote: > On Wed, Sep 20, 2023 at 9:41 PM 'Jinjie Ruan' via KUnit Development > wrote: >> >> When CONFIG_KUNIT_ALL_TESTS=y, making CONFIG_DEBUG_KMEMLEAK=y and >> CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected. >> >> If kunit_filter_suites() succe

Re: [PATCH 4/4] kunit: test: Fix the possible memory leak in executor_test

2023-09-20 Thread Ruan Jinjie
On 2023/9/20 5:19, Rae Moar wrote: > On Thu, Sep 14, 2023 at 7:47 AM 'Jinjie Ruan' via KUnit Development > wrote: >> >> If kunit_filter_suites() succeeds, not only copy but also filtered_suite >> and filtered_suite->test_cases should be freed. >> >> So use kunit_free_suite_set() to free the fil

Re: [PATCH 4/4] kunit: test: Fix the possible memory leak in executor_test

2023-09-19 Thread Ruan Jinjie
On 2023/9/20 5:19, Rae Moar wrote: > On Thu, Sep 14, 2023 at 7:47 AM 'Jinjie Ruan' via KUnit Development > wrote: >> >> If kunit_filter_suites() succeeds, not only copy but also filtered_suite >> and filtered_suite->test_cases should be freed. >> >> So use kunit_free_suite_set() to free the fil

Re: [PATCH 3/4] kunit: Fix possible memory leak in kunit_filter_suites()

2023-09-19 Thread Ruan Jinjie
On 2023/9/20 5:18, Rae Moar wrote: > On Thu, Sep 14, 2023 at 7:47 AM 'Jinjie Ruan' via KUnit Development > wrote: >> >> If the outer layer for loop is iterated more than once and it fails not >> in the first iteration, the filtered_suite and filtered_suite->test_cases >> allocated in the last k

Re: [PATCH v2 1/2] mm/damon/core-test: Fix memory leak in damon_new_region()

2023-09-18 Thread Ruan Jinjie
On 2023/9/18 19:00, SeongJae Park wrote: > Hi Jinjie, > > On Mon, 18 Sep 2023 15:47:58 +0800 Jinjie Ruan wrote: > >> When CONFIG_DAMON_KUNIT_TEST=y and making CONFIG_DEBUG_KMEMLEAK=y >> and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected. >> >> The damon_region which is a

Re: [PATCH RESEND 2/2] mm/damon/core-test: Fix memory leak in damon_new_ctx()

2023-09-18 Thread Ruan Jinjie
On 2023/9/18 13:43, SeongJae Park wrote: > Hi Jinjie, > > On Mon, 18 Sep 2023 13:10:44 +0800 Jinjie Ruan wrote: > >> The damon_ctx which is allocated by kzalloc() in damon_new_ctx() in >> damon_test_ops_registration() and damon_test_set_attrs() are not freed and >> it causes below memory leak

Re: [PATCH RESEND 1/2] mm/damon/core-test: Fix memory leak in damon_new_region()

2023-09-18 Thread Ruan Jinjie
On 2023/9/18 13:33, SeongJae Park wrote: > Hi Jinjie, > > > Thank you for this patchset! > > On Mon, 18 Sep 2023 13:10:43 +0800 Jinjie Ruan wrote: > >> The damon_region which is allocated by kmem_cache_alloc() in >> damon_new_region() in damon_test_regions() and >> damon_test_update_monitor