This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/2] rewrite the case typemismatch


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]