public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/10015] New: Possible uninitialized variable use in sym.c
@ 2009-03-30 21:27 wcohen at redhat dot com
  2009-03-30 21:28 ` [Bug runtime/10015] " wcohen at redhat dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: wcohen at redhat dot com @ 2009-03-30 21:27 UTC (permalink / raw)
  To: systemtap

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2886 bytes --]

When attempting to build a script on a i386 rawhide (10.92) machine that
included information to map function addresses back to function names. Got the
following errors:

$ stap -vv -d kernel irq_handler.stp
SystemTap translator/driver (version 0.9.5/0.140 non-git sources)
Copyright (C) 2005-2009 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
Session arch: i686 release: 2.6.29-tip
Created temporary directory "/tmp/stap64bt2H"
Searched '/usr/share/systemtap/tapset/i686/*.stp', found 2
Searched '/usr/share/systemtap/tapset/*.stp', found 47
Pass 1: parsed user script and 49 library script(s) in 360usr/40sys/407real ms.
Pass 2: analyzed script: 7 probe(s), 12 function(s), 1 embed(s), 4 global(s) in
10usr/0sys/8real ms.
Pass 3: using cached
/home/wcohen/.systemtap/cache/25/stapconf_258b8dc563ca047577403e2b366c90ba_390.h
probe_1386 locks irq_s_time[w] 
probe_1387 locks action_handle[rw] action_time[rw] action_count[rw] irq_s_time[rw] 
probe_1392 elided, duplicates probe_1391
dump_unwindsyms kernel index=0 base=0xc0400000
Found build-id in kernel, length 20, end at 0xc07086ec
Pass 3: translated to C into
"/tmp/stap64bt2H/stap_a5e311addcab7ea936bb837cfca946af_4582.c" in
960usr/3250sys/4218real ms.
Running make -C "/lib/modules/2.6.29-tip/build" M="/tmp/stap64bt2H" modules
>/dev/null
cc1: warnings being treated as errors
/tmp/stap64bt2H/stap_a5e311addcab7ea936bb837cfca946af_4582.c: In function
‘probe_1389’:
/usr/share/systemtap/runtime/sym.c:239: error: ‘modname’ may be used
uninitialized in this function
/usr/share/systemtap/runtime/sym.c:239: note: ‘modname’ was declared here
/usr/share/systemtap/runtime/sym.c:241: error: ‘offset’ may be used
uninitialized in this function
/usr/share/systemtap/runtime/sym.c:241: note: ‘offset’ was declared here
/usr/share/systemtap/runtime/sym.c:241: error: ‘size’ may be used uninitialized
in this function
/usr/share/systemtap/runtime/sym.c:241: note: ‘size’ was declared here
make[1]: *** [/tmp/stap64bt2H/stap_a5e311addcab7ea936bb837cfca946af_4582.o] Error 1
make: *** [_module_/tmp/stap64bt2H] Error 2
Pass 4: compiled C into "stap_a5e311addcab7ea936bb837cfca946af_4582.ko" in
2440usr/850sys/3858real ms.
Pass 4: compilation failed.  Try again with another '--vp 0001' option.
Running rm -rf /tmp/stap64bt2H

Note that things compile without the "-d kernel"

-- 
           Summary: Possible uninitialized variable use in sym.c
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: wcohen at redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=10015

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug runtime/10015] Possible uninitialized variable use in sym.c
  2009-03-30 21:27 [Bug runtime/10015] New: Possible uninitialized variable use in sym.c wcohen at redhat dot com
@ 2009-03-30 21:28 ` wcohen at redhat dot com
  2009-03-30 21:29 ` wcohen at redhat dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: wcohen at redhat dot com @ 2009-03-30 21:28 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From wcohen at redhat dot com  2009-03-30 18:45 -------
Created an attachment (id=3855)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=3855&action=view)
example that triggers the bug


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10015

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug runtime/10015] Possible uninitialized variable use in sym.c
  2009-03-30 21:27 [Bug runtime/10015] New: Possible uninitialized variable use in sym.c wcohen at redhat dot com
  2009-03-30 21:28 ` [Bug runtime/10015] " wcohen at redhat dot com
@ 2009-03-30 21:29 ` wcohen at redhat dot com
  2009-04-01  1:46 ` wenji dot huang at oracle dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: wcohen at redhat dot com @ 2009-03-30 21:29 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From wcohen at redhat dot com  2009-03-30 18:47 -------
GCC on rawhide looks like it is a bit better at finding this type of issue.
Shouldn't _stp_kallsyms_lookup() be initializing those variables?

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10015

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug runtime/10015] Possible uninitialized variable use in sym.c
  2009-03-30 21:27 [Bug runtime/10015] New: Possible uninitialized variable use in sym.c wcohen at redhat dot com
  2009-03-30 21:28 ` [Bug runtime/10015] " wcohen at redhat dot com
  2009-03-30 21:29 ` wcohen at redhat dot com
@ 2009-04-01  1:46 ` wenji dot huang at oracle dot com
  2009-11-13  9:19 ` wenji dot huang at oracle dot com
  2009-11-13 12:38 ` fche at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: wenji dot huang at oracle dot com @ 2009-04-01  1:46 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From wenji dot huang at oracle dot com  2009-04-01 01:46 -------
This part is copy code from kernel/kallsyms.c. The variables can't be used
but uninitialized. Seems gcc on rawhide doesn't understand it well. Anyway,
we can get by it through uninitialized_var.

diff --git a/runtime/sym.c b/runtime/sym.c
index 1d88a86..be05354 100644
--- a/runtime/sym.c
+++ b/runtime/sym.c
@@ -236,9 +236,9 @@ static int _stp_module_check(void)
 
 static void _stp_symbol_print(unsigned long address)
 {
-       const char *modname;
+       const char *uninitialized_var(modname);
        const char *name;
-       unsigned long offset, size;
+       unsigned long uninitialized_var(offset), uninitialized_var(size);
 
        name = _stp_kallsyms_lookup(address, &size, &offset, &modname, NULL);


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10015

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug runtime/10015] Possible uninitialized variable use in sym.c
  2009-03-30 21:27 [Bug runtime/10015] New: Possible uninitialized variable use in sym.c wcohen at redhat dot com
                   ` (2 preceding siblings ...)
  2009-04-01  1:46 ` wenji dot huang at oracle dot com
@ 2009-11-13  9:19 ` wenji dot huang at oracle dot com
  2009-11-13 12:38 ` fche at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: wenji dot huang at oracle dot com @ 2009-11-13  9:19 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From wenji dot huang at oracle dot com  2009-11-13 09:19 -------
Found the commit

author	Frank Ch. Eigler <fche@elastic.org>
        Fri, 17 Jul 2009 22:04:24 +0000 (18:04 -0400)
committer Frank Ch. Eigler <fche@elastic.org>
	 Fri, 17 Jul 2009 22:04:57 +0000 (18:04 -0400)
commit	99975394710f2069e28738de0c97c28d0c717d61

PR6961: gcc warning tweak

* sym.c (_stp_symbol_print): (Redundantly) initialize locals.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


http://sourceware.org/bugzilla/show_bug.cgi?id=10015

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug runtime/10015] Possible uninitialized variable use in sym.c
  2009-03-30 21:27 [Bug runtime/10015] New: Possible uninitialized variable use in sym.c wcohen at redhat dot com
                   ` (3 preceding siblings ...)
  2009-11-13  9:19 ` wenji dot huang at oracle dot com
@ 2009-11-13 12:38 ` fche at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: fche at redhat dot com @ 2009-11-13 12:38 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From fche at redhat dot com  2009-11-13 12:38 -------
committed

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=10015

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

end of thread, other threads:[~2009-11-13 12:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-30 21:27 [Bug runtime/10015] New: Possible uninitialized variable use in sym.c wcohen at redhat dot com
2009-03-30 21:28 ` [Bug runtime/10015] " wcohen at redhat dot com
2009-03-30 21:29 ` wcohen at redhat dot com
2009-04-01  1:46 ` wenji dot huang at oracle dot com
2009-11-13  9:19 ` wenji dot huang at oracle dot com
2009-11-13 12:38 ` fche at redhat dot com

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).