From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18563 invoked by alias); 5 Aug 2012 18:25:59 -0000 Received: (qmail 18515 invoked by uid 22791); 5 Aug 2012 18:25:58 -0000 X-SWARE-Spam-Status: No, hits=-3.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_DW,TW_FL X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 05 Aug 2012 18:25:46 +0000 From: "mjw at redhat dot com" To: systemtap@sourceware.org Subject: [Bug translator/14434] New: dwflpp sometimes caches incomplete class_type Date: Sun, 05 Aug 2012 18:25: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mjw at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-q3/txt/msg00152.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=14434 Bug #: 14434 Summary: dwflpp sometimes caches incomplete class_type Product: systemtap Version: unspecified Status: NEW Severity: normal Priority: P2 Component: translator AssignedTo: systemtap@sourceware.org ReportedBy: mjw@redhat.com Classification: Unclassified Take the following program: :::::::::::::: header.hxx :::::::::::::: #include class Heap { private: char *_memory; size_t _size; public: Heap(); void* allocate (size_t size); static size_t header_size(); }; :::::::::::::: heap.cxx :::::::::::::: #include "header.hxx" size_t Heap::header_size () { return 42; } Heap::Heap() { _size = header_size () + 32; _memory = (char *) malloc (_size); } void* Heap::allocate(size_t size) { _size += size; return _memory + header_size(); } :::::::::::::: main.cxx :::::::::::::: #include "header.hxx" int size (int resize) { return (int)Heap::header_size() - resize; } int main (int argc, char **argv) { return size (argc); } Compile it with g++ 4.7.1: $ g++ -g -O2 -c main.cxx $ g++ -g -O2 -c heap.cxx $ g++ -g main.o heap.o -o prog Now try inspecting it with stap a couple of times and notice it occasionally fails. In this example we are interested in the offset of one of the field members of the Heap class and use @cast on address zero to get it: $ stap -p2 -v -e 'probe process("./prog").function("main") { printf("_size member offset: %d\n", &@cast(0, "Heap")->_size); }' > /dev/null Pass 1: parsed user script and 96 library script(s) using 212776virt/34756res/3024shr/32128data kb, in 110usr/10sys/127real ms. Pass 2: analyzed script: 1 probe(s), 1 function(s), 0 embed(s), 0 global(s) using 215824virt/36464res/3588shr/33056data kb, in 10usr/0sys/7real ms. $ stap -p2 -v -e 'probe process("./prog").function("main") { printf("_size member offset: %d\n", &@cast(0, "Heap")->_size); }' > /dev/null Pass 1: parsed user script and 96 library script(s) using 212776virt/34756res/3024shr/32128data kb, in 110usr/10sys/129real ms. Pass 2: analyzed script: 1 probe(s), 1 function(s), 0 embed(s), 0 global(s) using 215824virt/36464res/3588shr/33056data kb, in 10usr/0sys/7real ms. $ stap -p2 -v -e 'probe process("./prog").function("main") { printf("_size member offset: %d\n", &@cast(0, "Heap")->_size); }' > /dev/null Pass 1: parsed user script and 96 library script(s) using 212776virt/34756res/3024shr/32128data kb, in 120usr/10sys/128real ms. semantic error: unable to find member '_size' for class Heap: operator '->' at :1:97 source: probe process("./prog").function("main") { printf("_size member offset: %d\n", &@cast(0, "Heap")->_size); } ^ Pass 2: analyzed script: 1 probe(s), 0 function(s), 0 embed(s), 0 global(s) using 213716virt/36340res/3476shr/33052data kb, in 10usr/0sys/7real ms. Pass 2: analysis failed. Try again with another '--vp 01' option. Isn't that weird! It worked 2 out of 3 times, but then it suddenly failed. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.