Skip to content

pulseview: crash when using the “Binary Decoder Output View” and multiple changes to the baud rate in the UART decoder #103

@rhabacker

Description

@rhabacker

How to reproduce the error

  1. Unzip the attached file and open the .sr file it contains.
  2. Add a UART decoder with RX set to D0 and the baud rate set to 1024.
  3. Open the “Binary Decoder Output View”
  4. Open the UART settings.
  5. Change the baud rate several times in the hundreds place, e.g., from 1024 to 1124, 1224, ...
  6. pulseview crashes

wpt-startup-and-control.zip

backtrace

Cannot access memory at address 0x5555561991f8
(gdb) bt
#0  0x00005555556f70a8 in std::_Deque_iterator<pv::data::DecodeBinaryDataChunk, pv::data::DecodeBinaryDataChunk&, pv::data::DecodeBinaryDataChunk*>::operator+= (__n=0, this=<synthetic pointer>)
    at /usr/include/c++/7/bits/stl_deque.h:220
#1  std::_Deque_iterator<pv::data::DecodeBinaryDataChunk, pv::data::DecodeBinaryDataChunk&, pv::data::DecodeBinaryDataChunk*>::operator+ (__n=0, this=0x7fffc4003640) at /usr/include/c++/7/bits/stl_deque.h:230
#2  std::_Deque_iterator<pv::data::DecodeBinaryDataChunk, pv::data::DecodeBinaryDataChunk&, pv::data::DecodeBinaryDataChunk*>::operator[] (__n=0, this=0x7fffc4003640) at /usr/include/c++/7/bits/stl_deque.h:246
#3  std::deque<pv::data::DecodeBinaryDataChunk, std::allocator<pv::data::DecodeBinaryDataChunk> >::operator[] (__n=0, this=0x7fffc4003630) at /usr/include/c++/7/bits/stl_deque.h:1394
#4  QHexView::initialize_byte_iterator (this=this@entry=0x5555561991c0, offset=0, offset@entry=<error reading variable: Cannot access memory at address 0x7fffffffa680>)
    at /usr/src/debug/pulseview-0.4.2-bp156.3.8.x86_64/pv/views/decoder_binary/QHexView.cpp:203
#5  0x00005555556f81e9 in QHexView::paintEvent (this=0x5555561991c0, event=<optimized out>) at /usr/src/debug/pulseview-0.4.2-bp156.3.8.x86_64/pv/views/decoder_binary/QHexView.cpp:340
(gdb) frame 4
#4  QHexView::initialize_byte_iterator (this=this@entry=0x5555561991c0, offset=0, offset@entry=<error reading variable: Cannot access memory at address 0x7fffffffa680>)
    at /usr/src/debug/pulseview-0.4.2-bp156.3.8.x86_64/pv/views/decoder_binary/QHexView.cpp:203
203                     size_t size = data_->chunks[i].data.size();
(gdb) l
198             current_chunk_offset_ = 0;
199             current_offset_ = offset;
200
201             size_t chunks = data_->chunks.size();
202             for (size_t i = 0; i < chunks; i++) {
203                     size_t size = data_->chunks[i].data.size();  <- !!!
204
205                     if (offset >= size) {
206                             current_chunk_id_++;
207                             offset -= size;

Additional information

The issue is reproduceable with the following version:

  • Version 0.4.2 on openSUSE Leap Linux
  • Version 0.5.0-git-e2fe9df on openSUSE Leap Linux
  • Nightly build on Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions