coredump from strcmp, when it is not called

S

Subra

Hi,

On solaris 10 box, pstack says that the call to srcmp from
'op_content_pol_authorize' is dumping core.
But the function 'op_content_pol_authorize' is not making the call
to strcmp at all.
Verified the output from the preprocessor using the -P . Please find
the same below.

Has anyone faced such issue before ? Any help would really help.


$ uname -a
SunOS xxx 5.10 Generic_144488-09 sun4v sparc sun4v

$ pstack core
core 'core' of 26883: /opt/app/portal/7.4/pin/bin/cm3
fda31f00 strcmp (154b18, 0, 778468, ffbf28f0, ffbf3358, 7000) + 160
f57388dc op_content_pol_authorize (fe878e18, 8cc, 0, 778468,
ffbf2f5c, ffbf3358) + 114
fe97c970 cm_pre_pcm_op (f57387c8, 8cc, ffbf2e8c, f575db84, 778468,
ffbf2f5c) + 163c
fe99c954 pcm_op_ex (154b18, 8cc, ffbf3358, 0, 77ce28, ffbf2f5c) + 3f0
fe99c4ec pcm_op (154b18, 8cc, 0, 77ce28, ffbf2f5c, ffbf3358) + 1c
f5767740 fm_content_authorize (154b18, 0, 77ce28, 781a68, 773be8,
ffbf3358) + 49c
f5766ec4 op_content_authorize (1, 0, 0, 773be8, 20d368, ffbf3358) +
5ac
fe8367b0 cm_custom_ex (fe878e18, 0, 8cb, 0, 0, ffbf31b8) + 990
fe835e10 cm_custom (fe878e18, 49e70, 8cb, 0, 31f265, fe871ef0) + 128
fe834184 cm_child (0, fe878e18, 0, 3, 8cb, 0) + 1238
fe8428fc mainThread (b, fa00241c, ffbf37a4, 13f4, 99b28, 99b28) +
660c
00010f30 main (1, ffbf40a4, ffbf40ac, 21000, fd9bb9c0, 0) + 8
00010b08 _start (0, 0, 0, 0, 0, 0) + 108

Preprocessor o/p:
cc -c -g -xcg92 -DFLIST_HEAP -Ixxx/include -P
fm_content_pol_authorize.c

10510 void op_content_pol_authorize(
10511 cm_nap_connection_t *connp,
10512 int32 opcode,
10513 int32 flags,
10514 pin_flist_t *i_flistp,
10515 pin_flist_t **o_flistpp,
10516 pin_errbuf_t *ebufp)
10517 {
10518 pcm_context_t *ctxp = connp->dm_ctx;
10519 pin_flist_t *r_flistp = 0 ;
10520
10521
10522 int32 *ret_reason = 0 ;
10523 int32 *ret_status = 0 ;
10524 char *in_msisdn = 0 ;
10525 char *in_auth_ID;
10526 char msg[1024] = "\0";
10527 char time_str[64] = "\0";
10528 int time_status = 0;
10529 int status = 0;
10530 time_t time_value = 0;
10531
10532
10533 if ( ( ( ebufp ) -> pin_err != 0 ))
10534 {
10535 { pin_log_flist ( 1 , "Error Detected when
getting in PCM_OP_CONTENT_POL_AUTHORIZE, i_flistp is:" ,
"fm_content_pol_authorize.c" , 164 , i_flistp ) ; } ;
10536 return;
10537 }
10538
10539
10540 { pin_log_flist ( 3 , "op_content_pol_authorize input
flist" , "fm_content_pol_authorize.c" , 172 , i_flistp ) ; } ;
10541
10542 fm_content_pol_authorize(ctxp, flags, i_flistp,
&r_flistp, ebufp);
10543
10544
10545 if ( ( ( ebufp ) -> pin_err != 0 ))
10546 {
10547
10548
10549 pin_err_log_ebuf ( 1 , "op_content_authorize
error: " , "fm_content_pol_authorize.c" , 188 , ebufp ) ;
10550 { pin_errbuf_t * ep = ( pin_errbuf_t * ) 0 ;
if ( ( ep ) == ( pin_errbuf_t * ) 0 ) { pin_flist_destroy ( r_flistp ,
ep ) ; } else if ( ( ep ) -> pin_err == 0 ) { ( ep ) ->
line_no = 190 ; ( ep ) -> filename = "fm_content_pol_authorize.c" ;
pin_flist_destroy ( r_flistp , ep ) ; } };
10551 *o_flistpp = (pin_flist_t *) 0 ;
10552 }
10553 else
10554 {
10555
10556 ( ebufp ) -> location = 0 ; ( ebufp ) ->
pin_errclass = 0 ; ( ebufp ) -> pin_err = 0 ; ( ebufp ) -> field = 0 ;
( ebufp ) -> rec_id = 0 ; ( ebufp ) -> reserved = 0 ; ( ebuf
p ) -> line_no = 0 ; ( ebufp ) -> filename = 0 ; ( ebufp ) -> facility
= 0 ; ( ebufp ) -> msg_id = 0 ; ( ebufp ) -> err_time_sec = 0 ;
( ebufp ) -> err_time_usec = 0 ; ( ebufp ) -> version = 0 ; (
ebufp ) -> argsp = 0 ; ( ebufp ) -> nextp = 0 ; ( ebufp ) -> reserved2
= 0 ;;
10557 *o_flistpp = r_flistp;
10558
10559 { pin_log_flist ( 3 ,
"op_content_pol_authorize return flist" ,
"fm_content_pol_authorize.c" , 203 , r_flistp ) ; } ;
10560
10561
10562 ret_status = ( ( ( ebufp ) -> pin_err ==
0 ) ? ( ( ebufp ) -> line_no = 209 , ( ebufp ) -> filename =
"fm_content_pol_authorize.c" , pini_flist_get ( r_flistp , ( ( ( ( 3 )
& 0xFF ) << 24 ) | ( ( 145 ) & 0xFFFFFF ) ) , 0 , 1 , 0 , ebufp ) ) :
( 0 ) );
10563 if (ret_status == 0 )
10564 {
10565 status = 0 ;
10566 }
10567 else
10568 {
10569 status = *ret_status;
10570 }
10571
10572 if ( status != 1 )
10573 {
10574 in_msisdn = ( ( ( ebufp ) -> pin_err
== 0 ) ? ( ( ebufp ) -> line_no = 221 , ( ebufp ) -> filename =
"fm_content_pol_authorize.c" , pini_flist_get ( i_flistp , ( (
( ( 5 ) & 0xFF ) << 24 ) | ( ( 92 ) & 0xFFFFFF ) ) , 0 , 1 , 0 ,
ebufp ) ) : ( 0 ) );
10575 if (in_msisdn == 0 )
10576 {
10577 in_msisdn = "NULL";
10578 }
10579
10580 in_auth_ID = ( ( ( ebufp ) -> pin_err
== 0 ) ? ( ( ebufp ) -> line_no = 227 , ( ebufp ) -> filename =
"fm_content_pol_authorize.c" , pini_flist_get ( i_flistp , ( (
( ( 5 ) & 0xFF ) << 24 ) | ( ( 7450 ) & 0xFFFFFF ) ) , 0 , 1 , 0 ,
ebufp ) ) : ( 0 ) );
10581
10582 if (in_auth_ID == 0 )
10583 {
10584 in_auth_ID = "NULL";
10585 }
10586
10587 time_value =
pin_virtual_time((time_t*) 0 );
10588 time_status = cftime(time_str, "%a %b
%d %T %Y", &time_value);
10589
10590 ret_reason= ( ( ( ebufp ) -> pin_err
== 0 ) ? ( ( ebufp ) -> line_no = 237 , ( ebufp ) -> filename =
"fm_content_pol_authorize.c" , pini_flist_get ( r_flistp , ( ( (
( 3 ) & 0xFF ) << 24 ) | ( ( 5506 ) & 0xFFFFFF ) ) , 0 , 1 , 0 ,
ebufp ) ) : ( 0 ) );
10591 if (ret_reason == 0 )
10592 {
10593 sprintf(msg,"%s,%s,%s,AUTH-
FAILED,No Reason",time_str,in_auth_ID,in_msisdn);
10594 }
10595 else
10596 {
10597 sprintf(msg,"%s,%s,%s,AUTH-
FAILED,%d",time_str,in_auth_ID,in_msisdn,*ret_reason);
10598 }
10599
10600 pin_err_log_msg ( 1 , msg ,
"fm_content_pol_authorize.c" , 247 );
10601 }
10602
10603 }
10604 }


Function ' fm_content_pol_authorize' called at line 10542, makes call
to strcmp.

10542 fm_content_pol_authorize(ctxp, flags, i_flistp,
&r_flistp, ebufp);



Thanks Subramanya
 
G

Guest

On solaris 10 box, pstack says that the call to srcmp from
'op_content_pol_authorize' is dumping core.

can't you debug it?
But the function 'op_content_pol_authorize' is not making the call
to strcmp at all.

Verified the output from the preprocessor using the -P . Please find
the same below.

please post a short, compilable exampe that exhibits your problem.

<snip>

preferably in a manner that doesn't do this...
10549 pin_err_log_ebuf ( 1 , "op_content_authorize
error: " , "fm_content_pol_authorize.c" , 188 , ebufp ) ;
10550 { pin_errbuf_t * ep = ( pin_errbuf_t * ) 0 ;
if ( ( ep ) == ( pin_errbuf_t * ) 0 ) { pin_flist_destroy ( r_flistp ,
ep ) ; } else if ( ( ep ) -> pin_err == 0 ) { ( ep ) ->
line_no = 190 ; ( ep ) -> filename = "fm_content_pol_authorize.c" ;
pin_flist_destroy ( r_flistp , ep ) ; } };
10551 *o_flistpp = (pin_flist_t *) 0 ;

....to your code
 
J

Jens Thoms Toerring

Subra said:
On solaris 10 box, pstack says that the call to srcmp from
'op_content_pol_authorize' is dumping core.
But the function 'op_content_pol_authorize' is not making the call
to strcmp at all.
Verified the output from the preprocessor using the -P . Please find
the same below.
Has anyone faced such issue before ? Any help would really help.

Function ' fm_content_pol_authorize' called at line 10542, makes call
to strcmp.
10542 fm_content_pol_authorize(ctxp, flags, i_flistp,
&r_flistp, ebufp);

Well, the compiler could inline that function (i.e. replace the
function call by the functions code) and in that case you might
get the problem reported in the core dump as coming from the
line were the function call originally was.

It's probably better to use a debugger to get more reliable
and easier to understand information (though, in some circum-
stances, there mere act of using a debugger can make such
problems disappear, and more so changes of optimization
levels etc.).
Regards, Jens
 
I

Ian Pilcher

Remember, post mortem tools are best effort, and can be confused both by
clever compiler optimizations, and because of program misbehavior. While
they give good evidence about what was going on, you shouldn't take what
they say as automatically accurate and complete.

I want that on a T-shirt.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top