Applications, development tools, FPGA, C, WEB
#7023 by vladog
Thu Jan 12, 2017 12:04 pm

I was trying to create web app communicating with client through ajax interface. It did not work and simplifying this I got to the basics of problem:

- I built the app 1.template from ... 1.template
- I opened the app from browser on another comp (the app worked normally)
- I sent the request "/data" (
- I got
Code: Select all{
    "app": { },
    "datasets": { },
    "status": "ERROR",
    "reason": "Application not loaded"

- In the time of "/data" request the following messages were written to /var/log/redpitaya_nginx/debug.log:
Code: Select all2017/01/12 10:34:04 [alert] 3777#0: worker process 4791 exited on signal 11
2017/01/12 10:34:04 [error] 5208#0: *403 Application not loaded, client:, server: , request: "GET /data HTTP/1.1", host: ""
2017/01/12 10:34:04 [alert] 5208#0: *403 the http output chain is empty, client:, server: , request: "GET /data HTTP/1.1", host: ""

Signal 11 means segmentation fault - the result of unresolved references, memory overwrites... but in such elementary application it is hidden somewhere in the environment.

Has somebody any idea about the reason of the problem? Of course - it is possible to use websocket for client - server data exchange. Anyways, I do not like applications which crash from unknown reasons.

I am using RP image "red_pitaya_OS-v0.96-RC1-20-14_jul.img", all app builds where performed on RP device.

Thanks for help
#7029 by Nils Roos
Sat Jan 14, 2017 1:40 am

I had a look over the 1.template application, and the problem is a bad interaction between the nginx bazaar plugin and the application.

The plugin calls the "int rp_get_signals(float ***s, int *sig_num, int *sig_len)" function with pointers to uninitialized variables sig_num and sig_len, and when the application returns a success (=0), the plugin assumes that sig_num and sig_len contain valid values.

But the template application returns success without setting these variables, so the plugin continues with the uninitialized (=random) values. This can lead to a SEGFAULT or other unexpected behaviour when you use the /data request.

When you change main.cpp with the following, it wont crash anymore.
Code: Select allint rp_get_signals(float ***s, int *sig_num, int *sig_len)
    return 0;

Who is online

Users browsing this forum: No registered users and 2 guests