[Freeswitch-users] Sendmail segfaulting

Rob Morin rmorin at blie-ent.com
Fri Jan 27 03:46:56 MSK 2012


John,

 

Thank you for your help.

 

I ran the command line as you described, and everything worked fine.

 

I should also mention, that some of my extensions do not have the
notifications turned on. And even for them, getting the message through is
hit or miss - sometimes it segfaults, sometimes it doesn't. So I don't
necessarily think it's a "two message" issue. Also, in looking at the logs,
sometimes I see the segfault appear in the middle of the maillog logging for
the other message. So it doesn't look like FS is waiting for the sendmail
command to return before executing the next command.  Here's what I mean.

 

Jan 26 14:28:50 blie-fs sendmail[25200]: q0QESoi9025200:
Authentication-Warning: blie-fs.blie-ent.com: freeswitch set sender to
voicemail at blie-ent.com using -f

Jan 26 14:28:50 blie-fs sendmail[25200]: q0QESoi9025200:
from=voicemail at blie-ent.com, size=18662, class=0, nrcpts=1,
msgid=<201201261428.q0QESoi9025200 at blie-fs.blie-ent.com>,
relay=freeswitch at localhost

Jan 26 14:28:51 blie-fs sendmail[25201]: q0QESpVj025201:
from=<voicemail at blie-ent.com>, size=19026, class=0, nrcpts=1,
msgid=<201201261428.q0QESoi9025200 at blie-fs.blie-ent.com>, proto=ESMTP,
daemon=MTA, relay=localhost [127.0.0.1]

Jan 26 14:28:51 blie-fs sendmail[25200]: q0QESoi9025200:
to=rmorin at blie-ent.com, ctladdr=voicemail at blie-ent.com (501/501),
delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=48662, relay=[127.0.0.1]
[127.0.0.1], dsn=2.0.0, stat=Sent (q0QESpVj025201 Message accepted for
delivery)

Jan 26 14:28:51 blie-fs kernel: [41082.268638] sendmail[25207]: segfault at
7fff96dffed8 rip 7f158ee0b7fb rsp 7fff96dffea0 error 6

Jan 26 14:28:51 blie-fs sendmail[25203]: STARTTLS=client,
relay=smtp.sendgrid.net., version=TLSv1/SSLv3, verify=FAIL,
cipher=DHE-RSA-AES256-SHA, bits=256/256

Jan 26 14:28:51 blie-fs sendmail[25203]: q0QESpVj025201:
to=<rmorin at blie-ent.com>, delay=00:00:00, xdelay=00:00:00, mailer=relay,
pri=139026, relay=smtp.sendgrid.net. [174.36.32.204], dsn=2.0.0, stat=Sent
(Delivery in progress)

 

On this instance, the notification didn't get through, but the message did.

 

All of that said, I'm not sure how to run the 'parallel' test, though. (I
did run the single test many times in quick succession with no failures.)

 

My ulimit -s is set at 8192. And I don't have any other arguments, other
than '-t'.

 

Thank you,

Rob

 

From: John [mailto:freeswitch at earthspike.net] 
Sent: Thursday, January 26, 2012 6:23 PM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] Sendmail segfaulting

 

Rob,

ssmtp sends whatever it's given:  FreeSWITCH puts the message together (in
src/switch_utils.c:switch_simple_email()) to make a fully MIME-compliant
message with the attachments read out of their files and then pipes it into
the 'sendmail' (whether ssmtp, nullmailer, sendemail.py or whatever) program
for it to send/relay it.  FreeSWITCH waits for the 'cat | sendmail' program
to return before continuing execution and deleting files, so file deletion
is unlikely to be the issue.  Like you say, it sounds like the problem is
not with configuration but it's also very unlikely to be with file deletion.


Can you reproduce the fault by running sendmail from the command line with a
suitably formatted mail message[*] as input?  This is pretty much what
FreeSWITCH does:

cat message.txt | <sendmail.app> -f noreply at mydomain.com <mailer-args>
recipient at mydomain.com

... with <..> from what you have in conf/autoload_configs/switch.conf.xml?

[* 'suitably formatted message' could be one of the successful ones, view
source, then edit to trim off the transport headers]

If that is successful, try to replicate your 2-message-scenario by running
two of the above commands in parallel with different input files and see if
that generates a segfault.  [If you are a linux noob as well as a FS noob I
can spell this out for you.]

John

On 26/01/12 22:04, Rob Morin wrote: 

John,

 

That's helpful, but ssmtp doesn't support attachments so it won't support
sending the voicemail files.

 

Additionally, I'm somewhat stumped on the default 'sendmail' option. The
references in the Wiki are basically all 'configuration' issues - stack
size, etc. The problem I have is that it isn't a configuration issue -
sometimes it goes through, sometimes it doesn't. If it were a configuration
issue, it would never go through (unless it was a resource that was near its
margin).  So that's why I wanted to insert a delay. It appears to me that
the segfault is being caused by the file getting moved, deleted, or still
being open when sendmail attempts to access it.  I wish I had more to go on
though.

 

Thank you,

Rob

 

From: John [mailto:freeswitch at earthspike.net] 
Sent: Thursday, January 26, 2012 1:49 PM
To: freeswitch-users at lists.freeswitch.org
Subject: Re: [Freeswitch-users] Sendmail segfaulting

 

Slightly unrelated, but I have been using the python script sendemail.py
until recently when a user noticed that they were not being emailed some
voicemails.  I have since changed to using ssmtp (rather than nullmailer as
my mail server requires a login, TLS on tcp/587). One thing I noticed, and
it may be me that caused it, but the sendemail.py script had some
indentation using (4) spaces and some using tabs.  But the main problem is
that the script keeps warning about the MimeWriter class being deprecated
and has no error reporting or recovery, it seems.  For me, it was easier to
install ssmtp than rewrite the python script.  If you don't need a full mail
server, I would recommend using a null mailer like ssmtp or nullmailer.

John

On 26/01/12 15:13, Rob Morin wrote: 

I tried to modify the eximcompat.sh script to work with sendmail. I'm not
sure why it didn't work. It might be that, for starters, I don't have exim
installed, I have sendmail.

 

I haven't tried the python script.  Is that the one you use?

 

Rob

 

From: Michael Jerris [mailto:mike at jerris.com] 
Sent: Thursday, January 26, 2012 8:09 AM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] Sendmail segfaulting

 

delay won't help you.  Why didn't the script work?  I know we do this and it
works fine.  Pretty sure we use a modified version of the sample in tree.

 

Mike

 

On Jan 25, 2012, at 10:43 PM, Rob Morin wrote:







I saw that, and tried everything I could. Still no luck.

 

My stack limit is 8192, so that shouldn't be the issue.  I'm running CentOS
x_64.

 

I tried creating a script as the wiki suggests, so that I could make changes
without having to restart FS. But that didn't work either (I'm still a
noob). My goal was to add a sleep delay, in the case that FS is calling the
sendmail command before it's completely written and released the email it's
sending. Any idea how to make that work?

Thank you,

Rob

 

From: Michael Jerris [mailto:mike at jerris.com] 
Sent: Wednesday, January 25, 2012 1:57 PM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] Sendmail segfaulting before second message
is sent

 

http://wiki.freeswitch.org/wiki/Mod_voicemail#Exim4_settings

 

On Jan 25, 2012, at 1:31 PM, Rob Morin wrote:








For some extensions, I've got FreeSWITCH configured to send both the
voicemail to an email address and a notification to a cell phone that there
is a message.

 

Sendmail is segfaulting (error 6) before the second email message is sent.
Sometimes the notification message is going out, sometimes the email message
goes.

 

If I am just sending an email, it is *generally* successful. Although
sometimes it fails, so I really need to fix this.

 

Does anyone have any suggestions as to how I can troubleshoot this? 

(Running CentOS 5.7, sendmail 8.13).

 







_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org
http://www.freeswitchsolutions.com
 


 
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
 
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

 






_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org
http://www.freeswitchsolutions.com
 


 
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
 
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120126/44dde311/attachment-0001.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list