Bug 560 - Pulseview crashes when using two PWM decoders
Summary: Pulseview crashes when using two PWM decoders
Status: RESOLVED DUPLICATE of bug 181
Alias: None
Product: PulseView
Classification: Unclassified
Component: Other (show other bugs)
Version: unreleased development snapshot
Hardware: x86 Linux
: Normal blocker
Target Milestone: PulseView 0.3.0
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-18 12:21 CET by Baruch Even
Modified: 2015-08-21 17:59 CEST (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Baruch Even 2015-02-18 12:21:42 CET
I got a crash when first trying to have two PWM decoders in parallel on data pre-captured and then it also crashed when I tried to collect data with the two PWMs active.

The issue reproduces quite readily but not 100% of the time and not always immediately.

In one case I got the following backtrace:

0  0x00007fac3f2bf107 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007fac3f2c04e8 in __GI_abort () at abort.c:89
#2  0x00007fac3ffd86e0 in Py_FatalError () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
#3  0x00007fac3ffae7d4 in PyType_GenericAlloc () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
#4  0x00007fac3ffabf63 in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
#5  0x00007fac3ff30ea8 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
#6  0x00007fac40015587 in PyEval_CallObjectWithKeywords () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
#7  0x00007fac40499ca0 in srd_inst_new (sess=0x7fac280008c0, decoder_id=0x2432330 "pwm", options=0x7fac30001980) at instance.c:371
#8  0x000000000049bded in pv::data::decode::Decoder::create_decoder_inst (this=0x2797720, session=0x7fac280008c0, unit_size=unit_size@entry=1)
    at /home/baruch/proj/sigrok/pulseview/pv/data/decode/decoder.cpp:128
#9  0x0000000000499f91 in pv::data::DecoderStack::decode_proc (this=0x262db90) at /home/baruch/proj/sigrok/pulseview/pv/data/decoderstack.cpp:350
#10 0x00007fac3fc00970 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#11 0x00007fac429b40a4 in start_thread (arg=0x7fac2ffff700) at pthread_create.c:309
#12 0x00007fac3f37004d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
Comment 1 Baruch Even 2015-02-18 12:31:50 CET
Another core when I tried to start recording with two PWM decoders:

#0  0x00007f909441e46b in PyObject_SetAttr () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
#1  0x00007f909455d585 in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
#2  0x00007f9094562843 in PyEval_EvalCodeEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
#3  0x00007f90944e2629 in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
#4  0x00007f9094474ea8 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
#5  0x00007f909459abad in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
#6  0x00007f9094474ea8 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
#7  0x00007f90944753f4 in PyObject_CallMethod () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
#8  0x00007f90949de0be in srd_inst_decode (di=0x7f9084781d80, start_samplenum=start_samplenum@entry=0, end_samplenum=end_samplenum@entry=12288, 
    inbuf=inbuf@entry=0x7f907e09ee20 '\365' <repeats 199 times>, <incomplete sequence \365>..., inbuflen=inbuflen@entry=4096) at instance.c:610
#9  0x00007f90949dbf3c in srd_session_send (sess=<optimized out>, start_samplenum=0, end_samplenum=12288, 
    inbuf=0x7f907e09ee20 '\365' <repeats 199 times>, <incomplete sequence \365>..., inbuflen=4096) at session.c:247
#10 0x0000000000499710 in pv::data::DecoderStack::decode_data (this=this@entry=0x16b73f0, sample_count=sample_count@entry=12288, 
    unit_size=unit_size@entry=1, session=0x7f9084793b20) at /home/baruch/proj/sigrok/pulseview/pv/data/decoderstack.cpp:316
#11 0x000000000049a099 in pv::data::DecoderStack::decode_proc (this=0x16b73f0) at /home/baruch/proj/sigrok/pulseview/pv/data/decoderstack.cpp:381
#12 0x00007f9094144970 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#13 0x00007f9096ef80a4 in start_thread (arg=0x7f907e0a0700) at pthread_create.c:309
#14 0x00007f90938b404d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
Comment 2 Baruch Even 2015-02-18 12:32:36 CET
bt full of the second crash:

#0  0x00007f909441e46b in PyObject_SetAttr () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
No symbol table info available.
#1  0x00007f909455d585 in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
No symbol table info available.
#2  0x00007f9094562843 in PyEval_EvalCodeEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
No symbol table info available.
#3  0x00007f90944e2629 in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
No symbol table info available.
#4  0x00007f9094474ea8 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
No symbol table info available.
#5  0x00007f909459abad in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
No symbol table info available.
#6  0x00007f9094474ea8 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
No symbol table info available.
#7  0x00007f90944753f4 in PyObject_CallMethod () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so.1.0
No symbol table info available.
#8  0x00007f90949de0be in srd_inst_decode (di=0x7f9084781d80, start_samplenum=start_samplenum@entry=0, end_samplenum=end_samplenum@entry=12288, 
    inbuf=inbuf@entry=0x7f907e09ee20 '\365' <repeats 199 times>, <incomplete sequence \365>..., inbuflen=inbuflen@entry=4096) at instance.c:610
        py_res = <optimized out>
        logic = 0x7f907ce43770
#9  0x00007f90949dbf3c in srd_session_send (sess=<optimized out>, start_samplenum=0, end_samplenum=12288, 
    inbuf=0x7f907e09ee20 '\365' <repeats 199 times>, <incomplete sequence \365>..., inbuflen=4096) at session.c:247
        d = 0x7f908400d050
        ret = <optimized out>
#10 0x0000000000499710 in pv::data::DecoderStack::decode_data (this=this@entry=0x16b73f0, sample_count=sample_count@entry=12288, 
    unit_size=unit_size@entry=1, session=0x7f9084793b20) at /home/baruch/proj/sigrok/pulseview/pv/data/decoderstack.cpp:316
        decode_lock = {_M_device = @0x6e20c0}
        i = 0
        chunk = '\365' <repeats 4095 times>...
        chunk_sample_count = 4096
#11 0x000000000049a099 in pv::data::DecoderStack::decode_proc (this=0x16b73f0) at /home/baruch/proj/sigrok/pulseview/pv/data/decoderstack.cpp:381
        sample_count = {<boost::optional_detail::optional_base<long>> = {<boost::optional_detail::optional_tag> = {<No data fields>}, 
            m_initialized = true, m_storage = {dummy_ = {data = "\000\060\000\000\000\000\000", aligner_ = {<No data fields>}}}}, <No data fields>}
        session = 0x7f9084793b20
        prev_di = <optimized out>
        unit_size = 1
---Type <return> to continue, or q <return> to quit---
#12 0x00007f9094144970 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#13 0x00007f9096ef80a4 in start_thread (arg=0x7f907e0a0700) at pthread_create.c:309
        __res = <optimized out>
        pd = 0x7f907e0a0700
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140258566604544, -6048740080364248326, 0, 23045904, 18, 140258566604544, 5993854469987148538, 
                5994189050437870330}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#14 0x00007f90938b404d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
No locals.
Comment 3 Joel Holdsworth 2015-02-18 12:52:33 CET
This is probably an issue with not being able to run multiple libsigrokdecode engines concurrently!
Comment 4 Baruch Even 2015-02-18 16:48:27 CET
This does look like a dup of #181 and you have a few backtraces that may help here.
Comment 5 Uwe Hermann 2015-02-18 23:45:24 CET
Running two decoders at the same time is currently not easily supportable. I think PulseView has/had a mechanism to avoid running multiple PDs at the same time, maybe that needs some (re)fixing.

Long-term we do want to support this use-case of course, but it's nontrivial;  for now avoiding multiple concurrently running PDs in frontends is the safe thing.
Comment 6 Uwe Hermann 2015-08-21 17:59:15 CEST
This is the same issue as #181, we currently don't support multiple PDs running at the same time (which PV should thus prevent from happening). Merging with bug #181.

*** This bug has been marked as a duplicate of bug 181 ***