public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 2/2] add new case for typemismatch
  2015-12-01  1:59 [PATCH 1/2] rewrite the case typemismatch Zhou Wenjian
@ 2015-12-01  1:59 ` Zhou Wenjian
  2015-12-01  3:16 ` [PATCH 1/2] rewrite the case typemismatch "Zhou, Wenjian/周文剑"
  1 sibling, 0 replies; 6+ messages in thread
From: Zhou Wenjian @ 2015-12-01  1:59 UTC (permalink / raw)
  To: systemtap

	* testsuite/semko/typemismatch4.stp: new test case
---
 testsuite/semko/typemismatch4.stp | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100755 testsuite/semko/typemismatch4.stp

diff --git a/testsuite/semko/typemismatch4.stp b/testsuite/semko/typemismatch4.stp
new file mode 100755
index 0000000..83af632
--- /dev/null
+++ b/testsuite/semko/typemismatch4.stp
@@ -0,0 +1,4 @@
+#! stap -p2
+
+probe begin { foo = "bar" ; foo = 1 ; print(foo) } 
+
-- 
1.8.3.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] rewrite the case typemismatch
@ 2015-12-01  1:59 Zhou Wenjian
  2015-12-01  1:59 ` [PATCH 2/2] add new case for typemismatch Zhou Wenjian
  2015-12-01  3:16 ` [PATCH 1/2] rewrite the case typemismatch "Zhou, Wenjian/周文剑"
  0 siblings, 2 replies; 6+ messages in thread
From: Zhou Wenjian @ 2015-12-01  1:59 UTC (permalink / raw)
  To: systemtap

	* testsuite/semko/typemismatch.stp: use the following cases to replace it

	* testsuite/semko/typemismatch1.stp
	* testsuite/semko/typemismatch2.stp
	* testsuite/semko/typemismatch3.stp
---
 testsuite/semko/typemismatch.stp  | 8 --------
 testsuite/semko/typemismatch1.stp | 8 ++++++++
 testsuite/semko/typemismatch2.stp | 4 ++++
 testsuite/semko/typemismatch3.stp | 3 +++
 4 files changed, 15 insertions(+), 8 deletions(-)
 delete mode 100755 testsuite/semko/typemismatch.stp
 create mode 100755 testsuite/semko/typemismatch1.stp
 create mode 100755 testsuite/semko/typemismatch2.stp
 create mode 100755 testsuite/semko/typemismatch3.stp

diff --git a/testsuite/semko/typemismatch.stp b/testsuite/semko/typemismatch.stp
deleted file mode 100755
index 94a49d5..0000000
--- a/testsuite/semko/typemismatch.stp
+++ /dev/null
@@ -1,8 +0,0 @@
-#! stap -p2
-
-
-global noo 
-
-probe begin { foo = 1 ; foo = "bar" ; noo = 4 } 
-
-probe end { foo = "zoo" ; foo <<< 2 ; noo = "zoo" }
\ No newline at end of file
diff --git a/testsuite/semko/typemismatch1.stp b/testsuite/semko/typemismatch1.stp
new file mode 100755
index 0000000..e60b376
--- /dev/null
+++ b/testsuite/semko/typemismatch1.stp
@@ -0,0 +1,8 @@
+#! stap -p2
+
+
+global noo 
+
+probe begin { noo = 4 } 
+
+probe end { noo = "zoo" }
diff --git a/testsuite/semko/typemismatch2.stp b/testsuite/semko/typemismatch2.stp
new file mode 100755
index 0000000..940582e
--- /dev/null
+++ b/testsuite/semko/typemismatch2.stp
@@ -0,0 +1,4 @@
+#! stap -p2
+
+
+probe begin { foo = 1 ; foo = "bar" ;  print(foo) } 
diff --git a/testsuite/semko/typemismatch3.stp b/testsuite/semko/typemismatch3.stp
new file mode 100755
index 0000000..74e367d
--- /dev/null
+++ b/testsuite/semko/typemismatch3.stp
@@ -0,0 +1,3 @@
+#! stap -p2
+
+probe begin { foo = "zoo" ; foo <<< 2 ; print(foo) }
-- 
1.8.3.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] rewrite the case typemismatch
  2015-12-01  1:59 [PATCH 1/2] rewrite the case typemismatch Zhou Wenjian
  2015-12-01  1:59 ` [PATCH 2/2] add new case for typemismatch Zhou Wenjian
@ 2015-12-01  3:16 ` "Zhou, Wenjian/周文剑"
  2015-12-01 16:33   ` David Smith
  1 sibling, 1 reply; 6+ messages in thread
From: "Zhou, Wenjian/周文剑" @ 2015-12-01  3:16 UTC (permalink / raw)
  To: David Smith; +Cc: systemtap

Hello David,

I will describe the bug in typemismatch in the following.

On 12/01/2015 09:57 AM, Zhou Wenjian wrote:
> 	* testsuite/semko/typemismatch.stp: use the following cases to replace it
>
> 	* testsuite/semko/typemismatch1.stp
> 	* testsuite/semko/typemismatch2.stp
> 	* testsuite/semko/typemismatch3.stp
> ---
>   testsuite/semko/typemismatch.stp  | 8 --------
>   testsuite/semko/typemismatch1.stp | 8 ++++++++
>   testsuite/semko/typemismatch2.stp | 4 ++++
>   testsuite/semko/typemismatch3.stp | 3 +++
>   4 files changed, 15 insertions(+), 8 deletions(-)
>   delete mode 100755 testsuite/semko/typemismatch.stp
>   create mode 100755 testsuite/semko/typemismatch1.stp
>   create mode 100755 testsuite/semko/typemismatch2.stp
>   create mode 100755 testsuite/semko/typemismatch3.stp
>
> diff --git a/testsuite/semko/typemismatch.stp b/testsuite/semko/typemismatch.stp
> deleted file mode 100755
> index 94a49d5..0000000
> --- a/testsuite/semko/typemismatch.stp
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -#! stap -p2
> -
> -
> -global noo
> -
> -probe begin { foo = 1 ; foo = "bar" ; noo = 4 }
> -
> -probe end { foo = "zoo" ; foo <<< 2 ; noo = "zoo" }

The 'foo = 1; foo = "bar";' and 'foo = "zoo" ; foo <<< 2;' will just cause some warnings,
and won't cause error.
It means the case just have the same coverage as typemismatch1.stp in the following.

So I rewrite it by the following cases.

> \ No newline at end of file
> diff --git a/testsuite/semko/typemismatch1.stp b/testsuite/semko/typemismatch1.stp
> new file mode 100755
> index 0000000..e60b376
> --- /dev/null
> +++ b/testsuite/semko/typemismatch1.stp
> @@ -0,0 +1,8 @@
> +#! stap -p2
> +
> +
> +global noo
> +
> +probe begin { noo = 4 }
> +
> +probe end { noo = "zoo" }
> diff --git a/testsuite/semko/typemismatch2.stp b/testsuite/semko/typemismatch2.stp
> new file mode 100755
> index 0000000..940582e
> --- /dev/null
> +++ b/testsuite/semko/typemismatch2.stp
> @@ -0,0 +1,4 @@
> +#! stap -p2
> +
> +
> +probe begin { foo = 1 ; foo = "bar" ;  print(foo) }
> diff --git a/testsuite/semko/typemismatch3.stp b/testsuite/semko/typemismatch3.stp
> new file mode 100755
> index 0000000..74e367d
> --- /dev/null
> +++ b/testsuite/semko/typemismatch3.stp
> @@ -0,0 +1,3 @@
> +#! stap -p2
> +
> +probe begin { foo = "zoo" ; foo <<< 2 ; print(foo) }
>


-- 
Thanks
Zhou


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] rewrite the case typemismatch
  2015-12-01  3:16 ` [PATCH 1/2] rewrite the case typemismatch "Zhou, Wenjian/周文剑"
@ 2015-12-01 16:33   ` David Smith
  2015-12-02  1:21     ` "Zhou, Wenjian/周文剑"
  0 siblings, 1 reply; 6+ messages in thread
From: David Smith @ 2015-12-01 16:33 UTC (permalink / raw)
  To: Zhou, Wenjian/周文剑; +Cc: systemtap

On 11/30/2015 09:15 PM, "Zhou, Wenjian/周文剑" wrote:
> Hello David,
> 
> I will describe the bug in typemismatch in the following.
> 
> On 12/01/2015 09:57 AM, Zhou Wenjian wrote:
>>     * testsuite/semko/typemismatch.stp: use the following cases to
>> replace it
>>
>>     * testsuite/semko/typemismatch1.stp
>>     * testsuite/semko/typemismatch2.stp
>>     * testsuite/semko/typemismatch3.stp
>> ---
>>   testsuite/semko/typemismatch.stp  | 8 --------
>>   testsuite/semko/typemismatch1.stp | 8 ++++++++
>>   testsuite/semko/typemismatch2.stp | 4 ++++
>>   testsuite/semko/typemismatch3.stp | 3 +++
>>   4 files changed, 15 insertions(+), 8 deletions(-)
>>   delete mode 100755 testsuite/semko/typemismatch.stp
>>   create mode 100755 testsuite/semko/typemismatch1.stp
>>   create mode 100755 testsuite/semko/typemismatch2.stp
>>   create mode 100755 testsuite/semko/typemismatch3.stp
>>
>> diff --git a/testsuite/semko/typemismatch.stp
>> b/testsuite/semko/typemismatch.stp
>> deleted file mode 100755
>> index 94a49d5..0000000
>> --- a/testsuite/semko/typemismatch.stp
>> +++ /dev/null
>> @@ -1,8 +0,0 @@
>> -#! stap -p2
>> -
>> -
>> -global noo
>> -
>> -probe begin { foo = 1 ; foo = "bar" ; noo = 4 }
>> -
>> -probe end { foo = "zoo" ; foo <<< 2 ; noo = "zoo" }
> 
> The 'foo = 1; foo = "bar";' and 'foo = "zoo" ; foo <<< 2;' will just
> cause some warnings,
> and won't cause error.

Hmm, if you are only seeing warnings there and not an error, something
is wrong. Here's what I get:

====
# stap -p2 testsuite/semko/typemismatch.stp
WARNING: Eliding assignment to 'foo': operator '=' at
testsuite/semko/typemismatch.stp:6:19
 source: probe begin { foo = 1 ; foo = "bar" ; noo = 4 }
                           ^
WARNING: Eliding side-effect-free expression : identifier 'foo' at :6:15
 source: probe begin { foo = 1 ; foo = "bar" ; noo = 4 }
                       ^
semantic error: type mismatch (string): identifier 'noo' at :8:39
        source: probe end { foo = "zoo" ; foo <<< 2 ; noo = "zoo" }
                                                      ^

semantic error: type was first inferred here (long): identifier 'noo' at
:6:39
        source: probe begin { foo = 1 ; foo = "bar" ; noo = 4 }
                                                      ^

Pass 2: analysis failed.  [man error::pass2]
Number of similar warning messages suppressed: 6.
Rerun with -v to see them.
[root@intel-wildcatpass-03 src]# echo $?
1
====

Do you not get those 2 semantic errors?

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] rewrite the case typemismatch
  2015-12-01 16:33   ` David Smith
@ 2015-12-02  1:21     ` "Zhou, Wenjian/周文剑"
  2015-12-08 19:20       ` David Smith
  0 siblings, 1 reply; 6+ messages in thread
From: "Zhou, Wenjian/周文剑" @ 2015-12-02  1:21 UTC (permalink / raw)
  To: David Smith; +Cc: systemtap

On 12/02/2015 12:33 AM, David Smith wrote:
> On 11/30/2015 09:15 PM, "Zhou, Wenjian/周文剑" wrote:
>> Hello David,
>>
>> I will describe the bug in typemismatch in the following.
>>
>> On 12/01/2015 09:57 AM, Zhou Wenjian wrote:
>>>      * testsuite/semko/typemismatch.stp: use the following cases to
>>> replace it
>>>
>>>      * testsuite/semko/typemismatch1.stp
>>>      * testsuite/semko/typemismatch2.stp
>>>      * testsuite/semko/typemismatch3.stp
>>> ---
>>>    testsuite/semko/typemismatch.stp  | 8 --------
>>>    testsuite/semko/typemismatch1.stp | 8 ++++++++
>>>    testsuite/semko/typemismatch2.stp | 4 ++++
>>>    testsuite/semko/typemismatch3.stp | 3 +++
>>>    4 files changed, 15 insertions(+), 8 deletions(-)
>>>    delete mode 100755 testsuite/semko/typemismatch.stp
>>>    create mode 100755 testsuite/semko/typemismatch1.stp
>>>    create mode 100755 testsuite/semko/typemismatch2.stp
>>>    create mode 100755 testsuite/semko/typemismatch3.stp
>>>
>>> diff --git a/testsuite/semko/typemismatch.stp
>>> b/testsuite/semko/typemismatch.stp
>>> deleted file mode 100755
>>> index 94a49d5..0000000
>>> --- a/testsuite/semko/typemismatch.stp
>>> +++ /dev/null
>>> @@ -1,8 +0,0 @@
>>> -#! stap -p2
>>> -
>>> -
>>> -global noo
>>> -
>>> -probe begin { foo = 1 ; foo = "bar" ; noo = 4 }
>>> -
>>> -probe end { foo = "zoo" ; foo <<< 2 ; noo = "zoo" }
>>
>> The 'foo = 1; foo = "bar";' and 'foo = "zoo" ; foo <<< 2;' will just
>> cause some warnings,
>> and won't cause error.
>
> Hmm, if you are only seeing warnings there and not an error, something
> is wrong. Here's what I get:
>
> ====
> # stap -p2 testsuite/semko/typemismatch.stp
> WARNING: Eliding assignment to 'foo': operator '=' at
> testsuite/semko/typemismatch.stp:6:19
>   source: probe begin { foo = 1 ; foo = "bar" ; noo = 4 }
>                             ^
> WARNING: Eliding side-effect-free expression : identifier 'foo' at :6:15
>   source: probe begin { foo = 1 ; foo = "bar" ; noo = 4 }
>                         ^
> semantic error: type mismatch (string): identifier 'noo' at :8:39
>          source: probe end { foo = "zoo" ; foo <<< 2 ; noo = "zoo" }
>                                                        ^
>
> semantic error: type was first inferred here (long): identifier 'noo' at
> :6:39
>          source: probe begin { foo = 1 ; foo = "bar" ; noo = 4 }
>                                                        ^
>
> Pass 2: analysis failed.  [man error::pass2]
> Number of similar warning messages suppressed: 6.
> Rerun with -v to see them.
> [root@intel-wildcatpass-03 src]# echo $?
> 1
> ====
>
> Do you not get those 2 semantic errors?
>

Yes, I got those. But these two errors are only the result of "noo".
They have nothing to do with the behaviour of "foo".

On the other hand, even if the operation of "foo" is exact right, the
case will also pass.

-- 
Thanks
Zhou


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] rewrite the case typemismatch
  2015-12-02  1:21     ` "Zhou, Wenjian/周文剑"
@ 2015-12-08 19:20       ` David Smith
  0 siblings, 0 replies; 6+ messages in thread
From: David Smith @ 2015-12-08 19:20 UTC (permalink / raw)
  To: Zhou, Wenjian/周文剑; +Cc: systemtap

On 12/01/2015 07:18 PM, "Zhou, Wenjian/周文剑" wrote:
> On 12/02/2015 12:33 AM, David Smith wrote:
>> Do you not get those 2 semantic errors?
>>
> 
> Yes, I got those. But these two errors are only the result of "noo".
> They have nothing to do with the behaviour of "foo".
> 
> On the other hand, even if the operation of "foo" is exact right, the
> case will also pass.

Ah, I understand now. I've checked in your typemismatch patches.

Thanks!

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-12-08 19:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-01  1:59 [PATCH 1/2] rewrite the case typemismatch Zhou Wenjian
2015-12-01  1:59 ` [PATCH 2/2] add new case for typemismatch Zhou Wenjian
2015-12-01  3:16 ` [PATCH 1/2] rewrite the case typemismatch "Zhou, Wenjian/周文剑"
2015-12-01 16:33   ` David Smith
2015-12-02  1:21     ` "Zhou, Wenjian/周文剑"
2015-12-08 19:20       ` David Smith

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 read-only IMAP folder(s) and NNTP newsgroup(s).