Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Caught signal 11" - looping after one period #4

Closed
sm3ulc opened this issue Jun 15, 2016 · 17 comments
Closed

"Caught signal 11" - looping after one period #4

sm3ulc opened this issue Jun 15, 2016 · 17 comments

Comments

@sm3ulc
Copy link

sm3ulc commented Jun 15, 2016

I run "rtlsdr_wsprd -c xxx -l xxxx -g 20 -p -23 -o 125000000 -f 10138.6k" on my rpi-1B and it starts ok and run one period and right after just prints "Caught signal 11" in a loop. Unhandled crash?

Trace of one run can be found here: (started some 77s before interval)

http://www.update.uu.se/~davidl/tmp/wsprd-trace

@Guenael
Copy link
Owner

Guenael commented Jun 16, 2016

Well, it could be a buffer overflow or a problem with the driver callback (low or no response).
Your rpi 1 has only one core, and the decoding process takes a lot of CPU. I use 2 threads and if this second thread used for decoding takes too much CPU, the driver could not be able to push the samples.
I'm not sure, but it could be good explanation.
Could you try with a rpi 2 ?
A solution could be to change the decoding thread priority (code side), but I have no guarantees.

@Guenael
Copy link
Owner

Guenael commented Jun 16, 2016

BTW, thx for reporting this issue.

@Guenael
Copy link
Owner

Guenael commented Jun 16, 2016

@sm3ulc
Copy link
Author

sm3ulc commented Jun 16, 2016

Have been running a few tests on the 1B:

110s raw 250 kS IQ and demodulated with csdr to wav with 12k samplerate.
The decoding with wsprd (from wsjt) takes 4 seconds.
rtlsd_wsprd takes about 23% of cpu when running.
Should be pretty fine with the cpu-power i think. Maybe adding lower priority to the decodingthread in order to not disturb the realtime sampling.

I don't own a pi2 so can't do testing on that model.

Btw.. demodulation with csdr as I run it via my script it takes 92 seconds just to demod on the 1B..

@Guenael
Copy link
Owner

Guenael commented Jun 16, 2016

Ok, I will try to fix this using pthread_attr_setschedparam.
Note to myself :
#include <pthread.h>
#include <sched.h>

pthread_attr_t tattr;
pthread_t tid;
int ret;
int newprio = 20;
sched_param param;

/* initialized with default attributes */
ret = pthread_attr_init (&tattr);

/* safe to get existing scheduling param */
ret = pthread_attr_getschedparam (&tattr, &param);

/* set the priority; others are unchanged */
param.sched_priority = newprio;

/* setting the new scheduling param */
ret = pthread_attr_setschedparam (&tattr, &param);

/* with new priority specified */
ret = pthread_create (&tid, &tattr, func, arg);

@Guenael
Copy link
Owner

Guenael commented Jun 25, 2016

Hello,
Pthread priority added, but I have no RPi-1 to test this functionality.

@Guenael
Copy link
Owner

Guenael commented Jun 25, 2016

Issue not solved, same problem reported (by VE2VAX)

@ve2vax
Copy link

ve2vax commented Jun 25, 2016

use the -S (single pass mode, no subtraction (same as original wsprd)).

Solved the problem for me.
./rtlsdr_wsprd -f 144.489M -c VE2VAX -l FN35JO -a 1 -S

@ve2vax
Copy link

ve2vax commented Jun 25, 2016

The problem , happen when dec_options.subtraction is set =1

@sm3ulc
Copy link
Author

sm3ulc commented Jun 25, 2016

Is the code pushed?

Skickat från min Samsung-enhet

-------- Originalmeddelande --------
Från: "Guenael, VA2GKA" notifications@github.com
Datum: 25-06-2016 03:00 (GMT+01:00)
Till: Guenael/rtlsdr-wsprd rtlsdr-wsprd@noreply.github.com
Kopia: sm3ulc sm3ulc@gmail.com, Author author@noreply.github.com
Rubrik: Re: [Guenael/rtlsdr-wsprd] "Caught signal 11" - looping after one
period (#4)

Hello,

Pthread priority added, but I have no RPi-1 to test this functionality.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@Guenael
Copy link
Owner

Guenael commented Jun 25, 2016

Yep, the code is updated, but I'm not sure if the priority works really. I'll need to take time to check this point carefully.
@ve2vax : The fano alog take more processing (option substraction). The program crash when the callback is not available. The only way to fix this is using a very low priority. But for now, it don't works...
BTW, thanks for helping.

@sm3ulc
Copy link
Author

sm3ulc commented Jun 25, 2016

I can test code monday night. Utc+1 :)
// David
Skickat från min Samsung-enhet

-------- Originalmeddelande --------
Från: "Guenael, VA2GKA" notifications@github.com
Datum: 25-06-2016 19:45 (GMT+01:00)
Till: Guenael/rtlsdr-wsprd rtlsdr-wsprd@noreply.github.com
Kopia: sm3ulc sm3ulc@gmail.com, Author author@noreply.github.com
Rubrik: Re: [Guenael/rtlsdr-wsprd] "Caught signal 11" - looping after one
period (#4)

Yep, the code is updated, but I'm not sure if the priority works really. I'll need to take time to check this point carefully.

@ve2vax : The fano alog take more processing (option substraction). The program crash when the callback is not available. The only way to fix this is using a very low priority. But for now, it don't works...

BTW, thanks for helping.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@sm3ulc
Copy link
Author

sm3ulc commented Jul 1, 2016

Hi all!

Finally had the ability to do a quick test on an rpi1b. Seem to get some
runs with no signal11 stops and some runs it seems ok.

73

// David

On Sun, Jun 26, 2016 at 1:33 AM, David sm3ulc@gmail.com wrote:

I can test code monday night. Utc+1 :)

// David

Skickat från min Samsung-enhet

-------- Originalmeddelande --------
Från: "Guenael, VA2GKA" notifications@github.com
Datum: 25-06-2016 19:45 (GMT+01:00)
Till: Guenael/rtlsdr-wsprd rtlsdr-wsprd@noreply.github.com
Kopia: sm3ulc sm3ulc@gmail.com, Author author@noreply.github.com
Rubrik: Re: [Guenael/rtlsdr-wsprd] "Caught signal 11" - looping after one
period (#4)

Yep, the code is updated, but I'm not sure if the priority works really.
I'll need to take time to check this point carefully.
@ve2vax https://github.com/ve2vax : The fano alog take more processing
(option substraction). The program crash when the callback is not
available. The only way to fix this is using a very low priority. But for
now, it don't works...
BTW, thanks for helping.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ARdPKdqNBBDwTKnBJ6cz8o7HPMNvLHisks5qPWk4gaJpZM4I2x0z
.

@Guenael
Copy link
Owner

Guenael commented Jul 3, 2016

Hello,
I fixed a malloc bug present only with gcc5 (usually the case with Raspberrian).
Please retest. Thx.

@Guenael
Copy link
Owner

Guenael commented Jul 14, 2016

I tested this update on RPi 1 during 48h without issue. But some versions of Raspberian react badly with USB, I added a note to the README file :

I noticed some disconnection problems with USB port while using Raspbian Jessie (2016-05-27-raspbian-jessie-lite.img). I rollbacked to Raspbian Wheezy (2015-02-16-raspbian-wheezy.img) and the problems solved by themself magically... For now, I have not investigated this issue, but if you experience some "Caught signal 11" error message, it could be this same problem. For now, I would recommend Raspbian Wheezy v2015-02-16.

Closing this issue. Thx

@Guenael Guenael closed this as completed Jul 14, 2016
@zodoczi
Copy link

zodoczi commented Jan 27, 2017

Hello,

I see the same problem, using RPi 3 with 2017-01-11-raspbian-jessie.img

73,
Zoltan

caught_signal_11.txt

@rbw42
Copy link

rbw42 commented Feb 14, 2018

Hi all,
I'm running a pi2 with jessie having the same problem.

Not sure if this code is still being maintained, but this problem appears to be a bug due to unsafe string handling in wsprsim_utils.c. There are several places where something could go wrong, but I have fixed this problem with a combination of stack smashing protection compiler options (which doesn't fix the actual problem) and changing the size of the temporary string message[23] in wsprsim_utils.c to be 24 chars, not 23. Also ensuring that string is properly terminated.

So around line 189, change the variable declarations and array initialisation to:

char grid4[5], message[24];

memset(message,0,sizeof(message));

I can send a patch if that is useful.

Regards,
Randall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants