lutusp / PLSDR

Software-defined radio application written in Python
GNU General Public License v3.0
156 stars 21 forks source link

Crash with SDRPlay #9

Open gvanem opened 4 years ago

gvanem commented 4 years ago

I just discovered PLSDR and tried it with my own MSVC-2019 (32-bit) build of GnuRadio 3.9 (+Python 2.7). It works fine using osmo-sdr, but often (not always), it crashes when switching to a SDRPlay device.

I have both a SDRPlay RSP1A and a RTL-SDR stick attached to my computer.

Details from WinDbg (my JIT debugger):

Access violation - code c0000005 (!!! second chance !!!)
eax=8c001ed6 ebx=00000000 ecx=3c8cdeac edx=15b0fa30 esi=0fee0000 edi=15b0fa28
eip=7753681a esp=009ed458 ebp=009ed4a4 iopl=0         nv up ei pl nz na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00210206
ntdll!RtlpFreeHeapInternal+0x2c2:
7753681a 8b7104          mov     esi,dword ptr [ecx+4] ds:002b:3c8cdeb0=????????

From the WinDbg module-list, the [exc+4] address looks illegal. And the call-stack:

ntdll!RtlpFreeHeapInternal+0x2c2
ntdll!RtlFreeHeap+0x46
MSVCR100!free(void * pBlock = 0x15b0fa30)+0x1c
QtCore!initQtCore+0xf8add
QtCore!initQtCore+0xf8ee8
Qt5Core!QObject::event+0x95
Qt5Widgets!QApplicationPrivate::notify_helper+0x10b
Qt5Widgets!QApplication::notify+0x16fd
Qt5Gui!QGuiApplicationPrivate::processMouseEvent+0xa22
Qt5Core!QMetaProperty::writeOnGadget+0x342c
Qt5Core!QMetaType::typeInfo+0x6f

I guess PyQt5\QtCore.pyd is causing this somewhere (since it's using MSVC100.DLL while my normal Qt5 is using something newer).

BTW. It is really a cool program!

Edit: Doing an !analyze -v in WinDbg showed: FAILURE_ID_HASH_STRING: um:heap_corruption_c0000005_heap_corruption!python.exe No shit Sherlock.

gvanem commented 4 years ago

Update: here is longer call-stack that goes back all the way to PLSDR.py:

ntdll!RtlpFreeHeapInternal+0x2c2
ntdll!RtlFreeHeap+0x46
MSVCR100!free(void * pBlock = 0x15f0e7b0)+0x1c
QtCore!initQtCore+0xf8add
Qt5Widgets!QApplicationPrivate::notify_helper+0x10b
Qt5Widgets!QApplication::notify+0x16fd
win32u!NtUserMessageCall+0xc
USER32!RealDefWindowProcWorker+0x2cd
win32u!NtUserTrackMouseEvent+0xc
ntdll!RtlpFreeHeapInternal+0x7aa
Qt5Core!QEventDispatcherWin32::`default constructor closure'+0xda
Qt5Core!QCoreApplicationPrivate::sendPostedEvents+0x20f
Qt5Core!QEventDispatcherWin32::sendPostedEvents+0xf
USER32!_InternalCallWinProc+0x2b
USER32!UserCallWinProcCheckWow+0x3ac
USER32!DispatchMessageWorker+0x20e
USER32!DispatchMessageW+0x10
Qt5Core!QEventDispatcherWin32::processEvents+0x3a6
qwindows!QWindowsGuiEventDispatcher::processEvents(class QFlags<enum QEventLoop::ProcessEventsFlag> flags = class QFlags<enum QEventLoop::ProcessEventsFlag>)+0x15
Qt5Core!QEventLoop::exec+0x119
Qt5Core!QCoreApplication::exec+0x14d
QtWidgets!initQtWidgets+0x220e20
python27!call_function(struct _object *** pp_stack = 0x011ef9b0, int oparg = 0n-1946150412)+0x2b6
python27!PyEval_EvalFrameEx(struct _frame * f = 0x03519df0, int throwflag = 0n0)+0x23fe
python27!PyEval_EvalCodeEx(struct PyCodeObject * co = 0x035ea890, struct _object * globals = 0x0344ea50, struct _object * locals = 0x0344ea50, struct _object ** args = 0x00000000, int argcount = 0n0, struct _object ** kws = 0x00000000, int kwcount = 0n0, struct _object ** defs = 0x00000000, int defcount = 0n0, struct _object * closure = 0x00000000)+0x7dc
python27!run_mod(struct _mod * mod = 0x03965b18, char * filename = 0x15f0e7b0 "???", struct _object * globals = 0x0344ea50, struct _object * locals = 0x0344ea50, struct PyCompilerFlags * flags = 0x00e10103, struct _arena * arena = 0x8c0019f4)+0x3f
python27!PyRun_FileExFlags(struct _iobuf * fp = 0x74437408, char * filename = 0x033b11a8 "PLSDR.py", int start = 0n257, struct _object * globals = 0x0344ea50, struct _object * locals = 0x0344ea50, int closeit = 0n1, struct PyCompilerFlags * flags = 0x011efb04)+0x6e
python27!PyRun_SimpleFileExFlags(struct _iobuf * fp = 0x74437408, char * filename = 0x033b11a8 "PLSDR.py", int closeit = 0n1, struct PyCompilerFlags * flags = 0x011efb04)+0x211
python27!PyRun_AnyFileExFlags(struct _iobuf * fp = 0x74437408, char * filename = 0x033b11a8 "PLSDR.py", int closeit = 0n1, struct PyCompilerFlags * flags = 0x011efb04)+0x57
python27!Py_Main(int argc = 0n2, char ** argv = 0x033b1178)+0xa4c
python!__tmainCRTStartup(void)+0x10f
KERNEL32!BaseThreadInitThunk+0x19
ntdll!__RtlUserThreadStart+0x2f
ntdll!_RtlUserThreadStart+0x1b