Hello
i ve got the following error on a C servor.
signal SEGV (no mapping at the fault address)
when running in dbx
Reading ld.so.1
Reading libsocket.so.1
dbx: warning: The corefile has a different ELF checksum for /lib/libsocket.so.1
checksums are: file: 0xc331 core: 0x1a5c
See `help core mismatch' for more details.
Reading libnsl.so.1
dbx: warning: The corefile has a different ELF checksum for /lib/libnsl.so.1
checksums are: file: 0xda21 core: 0x2672
See `help core mismatch' for more details.
Reading libc.so.1
dbx: warning: The corefile has a different ELF checksum for /lib/libc.so.1
checksums are: file: 0x1357 core: 0x9eeb
See `help core mismatch' for more details.
dbx: can't stat /platform/sun4u-us3/lib/libc_psr.so.1 -- No such file or directory
Reading libc_psr.so.1
dbx: warning: Couldn't open file: /platform/sun4u-us3/lib/libc_psr.so.1 (No such file or directory)
dbx: internal error: Can't read /platform/sun4u-us3/lib/libc_psr.so.1
program terminated by signal SEGV (no mapping at the fault address)
0xff1d5cb4: srch_dir+0x0154: cmp %o1, %o0
Current function is _log
533 fprintf ( fp,"%s", "test" )
a where in dbx give me this
(dbx) where
[1] srch_dir(0x2008, 0xa0550, 0xa0550, 0xa0550, 0x0, 0x0), at 0xff1d5cb4
[2] ispts(0x2008, 0x1, 0x98904, 0x0, 0xff26e32c, 0xff2776f0), at 0xff1d5a6c
[3] 0xff2265ac(0x543e0, 0x6, 0x40, 0xffffffff, 0x4, 0x2000), at 0xff2265ab
[4] _rmutex_lock(0x3b754, 0xffbfece4, 0xff26e32c, 0x0, 0x40, 0x40), at 0xff219550
[5] mknod(0x543e0, 0x3b754, 0x503a8, 0x513b8, 0x2296c, 0xff26e32c), at 0xff21d040
=>[6] _log(msg = 0xffbff694, param = UNION), line 533 in "transf.c"
[7] Processus_serveur(0x5, 0x543b0, 0x0, 0x0, 0x65e10, 0x9), at 0x1a7a4
[8] demare(0x0, 0x1, 0x0, 0x0, 0x5, 0x4), at 0x199b4
[9] main(0x4, 0xffbff894, 0x0, 0x0, 0x1, 0x0), at 0x192ec
pstack core
core 'core' of 1202: /export/home/support_sofi/bin/support_sofi -detach -debug -nolog
ff1d5cb4 srch_dir (2008, a0550, a0550, a0550, 0, 0) + 154
ff1d5a6c ispts (2008, 1, 98904, 0, ff26e32c, ff2776f0) + 64
ff2265ac _sys_errs (543e0, 6, 40, ffffffff, 4, 2000) + 258
ff219550 _rmutex_lock (3b754, ffbfece4, ff26e32c, 0, 40, 40) + 68
ff21d040 mknod (543e0, 3b754, 503a8, 513b8, 2296c, ff26e32c) + 24
0001f624 ???????? (ffbff694, ffbff674, 200, 0, 0, 65e10)
0001a7a4 ???????? (5, 543b0, 0, 0, 65e10, 9)
000199b4 ???????? (0, 1, 0, 0, 5, 4)
000192ec ???????? (4, ffbff894, 0, 0, 1, 0)
00014d78 ???????? (0, 0, 0, 0, 0, 0)
here is the function which have the problem
void _log (struct msg_info * msg, union msg_param param)
{
struct msgin_log * pin;
struct msgout_log * pout;
char * c;
char Buffer[2048];
char fname[255];
time_t ti;
struct tm * tm = NULL;
FILE * fp = NULL;
trace ("_log begin");
pin = (struct msgin_log *)msg->data_in;
pout = (struct msgout_log *)msg->data_out;
msg->len_out = sizeof (struct msgout_log);
memset (pout, 0, sizeof (struct msgout_log));
trace ("_fin allocation");
// reconstitution du nom du fichier de log support_sofi.client.yyyy-mm-dd.log
time (&ti);
tm = localtime (&ti);
trace ("_fin time");
strncpy ( Buffer, pin->InMsg, 2048 );
sprintf ( fname, "support_sofi.client.%04d-%02d-%02d.log", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday );
trace ("_fin sprintf");
trace(fname);
fp = fopen (fname, "a");
trace ("_fin fopen");
if ( fp != NULL )
{
trace ("_start fprintf");
trace(Buffer);
fprintf ( fp,"%s", "test" );
//fwrite (Buffer , 1 , sizeof(Buffer) , fp );
//fputs(Buffer,fp);
trace ("_fin fprintf");
if (fclose (fp)!=0){
trace ("fclose failed");
}else{
trace("fclose success");
}
trace ("_fin fclose");
}
//strcpy ( pout->OutMsg, "" );
trace ("_log end");
}
this code work on a server but not on an other one, i would like to see why it doesn't work on the second servor.
Note that the core dump is created after the second call to the _log function
any help would be appreciated
thanks in advanced