RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1280272 - possible use of uninitialized values (found by address sanitizer at build time)
Summary: possible use of uninitialized values (found by address sanitizer at build time)
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: spice
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Default Assignee for SPICE Bugs
QA Contact: SPICE QE bug list
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-11 11:23 UTC by David Jaša
Modified: 2016-02-17 08:34 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-17 08:34:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
full build log (including less serious bugs - unused variables and results) (147.42 KB, text/plain)
2015-11-11 11:23 UTC, David Jaša
no flags Details

Description David Jaša 2015-11-11 11:23:55 UTC
Created attachment 1092642 [details]
full build log (including less serious bugs - unused variables and results)

Description of problem:
rebuild of spice-server with address sanitizer enabled yields these errors:
----
glz_encoder_dictionary.c: In function 'glz_dictionary_pre_encode':
glz_encoder_dictionary.c:512:30: warning: 'prev_seg_id' may be used uninitialized in this function [-Wmaybe-uninitialized]
             dict->window.segs[prev_seg_id].next = seg_id;
                              ^
glz_encoder_dictionary.c:488:22: note: 'prev_seg_id' was declared here
     uint32_t seg_id, prev_seg_id;
                      ^
----
red_channel.c: In function 'red_channel_client_wait_pipe_item_sent':
red_channel.c:2382:84: warning: 'end_time' may be used uninitialized in this function [-Wmaybe-uninitialized]
                                                      timeout == -1 ? -1 : end_time - red_now());
                                                                                    ^
----


Version-Release number of selected component (if applicable):
spice-server-0.12.4-15.el7.x86_64
libasan-4.8.5-4.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. grab a spice-server srpm, add these lines to %build section of .spec, rebuild:
# sanitizer, disable -debug pkg
%global optflags %(echo %{optflags} | sed 's/ -g / -ggdb -fno-omit-frame-pointer -fsanitize=address /')
%global __global_ldflags %(echo "%{__global_ldflags} -fsanitize=address -lasan")
%global __strip /bin/true
%global debug_package %{nil}
2.
3.

Actual results:
warnings from Description are emitted

Expected results:
bugs (if any) should be fixed, harmless warnings may deserver some explanation or suppression.

Additional info:

Comment 1 Fabiano Fidêncio 2015-11-11 11:41:27 UTC
(In reply to David Jaša from comment #0)
> Created attachment 1092642 [details]
> full build log (including less serious bugs - unused variables and results)
> 
> Description of problem:
> rebuild of spice-server with address sanitizer enabled yields these errors:
> ----
> glz_encoder_dictionary.c: In function 'glz_dictionary_pre_encode':
> glz_encoder_dictionary.c:512:30: warning: 'prev_seg_id' may be used
> uninitialized in this function [-Wmaybe-uninitialized]
>              dict->window.segs[prev_seg_id].next = seg_id;

Never happens.
This part of the code is just triggered when row != 0 and prev_seg_id is set in the first loop when row == 0.

>                               ^
> glz_encoder_dictionary.c:488:22: note: 'prev_seg_id' was declared here
>      uint32_t seg_id, prev_seg_id;
>                       ^
> ----
> red_channel.c: In function 'red_channel_client_wait_pipe_item_sent':
> red_channel.c:2382:84: warning: 'end_time' may be used uninitialized in this
> function [-Wmaybe-uninitialized]
>                                                       timeout == -1 ? -1 :
> end_time - red_now());
>                                                                             
> ^

Never happens as well.
Christophe has a fix and a really nice commit message about this false-positive: http://cgit.freedesktop.org/spice/spice/commit/?id=1b6ced7ddafd1bc6e490af091427327b05c96b3fg

Comment 2 Uri Lublin 2015-11-11 14:21:51 UTC
I agree with Fabiano these are false positives.

That's
http://cgit.freedesktop.org/spice/spice/commit/?id=1b6ced7ddafd1bc6e490af091427327b05c96b3f

Comment 3 Frediano Ziglio 2016-02-17 08:34:55 UTC
As comments these are false positive.


Note You need to log in before you can comment on or make changes to this bug.