S
steve
Well I've been working all morning and have finally found the source of
my "bus error (signal 10)" errors. The source is odd. The error
occurs in any function where I make the function call:
(void)sprintf(ptr_testing, "This is my string");
This in itself isn't where the actual error occurs. The error occurs
at any later point, in the same function where the sprintf() call is
made, where I try to assign a value to one of the variables in one of
my data structures. The lines are syntactically reminiscent of:
((lst_vals *)userInst->seniorData)->lst_T_chan = (double) 340.0;
Where the seniorData is a pointer to a lst_vals data structure defined
as follows:
/*data structure for seniorData to point to*/
typedef struct {
double lst_T_chan, current_T_chan, lst_t, current_t;
} lst_vals;
Any ideas on what's going on? It's way beyond me. I orginally thought
that it was a simple typecasting problem, I'm pretty sure I'm wrong.
It's extremely odd because any number of commands between those two
lines of code will be executed. The instant the assignment shown above
is reached the program exits with signal 10.
Thanks in advance,
Steve
my "bus error (signal 10)" errors. The source is odd. The error
occurs in any function where I make the function call:
(void)sprintf(ptr_testing, "This is my string");
This in itself isn't where the actual error occurs. The error occurs
at any later point, in the same function where the sprintf() call is
made, where I try to assign a value to one of the variables in one of
my data structures. The lines are syntactically reminiscent of:
((lst_vals *)userInst->seniorData)->lst_T_chan = (double) 340.0;
Where the seniorData is a pointer to a lst_vals data structure defined
as follows:
/*data structure for seniorData to point to*/
typedef struct {
double lst_T_chan, current_T_chan, lst_t, current_t;
} lst_vals;
Any ideas on what's going on? It's way beyond me. I orginally thought
that it was a simple typecasting problem, I'm pretty sure I'm wrong.
It's extremely odd because any number of commands between those two
lines of code will be executed. The instant the assignment shown above
is reached the program exits with signal 10.
Thanks in advance,
Steve