RE: use of assert() and exit()

Helen Ryan <[email protected]> Tue, 26 Nov 2002 18:31:34 -0000
Newsgroups gmane.network.beep.beepcore.c.general
Message-ID <[email protected]>
Hi,

Thanks David for your response.  I am a colleague of Andy Walsh (who
initiated this thread).  There is a situation where we are getting a failed
ASSERT:

When running the test programs beepd and beepng on a Sun Ultra-5_10, after
several (e.g. 6) invocations of beepng, both programs seem to hang at the
following point:

(beepd stdout output):
SR connection_init
ECHO session_init: role='L' mode="plaintext"
SINK session_init: role='L' mode="plaintext"
ANONYMOUS session_init: role='L' mode="plaintext"
OTP session_init: role='L' mode="plaintext"
SR session_init: role='L' mode="plaintext"
SR greeting_notification status=P

So I terminate beepng using Ctrl^C, and beepd outputs:

ECHO start_indication: piggyback="<NULL>"
../bp_notify.c:176: failed assertion `wrap->iostate != 0'
Abort (core dumped)

Does anyone have any ideas as to why this might be happening?
(Note that beepd could not find symbol SSL_CTX_free at startup (it does not
seem to have linked in libssl and libcrypto, although the make output seemed
to indicate it was linking them in).  Maybe the problem is something to do
with this)
The rest of this email contains more information on the output/environment.

Many thanks,
Helen Ryan


The output of gdb 'where' command on the core file:
=====================================
#0  0xff349790 in __sigprocmask () from /usr/lib/libthread.so.1
#1  0xff33e9b4 in _resetsig () from /usr/lib/libthread.so.1
#2  0xff33e154 in _sigon () from /usr/lib/libthread.so.1
#3  0xff341194 in _thrp_kill () from /usr/lib/libthread.so.1
#4  0xff14b740 in raise () from /usr/lib/libc.so.1
#5  0xff135ab4 in abort () from /usr/lib/libc.so.1
#6  0xff07311c in Letext ()
   from /vobs/3p/beepcore-c-0.2/Release/lib//libbptosutil.so.0
#7  0xff0334e4 in notify_upper ()
   from /vobs/3p/beepcore-c-0.2/Release/lib//libbptoswrapper.so.0
#8  0xff0044ac in clean_commit ()
   from /vobs/3p/beepcore-c-0.2/Release/lib//libbeepcore.so.0
#9  0xff006520 in bll_out_buffer ()
   from /vobs/3p/beepcore-c-0.2/Release/lib//libbeepcore.so.0
#10 0xff0062bc in blu_frame_send ()
   from /vobs/3p/beepcore-c-0.2/Release/lib//libbeepcore.so.0
#11 0xff008994 in blu_chan0_reply ()
   from /vobs/3p/beepcore-c-0.2/Release/lib//libbeepcore.so.0
#12 0xff0356a0 in blw_chan0_reply ()
   from /vobs/3p/beepcore-c-0.2/Release/lib//libbptoswrapper.so.0
#13 0xff034e40 in blw_start_indication ()
   from /vobs/3p/beepcore-c-0.2/Release/lib//libbptoswrapper.so.0
#14 0xff033d50 in IW_notify_handle_chan0 ()
   from /vobs/3p/beepcore-c-0.2/Release/lib//libbptoswrapper.so.0
#15 0xff0331a8 in nr_callback ()
   from /vobs/3p/beepcore-c-0.2/Release/lib//libbptoswrapper.so.0
#16 0xff07233c in work_thread ()
   from /vobs/3p/beepcore-c-0.2/Release/lib//libbptosutil.so.0

beepd log file tail output:
=================
11/26 16:25:39 beepd    0.wrap >>> SEQ 0 126 25679\r
11/26 16:25:41 beepd    1.wrap read 59 octets
11/26 16:25:41 beepd    0.wrap <<< MSG 0 101 . 126 125\r
11/26 16:25:41 beepd    0.wrap <<< Content-Type: application/beep+xml\r
11/26 16:25:41 beepd    0.wrap <<< \r
11/26 16:25:41 beepd    1.wrap read 92 octets
11/26 16:25:41 beepd    0.wrap <<< <start number='1' ><profile
uri='http://xml.r
esource.org/profiles/NULL/ECHO' /></start>END\r
11/26 16:26:07 beepd    2.wrap id=0 fd=11 revents=0x11/0x1
11/26 16:26:07 beepd    0.wrap socket error: 11
11/26 16:26:07 beepd    0.wrap stopping iostate: 11
11/26 16:26:07 beepd    0.wrap deleting iostate: 11

Some more info:
===========
Machine: SunOS 5.8 Generic_108528-15 sun4u sparc SUNW,Ultra-5_10
gcc version 2.95.3 20010315 (release)

Note:
====
-	Had to add -lresolve to TARGET_LIBS in Make.defs to build it
-	Had to add /vobs/3p/beepcore-c-0.2/profiles/unix/.libs/ to
LD_LIBRARY_PATH to pick up libsasl-profiles.so and libtls-profile.so at
runtime.




-----Original Message-----
From: David C Niemi [mailto:[email protected]]
Sent: 25 November 2002 15:44
To: BeepCore
Subject: Re: [Beepcore-c-users] use of assert() and exit()



Are failed ASSERT calls and exit() situations coming up in your system?  
If so I'd expect some debugging should be done prior to using it
seriously.

Normally ASSERT and exit would be used in situations where continuing on
would make no sense or possibly be dangerous -- they are "this shouldn't
happen" types of internal errors.  I would expect they should be extremely
rare in real life; and they definitely shouldn't be occurring for normal,
expected sorts of errors like bad data or network-level problems.

DCN

On Mon, 25 Nov 2002, Andy Walshe wrote:
> Hello,
> We use beepcore-c as just one communication module in our system.
> It is a multi-threaded Solaris 8 based system. One thing we have
> noticed is the use of assert() and exit() in the beepcore library.
> We'd prefer to have control when errors occur so as not to stop
> our whole system.
> 
> We can redefine the ASSERT directive to do nothing but the use
> of exit() is a different story. Has anyone had fixes/issues with
> these?
> 
> Thanks
> Andy
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Beepcore-c-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/beepcore-c-users
> 

-- 
-------------------------------------------------------
-- David C. Niemi           Adeptech Systems, Inc.   --
-- Reston, Virginia, USA    http://www.adeptech.com/ --
-------------------------------------------------------



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Beepcore-c-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/beepcore-c-users


-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T 
handheld. Power & Color in a compact size! 
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en