core dump on linux with err variable
hello,
I declared variable called err as int variable. there is function called fun_calculate which returns the status to err variable, when the return type value has being written in err variable it core dumps. Can any one help me to understand why this core dump if i write value in to err variable? Is it related with variable name collision? Please let me know. Thank you in advance. Thanks, Deenadayalan |
I think we need to see some code.
|
core dump on linux with err variable
Quote:
the core dump is because of my code has global variable called err and the other hand err is function defined in err.h in gcc, it seems that when linker links all the .o files it picks up err definition from the libc.so.6 file instead of from my code (definition err variable) so it causes the core dump when there is write in err global variable (err=2). here is the log from LD_DEBUG. main_ml.so to /lib/tls/libc.so.6: normal symbol `err' Thanks & Regards Deenadayalan |
I haven't a clue about this, I'm afraid. Hopefully someone else will see your thread.
|
well, try to rename your global variable 'err' to see what happens then. If the problem persists, please post code.
|
core dump on linux with err variable
Quote:
If i change my variable name from err to some other name for example myerr then it is not crashing because there is no clash between user code (executable) and with libc.so.6. the crash is mainly because of err variabel if i change the variable name then there is no core dump. Thanks, Deenadayalan |
All times are GMT -5. The time now is 02:19 PM. |