From: sameeruddin shaik <sameeruddin.shaik8@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>,
Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: Re: Bug in Test code
Date: Tue, 13 Apr 2021 06:35:43 +0530 [thread overview]
Message-ID: <1fb3ff49-133c-2414-3de9-922dfb73fcc6@gmail.com> (raw)
In-Reply-To: <20210410222331.24d04032@oasis.local.home>
On 11/04/21 7:53 am, Steven Rostedt wrote:
> On Mon, 12 Apr 2021 06:43:44 +0530
> sameeruddin shaik <sameeruddin.shaik8@gmail.com> wrote:
>
>> hi,
>>
>> Test: tracing options ...FAILED
>> 1. tracefs-utest.c:746 - check_options_mask_empty(all)
>> 2. tracefs-utest.c:747 - check_options_mask_empty(enabled)
>> Test: custom system directory ...FAILED
>> 1. tracefs-utest.c:746 - check_options_mask_empty(all)
>> 2. tracefs-utest.c:747 - check_options_mask_empty(enabled)
>> Test: ftrace marker ...trace-utest: ../nptl/pthread_mutex_lock.c:81:
>> __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.
>> Aborted (core dumped)
>>
>>
>> Above tests are failing for me, what about you guys?
>>
>> Do i have to give any command line options when running the test ?
>>
>> I ran test like below
>>
>> -----------------------
>>
>> #./trace-utest
>>
>> -----------------------
>>
> Hi Sameer,
>
> Thanks for the report. Yes, it is a bug in the tests. We did a last
> minute change to have the options bitmask be stored in the instance and
> it is immutable, but did not update the tests. The below patch should
> fix it for you. Let us know if it does.
>
> Thanks!
>
> -- Steve
>
> diff --git a/utest/tracefs-utest.c b/utest/tracefs-utest.c
> index 1f48e6f..3407202 100644
> --- a/utest/tracefs-utest.c
> +++ b/utest/tracefs-utest.c
> @@ -679,7 +679,7 @@ out:
> return ret;
> }
>
> -static bool check_options_mask_empty(struct tracefs_options_mask *mask)
> +static bool check_options_mask_empty(const struct tracefs_options_mask *mask)
> {
> int i;
>
> @@ -692,8 +692,9 @@ static bool check_options_mask_empty(struct tracefs_options_mask *mask)
>
> static void test_instance_tracing_options(struct tracefs_instance *instance)
> {
> - struct tracefs_options_mask *enabled;
> - struct tracefs_options_mask *all, *all_copy;
> + const struct tracefs_options_mask *enabled;
> + const struct tracefs_options_mask *all_copy;
> + const struct tracefs_options_mask *all;
> enum tracefs_option_id i = 1;
> char file[PATH_MAX];
> const char *name;
> @@ -745,9 +746,6 @@ static void test_instance_tracing_options(struct tracefs_instance *instance)
> }
> CU_TEST(check_options_mask_empty(all));
> CU_TEST(check_options_mask_empty(enabled));
> -
> - free(all);
> - free(enabled);
> }
>
> static void test_tracing_options(void)
No steve it didn't resolved the issue,
root@sameeraaron-Lenovo-Z50-70:/home/sameeraaron/hobbies/libtracefs/utest#
./trace-utest
CUnit - A unit testing framework for C - Version 2.1-3
http://cunit.sourceforge.net/
*** Error in `./trace-utest': malloc(): memory corruption:
0x0000000001251670 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777f5)[0x7f7f8171f7f5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8215e)[0x7f7f8172a15e]
/lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x54)[0x7f7f8172c1d4]
/usr/local/lib64/libtraceevent.so.1(tep_register_print_string+0x1f)[0x7f7f81ea322c]
/usr/local/lib64/libtraceevent.so.1(tep_parse_printk_formats+0x10c)[0x7f7f81ea34cf]
./trace-utest[0x40bf2e]
./trace-utest[0x40bf9d]
./trace-utest[0x40c160]
./trace-utest(tracefs_local_events_system+0x48)[0x40c1c0]
./trace-utest[0x408c19]
/usr/lib/x86_64-linux-gnu/libcunit.so.1(+0x3e7e)[0x7f7f81a75e7e]
/usr/lib/x86_64-linux-gnu/libcunit.so.1(CU_run_all_tests+0x6e)[0x7f7f81a763be]
./trace-utest(main+0x10b)[0x403501]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f7f816c8840]
./trace-utest(_start+0x29)[0x4032a9]
--sameer.
next prev parent reply other threads:[~2021-04-12 1:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-12 1:13 Bug in Test code sameeruddin shaik
2021-04-11 2:23 ` Steven Rostedt
2021-04-13 1:05 ` sameeruddin shaik [this message]
2021-04-12 4:32 ` Tzvetomir Stoyanov
2021-04-14 1:03 ` Sameeruddin Shaik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1fb3ff49-133c-2414-3de9-922dfb73fcc6@gmail.com \
--to=sameeruddin.shaik8@gmail.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tz.stoyanov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).