Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEBUG ASSERT: "pMadStream->error == MAD_ERROR_NONE" #11521

Closed
JoergAtGithub opened this issue Apr 30, 2023 · 12 comments
Closed

DEBUG ASSERT: "pMadStream->error == MAD_ERROR_NONE" #11521

JoergAtGithub opened this issue Apr 30, 2023 · 12 comments

Comments

@JoergAtGithub
Copy link
Member

JoergAtGithub commented Apr 30, 2023

Bug Description

With local 2.4 (d2d685c) builds I get thefollowing assertion for every MP3 file I load while simple .wav files can be loaded.
If I download the Github CI build artifact from 2.4 (d2d685c), MP3 files can be loaded whith this build - no assertion in developer mode.

DEBUG ASSERT: "pMadStream->error == MAD_ERROR_NONE" in function bool __cdecl mixxx::`anonymous-namespace'::decodeFrameHeader(struct mad_header *,struct mad_stream *,bool)

>	mixxx.exe!mixxx::`anonymous namespace'::handleMessage(QtMsgType type, const QMessageLogContext & context, const QString & input) Line 355	C++
 	[External Code]	
 	[Inline Frame] mixxx.exe!mixxx_debug_assert(const char *) Line 9	C++
 	mixxx.exe!mixxx::`anonymous namespace'::decodeFrameHeader(mad_header * pMadHeader, mad_stream * pMadStream, bool skipId3Tag) Line 156	C++
 	mixxx.exe!mixxx::SoundSourceMp3::tryOpen(mixxx::AudioSource::OpenMode __formal, const mixxx::AudioSource::OpenParams & __formal) Line 260	C++
 	mixxx.exe!mixxx::AudioSource::open(mixxx::AudioSource::OpenMode mode, const mixxx::AudioSource::OpenParams & params) Line 40	C++
 	mixxx.exe!SoundSourceProxy::openSoundSource(const mixxx::AudioSource::OpenParams & params) Line 865	C++
 	mixxx.exe!SoundSourceProxy::openAudioSource(const mixxx::AudioSource::OpenParams & params) Line 930	C++
 	mixxx.exe!CachingReaderWorker::loadTrack(const std::shared_ptr<Track> & pTrack) Line 192	C++
 	mixxx.exe!CachingReaderWorker::run() Line 125	C++
 	[External Code]	
<title>Document</title>
  Name Value Type
pMadHeader 0x0000001503fff050 {layer=MAD_LAYER_III (3) mode=MAD_MODE_STEREO (3) mode_extension=0 ...} mad_header *
pMadStream 0x000001fbe9e7a420 {buffer=0x000001fbeeda0000 "ID3\x3" bufend=0x000001fbefe7c433 "" skiplen=0 ...} mad_stream *
  ▶ buffer 0x000001fbeeda0000 "ID3\x3" const unsigned char *
  ▶ bufend 0x000001fbefe7c433 "" const unsigned char *
  skiplen 0 unsigned long
  sync 1 int
  freerate 0 unsigned long
  ▶ this_frame 0x000001fbeedc4291 "ÿûâ" const unsigned char *
  ▶ next_frame 0x000001fbeedc46a6 "ÿûâ" const unsigned char *
  ▶ ptr {byte=0x000001fbeedc4295 "" cache=0 left=8 } mad_bitptr
  ▶ anc_ptr {byte=0x0000000000000000 cache=0 left=8 } mad_bitptr
  anc_bitlen 0 unsigned int
  ▶ main_data 0x0000000000000000 {???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ...} unsigned char[2567] *
  md_len 0 unsigned int
  options 1 int
  error MAD_ERROR_LOSTSYNC (257) mad_error
  skipId3Tag Variable is optimized away and not available.  
  tagsize Variable is optimized away and not available.  

Local CTests also fail:

The following tests FAILED:
	506 - PlayerManagerTest.UnEjectTest (Failed)
	507 - PlayerManagerTest.UnEjectReplaceTrackTest (Failed)
	700 - SoundSourceProxyTest.open (Failed)
	705 - SoundSourceProxyTest.seekForwardBackward (Failed)
	706 - SoundSourceProxyTest.skipAndRead (Failed)
	707 - SoundSourceProxyTest.seekBoundaries (Failed)
	708 - SoundSourceProxyTest.readBeyondEnd (Failed)
	709 - SoundSourceProxyTest.regressionTestCachingReaderChunkJumpForward (Failed)
	721 - LibraryFileWithMetadataSyncStatusSynchronizedTest.saveTrackMetadataWithSyncEnabled (Failed)
	727 - LibraryFileWithMetadataSyncStatusOutdatedTest.saveTrackMetadataWithSyncEnabled (Failed)
	729 - LibraryFileWithMetadataSyncStatusOutdatedTest.reimportTrackMetadataWithSyncEnabled (Failed)
	735 - LibraryFileWithMetadataSyncStatusUnknownTest.saveTrackMetadataWithSyncEnabled (Failed)

Currently, I don't understand what happens

Version

2.3 & 2.4

OS

Windows 11

@JoergAtGithub
Copy link
Member Author

I just built #11513 and have the same issue with this local 2.3 build.

@JoergAtGithub
Copy link
Member Author

Reverting the changes from #11168 fixes this!

@JoergAtGithub JoergAtGithub added this to the 2.3.5 milestone May 1, 2023
@daschuer
Copy link
Member

daschuer commented May 1, 2023

I am looking into that.

@daschuer
Copy link
Member

daschuer commented May 1, 2023

That is strange. I am not able to reproduce the issue with Ubuntu Focal and the current 2.4 and 2.3 branch and Mixxx git 2.3.4-49-g29c1ed0080 is also working on my Windows 10 virtual machine.

Did you actually test local builds of the 2.3 branch?

What could be the difference between your setup and the GitHub workflow runner? Are Debug and Release builds affected?
Which compiler do you use?

The issue looks like as if mad_header_decode() returns 0, but sets also an error to MAD_ERROR_LOSTSYNC. So it might be a build/linker issue with libmad itself. Can it be a cached object file form #4866?

@JoergAtGithub
Copy link
Member Author

Can it be a cached object file form #4866?

No, I deleted my whole Mixxx directory. But let me try, if a clang-cl build is also affected.

@JoergAtGithub
Copy link
Member Author

The compiler makes no difference, here are some details (of the assertion with the clang-cl build):

  Name Value Type
m_pSoundSource shared_ptr {m_file={...} m_fileSize=15694151 m_pFileData=0x000001ee6a010000 "ID3\x3" ...} [1 strong ref] [make_shared] std::shared_ptrmixxx::SoundSource
  openMode Strict (0) mixxx::AudioSource::OpenMode
params {m_signalInfo={m_channelCount={m_value=2 '\x2' } m_sampleRate={m_value=0 } } } const mixxx::AudioSource::OpenParams &
  ▶ m_signalInfo {m_channelCount={m_value=2 '\x2' } m_sampleRate={m_value=0 } } mixxx::audio::SignalInfo
this 0x000000ae265ffa50 {m_pTrack=shared_ptr {m_qMutex={...} m_fileAccess={m_fileInfo={m_fileInfo={d_ptr={...} } } m_pSecurityToken=strong reference to shared pointer of type "SandboxSecurityToken" } ...} [6 strong refs, 1 weak ref] [{_Uses=6 _Weaks=2 }] ...} SoundSourceProxy *
  ▶ m_pTrack shared_ptr {m_qMutex={...} m_fileAccess={m_fileInfo={m_fileInfo={d_ptr={...} } } m_pSecurityToken=strong reference to shared pointer of type "SandboxSecurityToken" } ...} [6 strong refs, 1 weak ref] [{_Uses=6 _Weaks=2 }] const std::shared_ptr
  ▶ m_url file:///C:/Users/Joerg.WORLDWARTWEB/Music/2pac feat Dr. Dre - California Love (Dash Berlin Rework).mp3 const QUrl
  ▶ m_providerRegistrations { size = 1 } const QListmixxx::SoundSourceProviderRegistration
  m_providerRegistrationIndex 0 int
  ▶ m_pProvider shared_ptr {...} [3 strong refs] [make_shared] std::shared_ptrmixxx::SoundSourceProvider
  ◢ m_pSoundSource shared_ptr {m_file={...} m_fileSize=15694151 m_pFileData=0x000001ee6a010000 "ID3\x3" ...} [1 strong ref] [make_shared] std::shared_ptrmixxx::SoundSource
  ◢ [ptr] 0x000001ee6942c5e0 {m_file={...} m_fileSize=15694151 m_pFileData=0x000001ee6a010000 "ID3\x3" ...} mixxx::SoundSource * {mixxx::SoundSourceMp3}
  ▶ [mixxx::SoundSourceMp3] {m_file={...} m_fileSize=15694151 m_pFileData=0x000001ee6a010000 "ID3\x3" ...} mixxx::SoundSourceMp3
  ◢ mixxx::AudioSource {m_signalInfo={m_channelCount={m_value=0 '\0' } m_sampleRate={m_value=0 } } m_bitrate={m_value=0 } m_frameIndexRange=...} mixxx::AudioSource
  ▶ mixxx::UrlResource {m_url=file:///C:/Users/Joerg.WORLDWARTWEB/Music/2pac feat Dr. Dre - California Love (Dash Berlin Rework).mp3 } mixxx::UrlResource
  ▶ mixxx::IAudioSourceReader {...} mixxx::IAudioSourceReader
  ▶ m_signalInfo {m_channelCount={m_value=0 '\0' } m_sampleRate={m_value=0 } } mixxx::audio::SignalInfo
  ▶ m_bitrate {m_value=0 } mixxx::audio::Bitrate
  ▶ m_frameIndexRange (0, 0) mixxx::IndexRange
  ◢ mixxx::MetadataSourceTagLib {m_fileName=C:/Users/Joerg.WORLDWARTWEB/Music/2pac feat Dr. Dre - California Love (Dash Berlin Rework).mp3 ...} mixxx::MetadataSourceTagLib
  ▶ mixxx::MetadataSource {...} mixxx::MetadataSource
  ▶ m_fileName C:/Users/Joerg.WORLDWARTWEB/Music/2pac feat Dr. Dre - California Love (Dash Berlin Rework).mp3 QString
  m_fileType MP3 (3) mixxx::taglib::FileType
  ▶ mixxx::IAudioSourceReader {...} mixxx::IAudioSourceReader
  ▶ m_type mp3 QString
  ◢ [control block] make_shared std::_Ref_count_base {std::_Ref_count_obj2mixxx::SoundSourceMp3}
  ◢ [original ptr] 0x000001ee6942c5e0 {m_file={...} m_fileSize=15694151 m_pFileData=0x000001ee6a010000 "ID3\x3" ...} mixxx::SoundSourceMp3 *
  ◢ mixxx::SoundSource {m_type=mp3 } mixxx::SoundSource
  ▶ mixxx::AudioSource {m_signalInfo={m_channelCount={m_value=0 '\0' } m_sampleRate={m_value=0 } } m_bitrate={m_value=0 } m_frameIndexRange=...} mixxx::AudioSource
  ◢ mixxx::MetadataSourceTagLib {m_fileName=C:/Users/Joerg.WORLDWARTWEB/Music/2pac feat Dr. Dre - California Love (Dash Berlin Rework).mp3 ...} mixxx::MetadataSourceTagLib
  ▶ mixxx::MetadataSource {...} mixxx::MetadataSource
  ▶ m_fileName C:/Users/Joerg.WORLDWARTWEB/Music/2pac feat Dr. Dre - California Love (Dash Berlin Rework).mp3 QString
  m_fileType MP3 (3) mixxx::taglib::FileType
  ▶ mixxx::IAudioSourceReader {...} mixxx::IAudioSourceReader
  ◢ m_type mp3 QString
  [size] 3 int
  ▶ [referenced] -1 std::atomic
  [0] 109 'm' unsigned short
  [1] 112 'p' unsigned short
  [2] 51 '3' unsigned short
  ▶ [Raw View] {d=0x00007ff6e5d9fba0 {mixxx.exe!const QStaticStringData<3> mixxx::SoundSourceProviderMp3::<lambda_1>::operator()::qstring_literal} {...} } QString
  ▶ mixxx::IAudioSourceReader {...} mixxx::IAudioSourceReader
  ▶ m_file {...} QFile
  m_fileSize 15694151 unsigned __int64
  ▶ m_pFileData 0x000001ee6a010000 "ID3\x3" unsigned char *
  ▶ m_seekFrameList { size=0 } std::vector<mixxx::SoundSourceMp3::SeekFrameType,std::allocatormixxx::SoundSourceMp3::SeekFrameType>
  m_avgSeekFrameCount 0 __int64
  m_curFrameIndex 0 __int64
  ◢ m_madStream {buffer=0x000001ee6a010000 "ID3\x3" bufend=0x000001ee6af07947 "" skiplen=0 ...} mad_stream
  ▶ buffer 0x000001ee6a010000 "ID3\x3" const unsigned char *
  ▶ bufend 0x000001ee6af07947 "" const unsigned char *
  skiplen 0 unsigned long
  sync 1 int
  freerate 0 unsigned long
  ▶ this_frame 0x000001ee6a015c8a "ÿûàd" const unsigned char *
  ▶ next_frame 0x000001ee6a01609e "ÿûàD" const unsigned char *
  ▶ ptr {byte=0x000001ee6a015c8e "" cache=100 left=8 } mad_bitptr
  ▶ anc_ptr {byte=0x0000000000000000 cache=0 left=8 } mad_bitptr
  anc_bitlen 0 unsigned int
  ▶ main_data 0x0000000000000000 {???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ...} unsigned char[2567] *
  md_len 0 unsigned int
  options 1 int
  error MAD_ERROR_LOSTSYNC (257) mad_error
  ◢ m_madFrame {header={layer=0 mode=MAD_MODE_SINGLE_CHANNEL (0) mode_extension=0 ...} options=0 sbsample=0x000001ee6942c720 {...} ...} mad_frame
  ◢ header {layer=0 mode=MAD_MODE_SINGLE_CHANNEL (0) mode_extension=0 ...} mad_header
  layer 0 mad_layer
  mode MAD_MODE_SINGLE_CHANNEL (0) mad_mode
  mode_extension 0 int
  emphasis MAD_EMPHASIS_NONE (0) mad_emphasis
  bitrate 0 unsigned long
  samplerate 0 unsigned int
  crc_check 0 unsigned short
  crc_target 0 unsigned short
  flags 0 int
  private_bits 0 int
  ▶ duration {seconds=0 fraction=0 } mad_timer_t
  options 0 int
  ▶ sbsample 0x000001ee6942c720 {0x000001ee6942c720 {0x000001ee6942c720 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...}, ...}, ...} int[2][36][32]
  ▶ overlap 0x0000000000000000 {0x0000000000000000 {0x0000000000000000 {???, ???, ???, ???, ???, ???, ???, ???, ...}, ...}, ...} int[2][32][18] *
  ◢ m_madSynth {filter=0x000001ee6942eb28 {0x000001ee6942eb28 {0x000001ee6942eb28 {0x000001ee6942eb28 {0x000001ee6942eb28 {...}, ...}, ...}, ...}, ...} ...} mad_synth
  ▶ filter 0x000001ee6942eb28 {0x000001ee6942eb28 {0x000001ee6942eb28 {0x000001ee6942eb28 {0x000001ee6942eb28 {...}, ...}, ...}, ...}, ...} int[2][2][2][16][8]
  phase 0 unsigned int
  ▶ pcm {samplerate=0 channels=0 length=0 ...} mad_pcm
  m_madSynthCount 0 __int64
  ▶ m_leftoverBuffer { size=1449 } std::vector<unsigned char,std::allocator>
  ▶ [Raw View] {_Storage={_Value={m_file={...} m_fileSize=15694151 m_pFileData=0x000001ee6a010000 "ID3\x3" ...} } } std::_Ref_count_base {std::_Ref_count_obj2mixxx::SoundSourceMp3}
  ▶ [Raw View] {...} std::shared_ptrmixxx::SoundSource
<title>Document</title>
  Name Value Type
this 0x000001ee6942c5e0 {m_file={...} m_fileSize=15694151 m_pFileData=0x000001ee6a010000 "ID3\x3" ...} mixxx::AudioSource * {mixxx::SoundSourceMp3}
  ◢ [mixxx::SoundSourceMp3] {m_file={...} m_fileSize=15694151 m_pFileData=0x000001ee6a010000 "ID3\x3" ...} mixxx::SoundSourceMp3
  ▶ mixxx::SoundSource {m_type=mp3 } mixxx::SoundSource
  ▶ mixxx::IAudioSourceReader {...} mixxx::IAudioSourceReader
  ▶ m_file {...} QFile
  m_fileSize 15694151 unsigned __int64
  ▶ m_pFileData 0x000001ee6a010000 "ID3\x3" unsigned char *
  ▶ m_seekFrameList { size=0 } std::vector<mixxx::SoundSourceMp3::SeekFrameType,std::allocatormixxx::SoundSourceMp3::SeekFrameType>
  m_avgSeekFrameCount 0 __int64
  m_curFrameIndex 0 __int64
  ▶ m_madStream {buffer=0x000001ee6a010000 "ID3\x3" bufend=0x000001ee6af07947 "" skiplen=0 ...} mad_stream
  ▶ m_madFrame {header={layer=0 mode=MAD_MODE_SINGLE_CHANNEL (0) mode_extension=0 ...} options=0 sbsample=0x000001ee6942c720 {...} ...} mad_frame
  ▶ m_madSynth {filter=0x000001ee6942eb28 {0x000001ee6942eb28 {0x000001ee6942eb28 {0x000001ee6942eb28 {0x000001ee6942eb28 {...}, ...}, ...}, ...}, ...} ...} mad_synth
  m_madSynthCount 0 __int64
  ▶ m_leftoverBuffer { size=1449 } std::vector<unsigned char,std::allocator>
  ◢ mixxx::UrlResource {m_url=file:///C:/Users/Joerg.WORLDWARTWEB/Music/2pac feat Dr. Dre - California Love (Dash Berlin Rework).mp3 } mixxx::UrlResource
  ▶ __vfptr 0x00007ff6e5a56738 {mixxx.exe!const mixxx::SoundSourceMp3::vftable'{for mixxx::UrlResource'}} {0x00007ff6e550ad50 {mixxx.exe!mixxx::SoundSourceMp3::~SoundSourceMp3(void)}} void * *
  ▶ m_url file:///C:/Users/Joerg.WORLDWARTWEB/Music/2pac feat Dr. Dre - California Love (Dash Berlin Rework).mp3 QUrl
  ◢ mixxx::IAudioSourceReader {...} mixxx::IAudioSourceReader
  ▶ __vfptr 0x00007ff6e5a56768 {mixxx.exe!const mixxx::SoundSourceMp3::vftable'{for mixxx::IAudioSourceReader'}} {...} void * *
  ◢ m_signalInfo {m_channelCount={m_value=0 '\0' } m_sampleRate={m_value=0 } } mixxx::audio::SignalInfo
  ▶ m_channelCount {m_value=0 '\0' } mixxx::audio::ChannelCount
  ▶ m_sampleRate {m_value=0 } mixxx::audio::SampleRate
  ◢ m_bitrate {m_value=0 } mixxx::audio::Bitrate
  m_value 0 unsigned int
  ◢ m_frameIndexRange (0, 0) mixxx::IndexRange
  first 0 __int64
  second 0 __int64
  ▶ [Raw View] {...} mixxx::IndexRange
  e Variable is optimized away and not available.  
  mode Strict (0) mixxx::AudioSource::OpenMode
params {m_signalInfo={m_channelCount={m_value=2 '\x2' } m_sampleRate={m_value=0 } } } const mixxx::AudioSource::OpenParams &
  ◢ m_signalInfo {m_channelCount={m_value=2 '\x2' } m_sampleRate={m_value=0 } } mixxx::audio::SignalInfo
  ◢ m_channelCount {m_value=2 '\x2' } mixxx::audio::ChannelCount
  m_value 2 '\x2' unsigned char
  ◢ m_sampleRate {m_value=0 } mixxx::audio::SampleRate
  m_value 0 unsigned int
  result Variable is optimized away and not available.  
<title>Document</title>
  Name Value Type
this 0x000001ee6942c5e0 {m_file={...} m_fileSize=15694151 m_pFileData=0x000001ee6a010000 "ID3\x3" ...} mixxx::SoundSourceMp3 *
  avgBitrate Variable is optimized away and not available.  
  cntBitrateFrames 0 unsigned __int64
  differentRates Variable is optimized away and not available.  
headerPerSampleRate 0x000000ae265ff600 {0, 0, 0, 0, 0, 0, 0, 0, 0} int[9]
  i Variable is optimized away and not available.  
  madChannelCount Variable is optimized away and not available.  
  madFrameLength Variable is optimized away and not available.  
madHeader {layer=MAD_LAYER_III (3) mode=MAD_MODE_JOINT_STEREO (2) mode_extension=2 ...} mad_header
  layer MAD_LAYER_III (3) mad_layer
  mode MAD_MODE_JOINT_STEREO (2) mad_mode
  mode_extension 2 int
  emphasis MAD_EMPHASIS_NONE (0) mad_emphasis
  bitrate 320000 unsigned long
  samplerate 44100 unsigned int
  crc_check 0 unsigned short
  crc_target 0 unsigned short
  flags 72 int
  private_bits 0 int
  ▶ duration {seconds=0 fraction=9216000 } mad_timer_t
  madSampleRate Variable is optimized away and not available.  
  madUnits Variable is optimized away and not available.  
maxChannelCount {m_value=0 '\0' } mixxx::audio::ChannelCount
  mostCommonSampleRateCount Variable is optimized away and not available.  
  mostCommonSampleRateIndex Variable is optimized away and not available.  
  mp3InfoFrameOffset Variable is optimized away and not available.  
  mp3InfoTag Variable is optimized away and not available.  
  mp3InfoTagSkipped Variable is optimized away and not available.  
  sampleRateIndex Variable is optimized away and not available.  
  sumBitrateFrames 0 unsigned __int64
<title>Document</title>
  Name Value Type
pMadHeader 0x000000ae265ff640 {layer=MAD_LAYER_III (3) mode=MAD_MODE_JOINT_STEREO (2) mode_extension=2 ...} mad_header *
  layer MAD_LAYER_III (3) mad_layer
  mode MAD_MODE_JOINT_STEREO (2) mad_mode
  mode_extension 2 int
  emphasis MAD_EMPHASIS_NONE (0) mad_emphasis
  bitrate 320000 unsigned long
  samplerate 44100 unsigned int
  crc_check 0 unsigned short
  crc_target 0 unsigned short
  flags 72 int
  private_bits 0 int
  ▶ duration {seconds=0 fraction=9216000 } mad_timer_t
pMadStream 0x000001ee6942c680 {buffer=0x000001ee6a010000 "ID3\x3" bufend=0x000001ee6af07947 "" skiplen=0 ...} mad_stream *
  ▶ buffer 0x000001ee6a010000 "ID3\x3" const unsigned char *
  ▶ bufend 0x000001ee6af07947 "" const unsigned char *
  skiplen 0 unsigned long
  sync 1 int
  freerate 0 unsigned long
  ▶ this_frame 0x000001ee6a015c8a "ÿûàd" const unsigned char *
  ▶ next_frame 0x000001ee6a01609e "ÿûàD" const unsigned char *
  ▶ ptr {byte=0x000001ee6a015c8e "" cache=100 left=8 } mad_bitptr
  ▶ anc_ptr {byte=0x0000000000000000 cache=0 left=8 } mad_bitptr
  anc_bitlen 0 unsigned int
  ▶ main_data 0x0000000000000000 {???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ...} unsigned char[2567] *
  md_len 0 unsigned int
  options 1 int
  error MAD_ERROR_LOSTSYNC (257) mad_error
  skipId3Tag Variable is optimized away and not available.  

@daschuer
Copy link
Member

daschuer commented May 1, 2023

Strange the libmad build has not be changed recently. Do you use the same vcpkg build environment as the GitHub workflow?
Any Idea how get a hock onto this issue?

@JoergAtGithub
Copy link
Member Author

I guess, that only tagsize could be the reason, that it reaches the assert:
grafik

@JoergAtGithub
Copy link
Member Author

When I open the MP3 file, the assertion happens in the second execution of this function. In the 2nd execution mad_header_decode returns false and it steps straight to the assert.

1.) Execution

<title>Document</title>
  Name Value Type
pMadHeader 0x000000b419ffe438 {layer=0 mode=MAD_MODE_SINGLE_CHANNEL (0) mode_extension=0 ...} mad_header *
pMadStream 0x00000242711cbf88 {buffer=0x00000242742f0000 "ID3\x3" bufend=0x00000242751e7947 "" skiplen=0 ...} mad_stream *
  ▶ buffer 0x00000242742f0000 "ID3\x3" const unsigned char *
  ▶ bufend 0x00000242751e7947 "" const unsigned char *
  skiplen 0 unsigned long
  sync 0 int
  freerate 0 unsigned long
  ▶ this_frame 0x00000242742f0000 "ID3\x3" const unsigned char *
  ▶ next_frame 0x00000242742f0001 "D3\x3" const unsigned char *
  ▶ ptr {byte=0x00000242742f0000 "ID3\x3" cache=0 left=8 } mad_bitptr
  ▶ anc_ptr {byte=0x0000000000000000 cache=0 left=8 } mad_bitptr
  anc_bitlen 0 unsigned int
  ▶ main_data 0x0000000000000000 {???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ...} unsigned char[2567] *
  md_len 0 unsigned int
  options 1 int
  error MAD_ERROR_LOSTSYNC (257) mad_error
  skipId3Tag true bool
  tagsize 23690 long

2.) Execution:

<title>Document</title>
  Name Value Type
pMadHeader 0x000000bd190fe908 {layer=0 mode=MAD_MODE_SINGLE_CHANNEL (0) mode_extension=0 ...} mad_header *
pMadStream 0x000001f2f0acb418 {buffer=0x000001f2f4e20000 "ID3\x3" bufend=0x000001f2f5d17947 "" skiplen=23690 ...} mad_stream *
  ▶ buffer 0x000001f2f4e20000 "ID3\x3" const unsigned char *
  ▶ bufend 0x000001f2f5d17947 "" const unsigned char *
  skiplen 23690 unsigned long
  sync 0 int
  freerate 0 unsigned long
  ▶ this_frame 0x000001f2f4e20000 "ID3\x3" const unsigned char *
  ▶ next_frame 0x000001f2f4e20001 "D3\x3" const unsigned char *
  ▶ ptr {byte=0x000001f2f4e20000 "ID3\x3" cache=0 left=8 } mad_bitptr
  ▶ anc_ptr {byte=0x0000000000000000 cache=0 left=8 } mad_bitptr
  anc_bitlen 0 unsigned int
  ▶ main_data 0x0000000000000000 {???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ...} unsigned char[2567] *
  md_len 0 unsigned int
  options 1 int
  error MAD_ERROR_LOSTSYNC (257) mad_error
  skipId3Tag true bool

@daschuer
Copy link
Member

daschuer commented May 1, 2023

I guess, that only tagsize could be the reason, that it reaches the assert:

tagsize is 25604 during the first call.
Before the second call error is still MAD_ERROR_LOSTSYNC, but here mad_header_decode() resets it to MAD_ERROR_NONE.

@daschuer
Copy link
Member

daschuer commented May 2, 2023

I was able to reporduce the issue with a local build of libmad.

@daschuer
Copy link
Member

daschuer commented May 2, 2023

#11528

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants