From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44269 invoked by alias); 16 Feb 2017 19:01:27 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 44070 invoked by uid 48); 16 Feb 2017 19:01:14 -0000 From: "dsmith at redhat dot com" To: systemtap@sourceware.org Subject: [Bug translator/21173] New: odd translator behavior with overloaded functions Date: Thu, 16 Feb 2017 19:01:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: translator X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dsmith at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2017-q1/txt/msg00103.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D21173 Bug ID: 21173 Summary: odd translator behavior with overloaded functions Product: systemtap Version: unspecified Status: NEW Severity: normal Priority: P2 Component: translator Assignee: systemtap at sourceware dot org Reporter: dsmith at redhat dot com Target Milestone: --- Since bug #18431, the translator supports overloaded functions (2 functions with the same name but different parameters). However, in certain situation= s, this isn't acting correctly. Here's a test script: =3D=3D=3D=3D function foo:long(a:long, b:long) { return (a + b) } function foo:string(a:long, b:string, c:long) { return sprintf("%s %d", b, a + c) } probe begin { println(__inode_vfsmount(1)) println(foo(1, 2, 3)) } =3D=3D=3D=3D =3D=3D=3D=3D stap --compatible=3D2.9 -vp4 ../src/test.stp Pass 1: parsed user script and 465 library scripts using 135824virt/44664res/7380shr/37236data kb, in 240usr/50sys/293real ms. WARNING: Eliding unused function 'foo': identifier 'foo' at ../src/test.stp:1:10 source: function foo:long(a:long, b:long) ^ semantic error: unknown type in dereference: operator '&' at /usr/local/share/systemtap/tapset/linux/dentry.stp:93:24 source: head =3D &sb->s_mounts ^ Pass 2: analyzed script: 1 probe, 8 functions, 3 embeds, 0 globals using 285440virt/195264res/8548shr/186852data kb, in 1830usr/320sys/2167real ms. Pass 2: analysis failed. [man error::pass2] =3D=3D=3D=3D=3D There are at least 3 problems with that translator output: - It doesn't warn/error on the fact the 'foo' function variants has 2 diffe= rent return values. - Somehow this causes @cast() type errors to appear elsewhere. - It doesn't realize that there is no overload that takes 3 longs. It is possible the translator found the error earlier, but its message was suppressed and it incidentally resulted in shortcuting some other processing leading the @cast() or whatever to never be attempted. Note that if the 'foo' function call is fixed to call either function correctly, the script compiles just fine without any @cast-type errors. Also note that I found this while debugging a systemtap.stress/tapset_functions.= exp failure. --=20 You are receiving this mail because: You are the assignee for the bug.