dropping privileges / stack overflow situation

7 views
Skip to first unread message

Daniel Pocock

unread,
Mar 24, 2014, 5:47:33 PM3/24/14
to si...@googlegroups.com



I've been using sipXtapi with reConServer (from reSIProcate)

I recently tried setting

RunAsUser = recon

in my reConServer.config. This basically means that recon will be
started as root, it will initialize the whole stack (reSIProcate and
sipXtapi), open the network sockets, etc as root and then it will drop
privileges just before the main processing loop is entered.

When using this, I've found that the application crashes.

Studying the problem with gdb, I see bad_alloc exceptions

Increasing the stack, .e.g

ulimit -s 128000

makes it go a little bit further but it still crashes. The more stack I
give it, the more it RAM it uses (according to valgrind) before the crash.

If I remove the RunAsUser config option, it runs fine

Is there any recommendation about how to use sipXtapi in an application
that wants to drop privileges?

There are workarounds and it seems to be quite happy if I just start it
as the recon user (using a modified init script) but maybe this issue is
a hint about some other stability or memory management issue.


Daniel Petrie

unread,
Mar 25, 2014, 3:41:31 PM3/25/14
to si...@googlegroups.com
Hi Dan:
I assume this application is not using the local audio devices (e.g. mic and speakers).  Did you use the configure option: --disable-local-audio.  If not there needs to be a /dev/dsp and the user running sipX needs permissions to read and write.  I think the error catching may not be the best in the case where it tries to attach to the local audio devices to the default devices.

If this is not the issue, I probably need to see a log.  Can you enable the sipX logging to a file.

Cheers,
Dan


--
You received this message because you are subscribed to the Google Groups "sipX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sipx+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Reply all
Reply to author
Forward
0 new messages