Sunday, June 2, 2024

Re: gnuradio for windows built by mingw64

Hello again,

I've managed to make a backtrace of the threads that get run under
windows. As I said before, I don't really know what I'm doing with
gdb, but for backtraces and stepping through code.

# gdb -p 6076
GNU gdb (GDB) 14.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 6076
[New Thread 6076.0x1b48]
[New Thread 6076.0x17a4]
Reading symbols from C:\msys64\mingw64\bin\python.exe...
(No debugging symbols found in C:\msys64\mingw64\bin\python.exe)
(gdb) threads
Undefined command: "threads". Try "help".
(gdb) thread
[Current thread is 3 (Thread 6076.0x17a4)]
(gdb) thread 1
[Switching to thread 1 (Thread 6076.0x1260)]
#0 0x00007fff078904a4 in ntdll!ZwWaitForMultipleObjects () from
C:\WINDOWS\SYSTEM32\ntdll.dll
(gdb) bt
#0 0x00007fff078904a4 in ntdll!ZwWaitForMultipleObjects () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#1 0x00007fff04b6fda9 in WaitForMultipleObjectsEx () from
C:\WINDOWS\System32\KernelBase.dll
#2 0x00007fff04b6fcae in WaitForMultipleObjects () from
C:\WINDOWS\System32\KernelBase.dll
#3 0x00007ffeee141da0 in ?? () from C:\msys64\mingw64\bin\libwinpthread-1.dll
#4 0x00007ffeee142066 in ?? () from C:\msys64\mingw64\bin\libwinpthread-1.dll
#5 0x00007ffeee1426b3 in ?? () from C:\msys64\mingw64\bin\libwinpthread-1.dll
#6 0x00007ffeb936b9db in ?? () from C:\msys64\mingw64\bin\libthrift.dll
#7 0x00007ffeb9358bf6 in ?? () from C:\msys64\mingw64\bin\libthrift.dll
#8 0x00007ffeb9314df7 in ?? () from C:\msys64\mingw64\bin\libthrift.dll
#9 0x00007ffeb77fdd89 in ?? () from
C:\msys64\mingw64\bin\libgnuradio-runtime.dll
#10 0x00007ffeb77d1aee in ?? () from
C:\msys64\mingw64\bin\libgnuradio-runtime.dll
#11 0x00007ffeb784f18b in ?? () from
C:\msys64\mingw64\bin\libgnuradio-runtime.dll
#12 0x00007ffeb77eb7c2 in ?? () from
C:\msys64\mingw64\bin\libgnuradio-runtime.dll
#13 0x00007ffeb77212dd in ?? () from
C:\msys64\mingw64\bin\libgnuradio-runtime.dll
#14 0x00007fff0781869f in ntdll!RtlActivateActivationContextUnsafeFast ()
from C:\WINDOWS\SYSTEM32\ntdll.dll
#15 0x00007fff0785d03d in ntdll!RtlEnumerateEntryHashTable () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#16 0x00007fff0785cdee in ntdll!RtlEnumerateEntryHashTable () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#17 0x00007fff0785ce60 in ntdll!RtlEnumerateEntryHashTable () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#18 0x00007fff0781d62d in ntdll!RtlCopyUnicodeString () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#19 0x00007fff07818940 in ntdll!RtlImageRvaToSection () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#20 0x00007fff07808cac in ntdll!RtlUnicodeToCustomCPN () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#21 0x00007fff0781a25a in ntdll!LdrLoadDll () from C:\WINDOWS\SYSTEM32\ntdll.dll
#22 0x00007fff04b361e2 in LoadLibraryExW () from
C:\WINDOWS\System32\KernelBase.dll
#23 0x00007ffe8fa6a4b7 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#24 0x00007ffe8fa598e0 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
--Type <RET> for more, q to quit, c to continue without paging--
#25 0x00007ffe8fa59642 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#26 0x00007ffe8fb269b9 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#27 0x00007ffe8fba52c9 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#28 0x00007ffe8fb9da31 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#29 0x00007ffe8faeb6c1 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#30 0x00007ffe8faeb40e in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#31 0x00007ffe8faec3f0 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#32 0x00007ffe8fbc3b1a in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#33 0x00007ffe8fba2fc5 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#34 0x00007ffe8fb9da31 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#35 0x00007ffe8fa4d72e in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#36 0x00007ffe8fa4c21c in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#37 0x00007ffe8fb2679d in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#38 0x00007ffe8fba52c9 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#39 0x00007ffe8fb9da31 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#40 0x00007ffe8faeb6c1 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#41 0x00007ffe8faeb40e in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#42 0x00007ffe8faec3f0 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#43 0x00007ffe8fbc3b1a in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#44 0x00007ffe8fb97e40 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#45 0x00007ffe8fb2679d in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#46 0x00007ffe8fba52c9 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#47 0x00007ffe8fb9da31 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#48 0x00007ffe8faeb6c1 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#49 0x00007ffe8faeb40e in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#50 0x00007ffe8faec3f0 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
--Type <RET> for more, q to quit, c to continue without paging--
#51 0x00007ffe8fbc3b80 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#52 0x00007ffe8fba2fc5 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#53 0x00007ffe8fb9da31 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#54 0x00007ffe8fa4d72e in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#55 0x00007ffe8fa633c3 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#56 0x00007ffe8fa62e88 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#57 0x00007ffe8fbd4385 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#58 0x00007ffe8fbd478a in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#59 0x00007ffe8fbd287f in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#60 0x00007ffe8fbd4898 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#61 0x00007ffe8fbeb159 in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#62 0x00007ffe8fa6a69a in ?? () from C:\msys64\mingw64\bin\libpython3.11.dll
#63 0x00007ff6f99412f7 in ?? ()
#64 0x00007ff6f9941406 in ?? ()
#65 0x00007fff06cc257d in KERNEL32!BaseThreadInitThunk () from
C:\WINDOWS\System32\kernel32.dll
#66 0x00007fff0784aa48 in ntdll!RtlUserThreadStart () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#67 0x0000000000000000 in ?? ()
(gdb) thread 2
[Switching to thread 2 (Thread 6076.0x1b48)]
#0 0x00007fff0788f9d4 in ntdll!ZwWaitForSingleObject () from
C:\WINDOWS\SYSTEM32\ntdll.dll
(gdb) bt
#0 0x00007fff0788f9d4 in ntdll!ZwWaitForSingleObject () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#1 0x00007fff0781a00e in ntdll!LdrGetDllHandleEx () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#2 0x00007fff078183a3 in ntdll!RtlLeaveCriticalSection () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#3 0x00007fff07863f6f in ntdll!LdrInitializeThunk () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#4 0x00007fff07863ea3 in ntdll!LdrInitializeThunk () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#5 0x00007fff07863dce in ntdll!LdrInitializeThunk () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#6 0x0000000000000000 in ?? ()
(gdb) thread 3
[Switching to thread 3 (Thread 6076.0x17a4)]
#0 0x00007fff07893641 in ntdll!DbgBreakPoint () from
C:\WINDOWS\SYSTEM32\ntdll.dll
(gdb) bt
#0 0x00007fff07893641 in ntdll!DbgBreakPoint () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#1 0x00007fff078c6f6e in ntdll!DbgUiRemoteBreakin () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#2 0x00007fff06cc257d in KERNEL32!BaseThreadInitThunk () from
C:\WINDOWS\System32\kernel32.dll
#3 0x00007fff0784aa48 in ntdll!RtlUserThreadStart () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#4 0x0000000000000000 in ?? ()

What looks odd to me is the number of libpython3.11.dll instances I
get. As I understand there are a lot of changes to mingw's python.
So is this where the hangup is? I've tried to build a debug python,
but it failed out of the gate. (I suspect due to a new compiler.)
When I run with radioconda's python I get ...

# cat import_gr_thread_radioconda_run.txt
(base) C:\Users\chris>gdb --args c:\programdata\radioconda\python.exe
-c "from gnuradio import gr;"
GNU gdb (GDB) 14.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from c:\programdata\radioconda\python.exe...
(No debugging symbols found in c:\programdata\radioconda\python.exe)
(gdb) run
Starting program: c:\programdata\radioconda\python.exe -c "from
gnuradio import gr;"
[New Thread 7924.0x25b0]
[New Thread 7924.0x3044]
[New Thread 7924.0x2914]
[New Thread 7924.0x1b04]
[New Thread 7924.0x37a4]
[New Thread 7924.0x14c4]
[New Thread 7924.0x1070]
[New Thread 7924.0x13c8]
[New Thread 7924.0x2130]
[New Thread 7924.0x3388]
[New Thread 7924.0xf04]
[New Thread 7924.0x16ec]
[Thread 7924.0x16ec exited with code 0]
[Thread 7924.0xf04 exited with code 0]
[Thread 7924.0x2130 exited with code 0]
[Thread 7924.0x13c8 exited with code 0]
[Thread 7924.0x14c4 exited with code 0]
[Thread 7924.0x37a4 exited with code 0]
[Thread 7924.0x3388 exited with code 0]
[Thread 7924.0x1070 exited with code 0]
[Thread 7924.0x1b04 exited with code 0]
[Thread 7924.0x2914 exited with code 0]
[Thread 7924.0x3044 exited with code 0]
[Thread 7924.0x25b0 exited with code 0]
[Inferior 1 (process 7924) exited normally]

Something much more similar to linux. Appreciate any insights folks
have on what this all means.

Thanks in advance,

Chris




On Fri, May 31, 2024 at 7:34 PM Chris Gorman <chrisjohgorman@gmail.com> wrote:
>
> Hello All,
>
> I have recently made a build of gnuradio for windows using msys2 and
> mingw64. I have everything built, but am getting some odd behaviour
> from python interacting with gnuradio. When I try to load any
> gnuradio modules, the python interpreter hangs, indefinitely. I'm not
> sure what I've done wrong. I'm attaching a gzipped copy of my
> build.log, prepare.log and package.log files in case it helps diagnose
> this problem.
>
> I've tried more than one python module, for example in python, from
> gnuradio import gr, etc. and nothing does anything but hang the shell.
> I did try to use gdb to debug this, but all I got from gdb was four
> threads created and 3 exiting with 'exit code 0'. I'm not too
> confident with gdb, so if anyone has any tricks for me to try, please
> let me know.
>
> My environment is mingw64, gcc-14.1, boost-1.85.0, codec2-1.2.0,
> gcc-libs-14.0, gmp-6.3.0, gsl-2.8, libad9361-iio-0.3, libuhd-4.6.0.0,
> libunwind-18.1.6, volk-3.1.2, python-click-8.1.7,
> python-click-plugins-1.1.1, python-mako-1.3.3,
> python-matplotlib-3.8.3, python-numpy-1.2.6, python-pygccxml-2.5.0,
> python-pyaml-23.12.0, python-pyzmq-25.1.2, python-scipy-1.12.0,
> python-thrift-0.20.0, SDL-1.2.15+r419+gef3a6c05, soapy-sdr-0.8.1,
> spdlog-1.13.0, thrift-0.20.0, cmake-3.29.3, ninja-1.12.1,
> cppzmq-4.10.0, fftw-3.3.10, gtk3-3.24.42, jack2-1.9.22, libiio-0.25,
> libsndfile-1.2.2, portaudio-1~19.7.0, pybind11-2.11.1,
> python-cairo-1.26.1, python-gobject-3.48.2, python-pyqt5-5.15.10,
> python-pyqtgraph-0.13.3, qt5-base-5.15.13, qwt-qt5-6.2.0,
> zeromq-4.3.5.
>
> I had to use one patch to get gnuradio to build with mingw. I added
> wsock32 as a library to a CMakeLists.txt and I'm attaching that as
> well. Looking for some ideas as to what might be wrong.
>
> Thanks in advance,
>
> Chris

No comments:

Post a Comment