Ubuntu Bionic, suspicious compiler warning

Bug #1913936 reported by Daniel Schürmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Low
Unassigned

Bug Description

I have noticed recently this suspicous compiler warning:

2021-01-28T01:06:07.1856464Z /home/runner/work/mixxx/mixxx/src/sources/soundsourceproxy.cpp: In member function ‘void SoundSourceProxy::updateTrackFromSource(SoundSourceProxy::ImportTrackMetadataMode)’:
2021-01-28T01:06:07.1864189Z ##[warning]/home/runner/work/mixxx/mixxx/src/sources/soundsourceproxy.cpp:542:16: warning: ‘*((void*)& preciseStreamInfo +16)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
2021-01-28T01:06:07.1943003Z const auto preciseStreamInfo = trackMetadata.getStreamInfo();
2021-01-28T01:06:07.1945857Z [ 59%] Building CXX object CMakeFiles/mixxx-lib.dir/src/sources/soundsourcesndfile.cpp.o
2021-01-28T01:06:07.1948536Z ^~~~~~~~~~~~~~~~~

I have tried to dig it down but gdb reports that preciseStreamInfo is not an lvalue, which is even more suspicious.

The address +16 points to OptionalSampleLayout.

I think using a optional here is wrong from the business logic anyway, because we can only use the described buffer if we know the sample layout.

I think I will provide a patch that fixes both in one run.

Changed in mixxx:
assignee: nobody → Uwe Klotz (uklotzde)
milestone: none → 2.3.0
status: New → In Progress
importance: Undecided → Critical
Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

Since the sample layout property causes confusion because the scope is unclear and it is still unused we should remove it.

Changed in mixxx:
importance: Critical → Low
Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

The old Bionic GCC seems to be buggy or this is a false positive.

Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

The warning could be caused by Q_PRIMITIVE_TYPE. I'll fix the metatype registrations.

Changed in mixxx:
status: In Progress → Fix Committed
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/10309

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.