Python Coredump on FreeBSD

Harald Schneider h_schneider at marketmix.com
Thu May 15 17:01:05 EDT 2003


Sorry -- file attached.

The file is read completely and split into lines. Each line is split by the
":". Comments # are ignored.
The resulting datastructure is an array of arrays assigned to self.lib

The code calling re is this:

            for filter in self.lib:
                    if
re.compile(filter[1],re.I|re.M|re.S).search(self.msg[filter[0]]) <> None:
                        return(filter[2])

filter[1] is the pattern, [2] is the returncode, [0] is a key of a
dictionary containing the strings which are searched.

As you see, the only special thing here are some long OR-chained regex which
seem to exhaust the limited stack on BSD.
Even splitting them to shorter expressions causes a crash. The Linux and
Win32 implementation are not affected ...

--Harald

------------------------- file --------------
# Structure:
# Variable (case sensitive) : Regular Expression : Result Code (NEWLINE)
#
Spoolfile.envelope:mail from.*?<CronDaemon>.*?rcpt to.*?<root>:NODOMAIN_CRON
Spoolfile.lastslog:ErrString.*?MAIL FROM.*?not
permitted.*?\n.*?\nSMTP-Error.*?(syntax|expected after|qualified
domain)|SMTP-Error.*?synta.*?from field:SYNTAX_FROM
Spoolfile.lastslog:ErrString.*?RCPT TO.*?not
permitted.*?\n.*?\nSMTP-Error.*?(syntax|expected after|qualified
domain)|SMTP-Error.*?synta.*?(to|rcpt|recipient) field:SYNTAX_TO
SMTP-Error:Too many wrong rcpt:SYNTAX_TO
SMTP-Error:IP address.*?AOL.*?open:ANTISPAM_AOL
SMTP-Error:spamcop|osirusoft:ANTISPAM_BLACKLIST
SMTP-Error:rejected.*?spam:ANTISPAM
SMTP-Error:quota|mailbox.*?full|storage|user.*?too many messages:QUOTA
SMTP-Error:Unknown local
part|(user|mailbox|account|recipient|Addressee).*?(unknown|invalid|not
found|not here)|(no such|doesn't
have|invalid|unknown).*?(account|user|mailbox|recipient|addressee):USER_UNKN
OWN
SMTP-Error:(unroutable|unrouteable) address|cannot route to:UNROUTABLE
SMTP-Error:(mailbox|account|user).*?(unavailable|disabled|inactive):MAILBOX_
UNAVAILABLE
SMTP-Error:dynamic.*?(address|IP)|name lookup failed:RELAY_DENIED_DYNIP?
SMTP-Error:blacklisted:RELAY_BLACKLISTED?
SMTP-Error:(free|open).*?relay:RELAY_OPEN?
SMTP-Error:unable to relay|message.*?rejected|relaying denied:RELAY_DENIED
SMTP-Error:Too (much|many).*?try again.*?later|busy|SMTP service not
available:SERVER_OVERLOAD
SMTP-Error:Domain of sender.*?does not
exist|invalid.*?sender.*?domain":SENDER_INVALID
SMTP-Error:authentication.*?failed|Not Authorised:AUTH_FAILED
SMTP-Error:too big:TOO_BIG
SMTP-Error:no.*?field (present|given):HEADER_INVALID
ErrString:RCPT TO.*?not permitted by remote SMTP server:RELAY_DENIED
ErrString:Error connecting to remote address|End of socket stream
data:NETWORK?
ErrString:Invalid server address:DNS_FAILED?
ErrString:loop:LOOP_KILLED
ErrString:Unknown SMTP authentication mode:AUTH_FAILED
ErrString:Server shutdown:SERVER_OVERLOAD
ErrString:Timeout error:TIMEOUT







More information about the Python-list mailing list