rtapi_app: caught signal 11-dumping core

More
2 years 9 months ago - 2 years 8 months ago #291879 by bobwolf
Hello everyone
new week new problem ;-)
I modified the siggen.c program to make it do other things and if I put it in the .hal file where I activate it
loadrt IOdecoder input=16 output=16
the program runs and does its job
but if I put different input output numbers, for example
input=16 output=32
when I open LINUXCNC it gives me the error
rtapi_app: caught signal 11-dumping core
and it turns off my threads
with equal numbers it always works
I'll put the parts where the component is created where I think the error is
Code:
static int input; static int output; RTAPI_MP_INT(input, "number input channels"); RTAPI_MP_INT(output, "number output channels"); #define MAX_INPUT 32 #define MAX_OUTPUT 32 typedef struct { hal_bit_t *clock; /* pin: clock */ hal_bit_t *data; /* pin: data */ hal_bit_t *l_input; /* pin: latch input */ hal_bit_t *l_output; /* pin: latch output */ hal_bit_t *in_com; /* pin: input common */ hal_float_t *frequency; /* pin: frequency */ hal_float_t *debug; /* pin: debug */ hal_bit_t *in_bit[MAX_INPUT]; hal_bit_t *out_bit[MAX_OUTPUT]; double index; /* position within output cycle */ } hal_IOdecoder_t; /* pointer to array of IOdecoder_t structs in shared memory, 1 per gen */ static hal_IOdecoder_t *IOdecoder_array; /* other globals */ static int comp_id;        /* component ID */ static int export_IOdecoder(int num, hal_IOdecoder_t * addr,char* prefix); static void calc_IOdecoder(void *arg, long period); int rtapi_app_main(void) { int n, retval, i; int howmany; n=0; /* have good config info, connect to the HAL */     comp_id = hal_init("IOdecoder");     if (comp_id < 0) {     rtapi_print_msg(RTAPI_MSG_ERR, "IOdecoder: ERROR: hal_init() failed\n");     return -1;     } /* allocate shared memory for IOdecoder data */ howmany = 1; IOdecoder_array = hal_malloc(howmany * sizeof(hal_IOdecoder_t)); if (IOdecoder_array == 0) {     rtapi_print_msg(RTAPI_MSG_ERR, "IOdecoder: ERROR: hal_malloc() failed\n");     hal_exit(comp_id);     return -1; } /* export variables and functions for each IOdecoder */ char buf[HAL_NAME_LEN + 1]; rtapi_snprintf(buf, sizeof(buf), "IOdecoder"); retval = export_IOdecoder(n, &;(IOdecoder_array[n]),buf); rtapi_print_msg(RTAPI_MSG_INFO,     "IOdecoder: installed %d input and %d output\n", input, output);     hal_ready(comp_id);     return 0; } static int export_IOdecoder(int num, hal_IOdecoder_t * addr,char* prefix) { int retval; int i=0; /* export pins */ for (i = 0; i < input; i++) {     retval = hal_pin_bit_newf(HAL_OUT, &;(addr->in_bit[i]), comp_id, "%s.input.%02i", prefix, i);         if (retval != 0) {             return retval;        }     *(addr->in_bit[i]) = 0; } for (i = 0; i < output; i++) {     retval = hal_pin_bit_newf(HAL_IN, &;(addr->out_bit[i]), comp_id, "%s.output.%02i", prefix, i);     if (retval != 0) {         return retval;     }     *(addr->out_bit[i]) = 0; } /* export function for this loop */ char support[HAL_NAME_LEN + 1]; rtapi_snprintf(support, sizeof(support), "%s.update", prefix); retval = hal_export_funct(support, calc_IOdecoder, &;(IOdecoder_array[num]), 0, 0, comp_id); if (retval != 0) {     rtapi_print_msg(RTAPI_MSG_ERR, "IOdecoder: ERROR: update funct export failed\n");     hal_exit(comp_id);     return -1; } return 0; }

naturally there are other lines in the program... I only wrote these so as not to clog up the post too much... if you want I'll share the whole program[/i][/i][/i][/i]
Last edit: 2 years 8 months ago by andypugh.

Please Log in or Create an account to join the conversation.

More
2 years 9 months ago #292013 by bobwolf
can anyone help me?

Please Log in or Create an account to join the conversation.

More
2 years 8 months ago #292401 by andypugh
Does it create the HAL pins and the function? If it does, then the error is probably in the realtime function, which I don't see in your posted code.

Errors like this generally indicate a write outside the bounds of an array.
The following user(s) said Thank You: bobwolf

Please Log in or Create an account to join the conversation.

More
2 years 8 months ago #292409 by jmelson
I would recommend running memtest86, which is part of the install on the PC versions of LinuxCNC. Of course, this may well be a coding vulnerability on that particular HAL component, maybe somebody else could test it. I don't see the error on a quick look.
Jon
The following user(s) said Thank You: bobwolf

Please Log in or Create an account to join the conversation.

More
2 years 8 months ago #292550 by bobwolf
I found the error... thanks for directing me to understand where to look... in the loop at a certain point I was going to write a pin that didn't exist... as if it were a for loop in which I was wrong to give it the parameter end of loop
now it also works with input != output
A thousand thanks
ciao
Roberto
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
2 years 7 months ago - 2 years 7 months ago #296611 by RJB510
Hi everyone, 
I'm also experiencing this same issue. 
I've just upgraded from 2.8 and installed a fresh version of Linuxcnc 2.9.2 and when going through stepconf it won't let me test the motors and when i load Axis interface or QTdragon, it's immediately giving me the error: RTAPI_APP: Caught Signal 11 - Dumping Core.

Any recommendations? Try another fresh installation?

The rest of the system seems to be working correctly, but unable to use the machine. 

Cheers
Last edit: 2 years 7 months ago by RJB510.

Please Log in or Create an account to join the conversation.

Time to create page: 0.300 seconds
Powered by Kunena Forum