ha7ilm / openwebrx

Open source, multi-user SDR receiver software with a web interface
https://sdr.hu/openwebrx
GNU Affero General Public License v3.0
986 stars 471 forks source link

"Illegal instruction (core dumped)" problem #19

Open vladkraievskiy opened 8 years ago

vladkraievskiy commented 8 years ago
OpenWebRX - Open Source SDR Web App for Everyone!  | for license see LICENSE file in the package
_________________________________________________________________________________________________

Author contact info:    Andras Retzler, HA7ILM <randras@sdr.hu>

[openwebrx-import] Found plugin: plugins.dsp.csdr.plugin
[openwebrx-main] Started rtl thread: rtl_sdr -s 250000 -f 145525000 -p 0 - | nc -vvl 127.0.0.1 8888
[openwebrx-main] Started rtl_mus.
Listening on [127.0.0.1] (family 0, port 8888)
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM

rtl_mus: Multi-User I/Q Data Server for RTL-SDR v0.22, made at HA5KFU Amateur Radio Club (http://ha5kfu.hu)
    code by Andras Retzler, HA7ILM <randras@sdr.hu>
    distributed under GNU GPL v3

2016-02-03 22:52:04,689 INFO Server is UP
2016-02-03 22:52:04,692 INFO Server listening on port: 4951
Connection from [127.0.0.1] port 8888 [tcp/*] accepted (family 2, sport 37714)
Found Rafael Micro R820T tuner
Exact sample rate is: 250000.000414 Hz
[R82XX] PLL not locked!
Sampling at 250000 S/s.
Tuned to 145525000 Hz.
Tuner gain set to automatic.
Reading samples in async mode...
[openwebrx-main] Starting watchdog threads.
[openwebrx-main] Starting spectrum thread.
[openwebrx-main] Starting HTTP server.
 [openwebrx-spectrum] Spectrum thread initialized successfully.
[openwebrx-dsp-plugin:csdr] Command = sleep 1; nc -v localhost 4951 | csdr convert_u8_f | csdr flowcontrol 3000000 10 | csdr fft_cc 4096 27777 | csdr logpower_cf -70 | csdr fft_exchange_sides_ff 4096 | csdr compress_fft_adpcm_f_u8 4096
[openwebrx-spectrum] Spectrum thread started.
2016-02-03 22:52:05,783 INFO rtl_tcp host connection estabilished
2016-02-03 22:52:06,673 INFO client accepted: 0@127.0.0.1:56654  users now: 1
Connection to localhost 4951 port [tcp/*] succeeded!
Illegal instruction (core dumped)
Illegal instruction (core dumped)
2016-02-03 22:52:07,107 INFO client disconnected: 0@127.0.0.1
37.229.155.161 - - [03/Feb/2016 22:52:10] "GET / HTTP/1.1" 200 -
[openwebrx-httpd] client 37.229.155.161#4d004fd79a71ee9dfdc168280757680a :: client added. Clients now: 1
37.229.155.161 - - [03/Feb/2016 22:52:10] "GET /openwebrx.css HTTP/1.1" 200 -
37.229.155.161 - - [03/Feb/2016 22:52:10] "GET /sdr.js HTTP/1.1" 200 -
37.229.155.161 - - [03/Feb/2016 22:52:10] "GET /openwebrx.js HTTP/1.1" 200 -
37.229.155.161 - - [03/Feb/2016 22:52:10] "GET /gfx/openwebrx-top-photo.jpg HTTP/1.1" 200 -
37.229.155.161 - - [03/Feb/2016 22:52:10] "GET /gfx/openwebrx-top-logo.png HTTP/1.1" 200 -
37.229.155.161 - - [03/Feb/2016 22:52:11] "GET /gfx/font-expletus-sans/ExpletusSans-Medium.ttf HTTP/1.1" 200 -
37.229.155.161 - - [03/Feb/2016 22:52:11] "GET /gfx/openwebrx-ha5kfu-top-logo.png HTTP/1.1" 200 -
37.229.155.161 - - [03/Feb/2016 22:52:11] "GET /gfx/openwebrx-rx-details-arrow-up.png HTTP/1.1" 200 -
37.229.155.161 - - [03/Feb/2016 22:52:11] "GET /gfx/openwebrx-avatar.png HTTP/1.1" 200 -
37.229.155.161 - - [03/Feb/2016 22:52:11] "GET /gfx/openwebrx-avatar-background.png HTTP/1.1" 200 -
37.229.155.161 - - [03/Feb/2016 22:52:11] "GET /gfx/openwebrx-rx-details-arrow.png HTTP/1.1" 200 -
37.229.155.161 - - [03/Feb/2016 22:52:11] "GET /gfx/openwebrx-background-cool-blue.png HTTP/1.1" 200 -
37.229.155.161 - - [03/Feb/2016 22:52:11] "GET /gfx/openwebrx-scale-background.png HTTP/1.1" 200 -
37.229.155.161 - - [03/Feb/2016 22:52:11] "GET /gfx/openwebrx-panel-log.png HTTP/1.1" 200 -
37.229.155.161 - - [03/Feb/2016 22:52:11] "GET /gfx/openwebrx-panel-receiver.png HTTP/1.1" 200 -
37.229.155.161 - - [03/Feb/2016 22:52:11] "GET /gfx/openwebrx-panel-status.png HTTP/1.1" 200 -
37.229.155.161 - - [03/Feb/2016 22:52:11] "GET /favicon.ico HTTP/1.1" 200 -
[openwebrx-dsp-plugin:csdr] Command = nc -v localhost 4951 | csdr convert_u8_f | csdr flowcontrol 3000000 10 | csdr shift_addition_cc --fifo /tmp/openwebrx_pipe_140350216572584_shift | csdr fir_decimate_cc 22 0.0068178 HAMMING | csdr bandpass_fir_fft_cc --fifo /tmp/openwebrx_pipe_140350216572584_bpf 0.0281615770483 HAMMING | csdr fmdemod_quadri_cf | csdr limit_ff | csdr fractional_decimator_ff 1.03065759637 | csdr deemphasis_nfm_ff 11025 | csdr fastagc_ff | csdr convert_f_i16 | csdr encode_ima_adpcm_i16_u8
csdr: fifo control mode on
fir_decimate_cc: taps_length = 587
csdr: fifo control mode on
fractional_decimator_ff: window = HAMMING
fractional_decimator_ff: taps_length = 133
shift_addition_cc: reinitialized to -0
[openwebrx-spectrum] client spectrum queue full, closing it.
[openwebrx-httpd] client 37.229.155.161#4d004fd79a71ee9dfdc168280757680a :: client being closed.
[openwebrx-httpd:ws] client closed by other thread
[openwebrx-dsp-plugin:csdr] stop() :: unlink failed: /tmp/openwebrx_pipe_140350216572584_bpf
[openwebrx-dsp-plugin:csdr] stop() :: unlink failed: /tmp/openwebrx_pipe_140350216572584_bpf
[openwebrx-httpd] client cannot be closed:  <class '__main__.ClientNotFoundException'>
  File "./openwebrx.py", line 448, in do_GET
    id_to_close=get_client_by_id(myclient.id,False)
  File "./openwebrx.py", line 251, in get_client_by_id
    raise ClientNotFoundException

I'm using Ubuntu 14.04 LTS. For installation used this guide. When I open chrome, it states WebSocket has closed unexpectedly. Please reload the page.. What I can to do? I have already attempted the nc -p\ncat edits to configure_webrx.py. Thanks.

ha7ilm commented 8 years ago

Seems like csdr fails:

Illegal instruction (core dumped)
Illegal instruction (core dumped)

Maybe it is a problem with compiler flags. Could you provide more information about your hardware (PC/embedded)?

Could you also post the output of the following:

cat /proc/cpuinfo

...and the output of:

cd csdr
make
vladkraievskiy commented 8 years ago
pavel@pavel-System-Product-Name:~$ cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 16
model           : 6
model name      : AMD Athlon(tm) II X2 250 Processor
stepping        : 2
microcode       : 0x100009f
cpu MHz         : 1800.000
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate npt lbrv svm_lock nrip_save vmmcall
bugs            : tlb_mmatch apic_c1e fxsave_leak
bogomips        : 5999.82
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 16
model           : 6
model name      : AMD Athlon(tm) II X2 250 Processor
stepping        : 2
microcode       : 0x100009f
cpu MHz         : 800.000
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate npt lbrv svm_lock nrip_save vmmcall
bugs            : tlb_mmatch apic_c1e fxsave_leak
bogomips        : 5999.82
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

pavel@pavel-System-Product-Name:~$ cd csdr/
pavel@pavel-System-Product-Name:~$ sudo make

rm -f dumpvect*.vect
NOTE: you may have to manually edit Makefile to optimize for your CPU (especially if you compile on ARM, please edit PARAMS_NEON).
Auto-detected optimization parameters: -msse -msse2 -msse4 -mfpmath=sse

c99 -O3 -ffast-math -fdump-tree-vect-details -dumpbase dumpvect -msse -msse2  -msse4   -mfpmath=sse  fft_fftw.c libcsdr_wrapper.c  -g -lm -lrt -lfftw3f -DUSE_FFTW -DLIBCSDR_GPL -DUSE_IMA_ADPCM -Wno-unused-result -fpic -shared -o libcsdr.so
./parsevect dumpvect*.vect

Auto-vectorization built into gcc can increase the execution speed of algorithms with automatic
generation of SIMD instructions if the CPU is capable.
We parse the output of the vectorizer to analyze which loops could be optimized (thus speeded up) this way.
Warning! The result may be different on different CPU architectures...

Colors:
  - can't be vectorized
  - successfully vectorized
  - not intended to be vectorized (not important)

libcsdr.c:137: note: LOOP VECTORIZED.  firdes_lowpass_f: normalize pass 2
libcsdr.c:133: note: LOOP VECTORIZED.  firdes_lowpass_f: normalize pass 1
libcsdr.c:125: note: not vectorized: number of iterations cannot be computed.  firdes_lowpass_f: calculate taps
libcsdr.c:155: note: not vectorized: multiple nested loops.  firdes_bandpass_c
libcsdr.c:161: note: not vectorized: number of iterations cannot be computed.  firdes_bandpass_c
libcsdr.c:160: note: not vectorized: number of iterations cannot be computed.  firdes_bandpass_c
libcsdr.c:192: note: not vectorized: multiple nested loops.  shift_math_cc
libcsdr.c:203: note: not vectorized: number of iterations cannot be computed.  shift_math_cc: normalize phase
libcsdr.c:202: note: not vectorized: number of iterations cannot be computed.  shift_math_cc: normalize phase
libcsdr.c:216: note: not vectorized: relevant stmt not supported: _18 = __builtin_sinf (_17);
libcsdr.c:236: note: not vectorized: multiple nested loops.  shift_math_cc
libcsdr.c:261: note: not vectorized: number of iterations cannot be computed.  shift_math_cc: normalize phase
libcsdr.c:260: note: not vectorized: number of iterations cannot be computed.  shift_math_cc: normalize phase
libcsdr.c:279: note: not vectorized: multiple nested loops.  fir_decimate_cc: i loop
libcsdr.c:281: note: LOOP VECTORIZED.  fir_decimate_cc: q loop
libcsdr.c:279: note: LOOP VECTORIZED.  fir_decimate_cc: i loop
libcsdr.c:300: note: not vectorized: inner-loop count not invariant.
libcsdr.c:306: note: LOOP VECTORIZED.  rational_resampler_ff (inner loop)
libcsdr.c:360: note: LOOP VECTORIZED.  fir_one_pass_ff
libcsdr.c:381: note: not vectorized: multiple nested loops.  fractional_decimator_ff
libcsdr.c:360: note: LOOP VECTORIZED.  fir_one_pass_ff
libcsdr.c:360: note: LOOP VECTORIZED.  fir_one_pass_ff
libcsdr.c:360: note: LOOP VECTORIZED.  fir_one_pass_ff
libcsdr.c:427: note: LOOP VECTORIZED.  apply_fir_fft_cc: add overlap
libcsdr.c:421: note: LOOP VECTORIZED.  apply_fir_fft_cc: normalize by fft_size
libcsdr.c:409: note: LOOP VECTORIZED.  apply_fir_fft_cc: multiplication
libcsdr.c:453: note: LOOP VECTORIZED.  amdemod: sqrt
libcsdr.c:448: note: LOOP VECTORIZED.  amdemod: i*i+q*q
libcsdr.c:472: note: LOOP VECTORIZED.  amdemod_estimator
libcsdr.c:495: note: not vectorized, possible dependence between data-refs *_23 and *_16  dcblock_f
libcsdr.c:519: note: LOOP VECTORIZED.  fastdcblock_ff: remove DC component
libcsdr.c:511: note: LOOP VECTORIZED.  fastdcblock_ff: calculate block average
libcsdr.c:557: note: LOOP VECTORIZED.  fastagc_ff: apply gain
libcsdr.c:542: note: LOOP VECTORIZED.  fastagc_ff: peak search
libcsdr.c:592: note: not vectorized: unsupported use in stmt.  fmdemod_atan_novect
libcsdr.c:610: note: not vectorized: complicated access pattern.  fmdemod_quadri_novect_cf
libcsdr.c:648: note: LOOP VECTORIZED.  fmdemod_quadri_cf: output division
libcsdr.c:644: note: LOOP VECTORIZED.  fmdemod_quadri_cf: output denomiator
libcsdr.c:640: note: LOOP VECTORIZED.  fmdemod_quadri_cf: output numerator
libcsdr.c:635: note: LOOP VECTORIZED.  fmdemod_quadri_cf: di
libcsdr.c:629: note: LOOP VECTORIZED.  fmdemod_quadri_cf: dq
libcsdr.c:677: note: not vectorized, possible dependence between data-refs *_29 and *_24  deemphasis_wfm_ff
libcsdr.c:707: note: LOOP VECTORIZED.  deemphasis_nfm_ff: inner loop
libcsdr.c:715: note: LOOP VECTORIZED.  limit_ff
libcsdr.c:724: note: LOOP VECTORIZED.  gain_ff
libcsdr.c:743: note: not vectorized: control flow in loop.  log2n
libcsdr.c:758: note: not vectorized: control flow in loop.  next_pow2
libcsdr.c:766: note: not vectorized: loop contains function calls or data references that cannot be analyzed  apply_window_c
libcsdr.c:777: note: not vectorized: loop contains function calls or data references that cannot be analyzed  apply_window_f
libcsdr.c:790: note: LOOP VECTORIZED.  logpower_cf: pass 3
libcsdr.c:788: note: not vectorized: relevant stmt not supported: _33 = __builtin_log10f (_32);  logpower_cf: pass 2
libcsdr.c:786: note: LOOP VECTORIZED.  logpower_cf: pass 1
libcsdr.c:805: note: LOOP VECTORIZED.  convert_u8_f
libcsdr.c:810: note: LOOP VECTORIZED.  convert_s8_f
libcsdr.c:815: note: LOOP VECTORIZED.  convert_i16_f
libcsdr.c:820: note: LOOP VECTORIZED.  convert_f_u8
libcsdr.c:827: note: LOOP VECTORIZED.  convert_f_s8
libcsdr.c:837: note: LOOP VECTORIZED.  convert_f_i16
libcsdr.c:844: note: LOOP VECTORIZED.  trivial_vectorize: should pass :-)
libcsdr_gpl.c:50: note: not vectorized: number of iterations cannot be computed.  shift_addition_cc: normalize starting_phase
libcsdr_gpl.c:49: note: not vectorized: number of iterations cannot be computed.  shift_addition_cc: normalize starting_phase
libcsdr_gpl.c:37: note: not vectorized: unsupported use in stmt.  shift_addition_cc: work
libcsdr_gpl.c:77: note: not vectorized: number of iterations cannot be computed.  shift_addition_cc: work
libcsdr_gpl.c:77: note: not vectorized: Bad inner loop.  shift_addition_cc: work
libcsdr_gpl.c:84: note: not vectorized: number of iterations cannot be computed.  shift_addition_cc: normalize phase
libcsdr_gpl.c:131: note: not vectorized: number of iterations cannot be computed.  shift_addition_cc: normalize starting_phase
libcsdr_gpl.c:130: note: not vectorized: number of iterations cannot be computed.  shift_addition_cc: normalize starting_phase
libcsdr_gpl.c:115: note: not vectorized: number of iterations cannot be computed.  shift_addition_cc: work
libcsdr_gpl.c:171: note: not vectorized: control flow in loop.  agc_ff
ima_adpcm.c:157: note: not vectorized: not suitable for gather load step_42 = _stepSizeTable[state$index_36];
ima_adpcm.c:168: note: not vectorized: not suitable for gather load step_34 = _stepSizeTable[state$index_30];
c99 -O3 -ffast-math -fdump-tree-vect-details -dumpbase dumpvect -msse -msse2  -msse4   -mfpmath=sse  csdr.c -g -lm -lrt -lfftw3f -DUSE_FFTW -DLIBCSDR_GPL -DUSE_IMA_ADPCM -L. -lcsdr -Wno-unused-result -o csdr
bogstandard commented 8 years ago

I'm also facing similar issues on my AMD processor machine. After the localhost is declared open the next line is "illegal instruction".

I am running the very same OS and software as my Intel machine and I only get this error on the AMD Processor machine.

Are you able to say what would be the correct flags to have on the csdr makefile for an AMD Processor?

ha7ilm commented 8 years ago

A temporary solution for this problem would be removing the $(call cpufeature,sse4,-msse4) from the Makefile of csdr:

PARAMS_SSE = $(call cpufeature,sse,-msse) $(call cpufeature,sse2,-msse2) $(call cpufeature,sse3,-msse3) $(call cpufeature,sse4_1,-msse4.1) $(call cpufeature,sse4_2,-msse4.2) -mfpmath=sse 

(the problematic line here without the forced SSE4 support)

...and then recompiling and reinstalling csdr (with make && sudo make install). Does it solve the problem for you?

US1GHQ commented 8 years ago

For me this solution is helped, Thanks

vladkraievskiy commented 8 years ago

Thanks, that solved a problem for me too.

cfenell commented 5 years ago

Hi, I am looking forward to testing this! However I also encounter csdr compilation errors and a program crash on my laptop, Intel Core i3-4030U. This is the cpuinfo and csdr make output: cpuinfo.txt makeout.txt

openwebrx.py prints out these errors: free(): double free detected in tcache 2 Aborted csdr squelch_and_smeter_cc: initial squelch level is 0 Signal caught, exiting! Short write, samples lost, exiting! [openwebrx-spectrum] client spectrum queue full, closing it. [openwebrx-httpd] client 127.0.0.1#6131c19b85d63f8acf1067cb05deeacb :: client being closed. [openwebrx-httpd:ws] client closed by other thread [openwebrx-dsp-plugin:csdr] try_delete_pipes() :: [Errno 2] No such file or directory: '/tmp/openwebrx_pipe_139709838640912_bpf_pipe' [openwebrx-dsp-plugin:csdr] try_delete_pipes() :: [Errno 2] No such file or directory: '/tmp/openwebrx_pipe_139709838640912_shift_pipe' [openwebrx-dsp-plugin:csdr] try_delete_pipes() :: [Errno 2] No such file or directory: '/tmp/openwebrx_pipe_139709838640912_squelch_pipe' [openwebrx-dsp-plugin:csdr] try_delete_pipes() :: [Errno 2] No such file or directory: '/tmp/openwebrx_pipe_139709838640912_smeter_pipe' [openwebrx-httpd] client cannot be closed: <class 'main.ClientNotFoundException'>

Hope this helps additional debugging. Are there any suggested Makefile settings to try for my CPU?

Best 73s de Fredrik SM2YHP

ha7ilm commented 5 years ago

Fredrik,

It is rather related to this bug: https://github.com/simonyiszk/csdr/issues/40

Andras

ha7ilm commented 5 years ago

@cfenell I've proposed a fix for your problem. Try to update to the latest csdr, and please give feedback at simonyiszk/csdr#40 if it worked.