[Python-Dev] Py2.4 _sre uses uninitialised memory (Bug 1088891)

2004-12-21 Thread Andrew McNamara
_sre.c, data_stack_grow() in Py2.4 uses realloc()'ed memory without
initialising the newly allocated memory. For complex regexps that require
additional sre stack space, this ultimately results in a core dump or
corrupted heap. Filling the newly allocated memory with 0x55 makes the
problem more obvious (dies on a reference to 0x5558) for me.

See bug ID 1088891:


http://sourceforge.net/tracker/index.php?func=detail&aid=1088891&group_id=5470&atid=105470

Can I be the only person who crafts diabolical regexps? Here, have a
lend of my brown paper bag...

-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Latex problem when trying to build documentation

2004-12-21 Thread George Yoshida
Irmen de Jong wrote:
> I wanted to create a doc patch belonging to my patch #1062060,
> but got this error when trying to build the documentation from CVS:
> [snip]
> I dont really understand that latex stuff (used to, but that
> was a long time ago). What's the problem?
>
Looks like the end tag of {description} has disappeared with this
check-in:
[EMAIL PROTECTED] wrote:
> Update of /cvsroot/python/python/dist/src/Doc/lib
> In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23423
>
> Modified Files:
> 	libundoc.tex
> Log Message:
> SF bug #1084457:  ossaudiodev no longer undocumented
>
>
>
> Index: libundoc.tex
> ===
> RCS file: /cvsroot/python/python/dist/src/Doc/lib/libundoc.tex,v
> retrieving revision 1.88
> retrieving revision 1.89
> diff -u -d -r1.88 -r1.89
> --- libundoc.tex	7 Aug 2004 19:21:59 -	1.88
> +++ libundoc.tex	14 Dec 2004 07:19:22 -	1.89
> @@ -71,11 +71,6 @@
>  --- Convert "arbitrary" sound files to AIFF files; should probably
>  become a tool or demo.  Requires the external program \program{sox}.
>
> -\item[\module{ossaudiodev}]
>  Play audio data via the Open Sound System API.  This is 
usable on
> -Linux, some flavors of BSD, and some commercial \UNIX{} platforms.
> -\end{description}
> -
>
>  \section{Obsolete \label{obsolete-modules}}

George
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Py2.4 _sre uses uninitialised memory (Bug 1088891)

2004-12-21 Thread Gustavo Niemeyer
Hello Andrew,

> _sre.c, data_stack_grow() in Py2.4 uses realloc()'ed memory without
> initialising the newly allocated memory. For complex regexps that
> require additional sre stack space, this ultimately results in a core
> dump or corrupted heap. Filling the newly allocated memory with 0x55
> makes the problem more obvious (dies on a reference to 0x5558) for
> me.

As I just reported in the bug, the problem is not initializing the
allocated memory, but acknowledging memory reallocation in certain
situations where it's reallocated outside of the main matching
function.

Have a look at the bug at http://python.org/sf/1072259 for more
information and for a patch fixing the problem.

Thanks for the report,

-- 
Gustavo Niemeyer
http://niemeyer.net
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Re: [Python-checkins] python/dist/src/Pythonmarshal.c, 1.79, 1.80

2004-12-21 Thread Armin Rigo
Hi Tim,

On Mon, Dec 20, 2004 at 07:26:25PM -0500, Tim Peters wrote:
> Still, it's a new-in-2.4 gimmick, and no pre-2.4 code could be using
> it.  I suppose Armin found a use for it in 2.4, but I'm still
> scratching my head.  If ZODB doesn't already depend on it, how useful
> can it be?  QED

Some code in the 'py' lib used to use marshal to send simple objects between
the main process and a subprocess.  We ran into trouble when we extended the
idea to a subprocess that would actually run via ssh on a remote machine, and
the remote machine's Python version didn't match the local one.  The obvious
quick fix was to set the 'version' argument to 0 and pretend that it would be
fine forever.

Now that we essentially can't use this trick any more because of the 2.4.0
bug, we reverted to repr/eval, which is quite slower (and actually not
guaranteed to work across Python versions either: string escapes sometimes
change).  We avoid to use cPickle because we want to be sure that only "simple
enough" objects are sent over this way -- essentially nothing that depends on
a precise Python module to be installed and identical on both machines.


Armin
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] PyCon is coming - we need your help

2004-12-21 Thread Steve Holden

Dear Python User:

I wonder if you would be kind enough to take the time to
read this email and help us to publicize PyCon DC 2005,
being held March 23-26 at the Cafritz Conference Center of
George Washington University.

The Call for Participation went out some time ago, but it
is a good time to remind people that the deadline for
submissions is December 31. If you personally are thinking
of submitting a paper then this can be a reminder to do so
soon!

We already have acceptances from two keynote speakers, and
hope to announce them when a third is finalised shortly.

As always you can find out about the conference at

http://www.pycon.org/
http://www.python.org/pycon/

This year we are going to be able to accept credit card
payments for the first time, which we hope will be more
convenient for delegates.

The registration fees this year are the same as for 2004:

Early Bird (to Jan 22)   $175 ($125 student)
Regular (to Mar 19)  $250 ($175 student)
On-Site  $300 ($225 student)

A further announcment will be made when the registration
site opens for business. In the meantime I would appreciate
your assistance in posting this message via any channels you
know of that have an interest in the Python language and its
applications - publicity is the key to getting the most
diverse group of people at PyCon.


regards
Steve Holden
Chairman, PyCON DC 2005
-- 
PyCon DC 2005: The third Python Community Conference
http://www.pycon.org/   http://www.python.org/pycon/
The scoop on Python implementations and applications
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Re: [Python-checkins]python/dist/src/Pythonmarshal.c, 1.79, 1.80

2004-12-21 Thread Fredrik Lundh
Armin Rigo wrote:

> Some code in the 'py' lib used to use marshal to send simple objects between
> the main process and a subprocess.  We ran into trouble when we extended the
> idea to a subprocess that would actually run via ssh on a remote machine, and
> the remote machine's Python version didn't match the local one.  The obvious
> quick fix was to set the 'version' argument to 0 and pretend that it would be
> fine forever.

this is a rather common use case.

 



___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Latex problem when trying to build documentation

2004-12-21 Thread Irmen de Jong
George Yoshida wrote:
Irmen de Jong wrote:
 > I wanted to create a doc patch belonging to my patch #1062060,
 > but got this error when trying to build the documentation from CVS:
 > [snip]
 > I dont really understand that latex stuff (used to, but that
 > was a long time ago). What's the problem?
 >
Looks like the end tag of {description} has disappeared with this
check-in:
[...]
Out of curiousity, how did you find this?
--Irmen
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Re:[Python-checkins] python/dist/src/Pythonmarshal.c, 1.79, 1.80

2004-12-21 Thread Irmen de Jong
Tim Delaney wrote:
Irmen de Jong wrote:
Also, I'm not sure how a test-case should be constructed
for this patch? Can the Python regression test download stuff
as part of a test? Or is there some other way to make a
testcase for this.

Hmm - perhaps start a server on the local machine at the start of the 
test, and tear it down at the end? you've then got full control of that 
server and can make it do whatever you want.

Or replace the socket objects with mock objects?
Thanks for those suggestions.
Let's see what I can concoct.
Never made (or studied in detail) a python regression test case
before so now is a good time :)
--Irmen
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Re:[Python-checkins] python/dist/src/Pythonmarshal.c, 1.79, 1.80

2004-12-21 Thread Johannes Gijsbers
On Tue, Dec 21, 2004 at 08:00:22PM +0100, Irmen de Jong wrote:
> Thanks for those suggestions.
> Let's see what I can concoct.
> 
> Never made (or studied in detail) a python regression test case
> before so now is a good time :)

You might be especially interested in 'class urlopen_HttpTests' in
test_urllib.py and all the Mock* classes in test_urllib2.py. BTW, don't
hesitate to ask for help in the bug/patch. I'm happy to help, though I might be
a bit slow to answer.

Cheers,

Johannes
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Latex problem when trying to build documentation

2004-12-21 Thread Johannes Gijsbers
On Tue, Dec 21, 2004 at 07:57:43PM +0100, Irmen de Jong wrote:
> >Looks like the end tag of {description} has disappeared with this
> >check-in:
> 
> [...]
> 
> Out of curiousity, how did you find this?

Once you filter through all the noise LaTeX generates there's actually a pretty
clear error message:

"\begin{description} on input line 59 ended by \end{document}."

That's obviously not right. I've just fixed it, by the way.

Cheers,

Johannes
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Re: [Python-checkins] python/dist/src/Pythonmarshal.c, 1.79, 1.80

2004-12-21 Thread Tim Peters
[Armin Rigo]
> Some code in the 'py' lib used to use marshal to send simple objects between
> the main process and a subprocess.  We ran into trouble when we extended the
> idea to a subprocess that would actually run via ssh on a remote machine, and
> the remote machine's Python version didn't match the local one.  The obvious
> quick fix was to set the 'version' argument to 0 and pretend that it would be
> fine forever.

Yes, I believed you had *some* use for it .

> Now that we essentially can't use this trick any more because of the 2.4.0
> bug,

Well, you can still use 2.3.4 -- or wait for 2.4.1 -- or use your
patched 2.4.  Or use the stock 2.4, but set up a "marshal server"
running 2.3.4 .

> we reverted to repr/eval, which is quite slower (and actually not guaranteed 
> to
> work across Python versions either: string escapes sometimes change).

Really?  The precise rules str's __repr__ uses for which escapes to
produce certainly change, but I don't recall any case outside
Unicodeland where a new string escape was ever introduced.  So, e.g.,
current Python str.__repr__() produces '\n' for a newline, while
long-ago Pythons produced '\012', but all versions of Python *accept*
either form of escape.  The biggest change of this kind was moving
from octal escapes to hex escapes in Python 2.1, but hex escapes have
always been accepted -- repr() just didn't produce them before 2.1.

>  We avoid to use cPickle because we want to be sure that only "simple
> enough" objects are sent over this way -- essentially nothing that depends on
> a precise Python module to be installed and identical on both machines.

It's possible (but irksome) to subclass pickle.py's Pickler class, and
override its save_global() and save_inst() methods.  For example,
replace them with one-liners that just raise an exception.  Then any
attempt to pickle an object requiring a specific module will raise
that exception.  But if you're worried about speed, going thru
pickle.py is significantly slower than going thru repr().
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Latex problem when trying to build documentation

2004-12-21 Thread George Yoshida
Irmen de Jong wrote:
Looks like the end tag of {description} has disappeared with this
check-in:

[...]
Out of curiousity, how did you find this?
Well, I periodically download daily snapshots, so I compiled TeX
files with them. The snapshot from Dec-11 was OK, but with the one
from Dec-17 I couldn't compile.
Once you're sure in what period the bug crept into the source, all
you need to do is to check every commit applied to files under
src/Doc directory in that period.
Anyway, I don't know TeX well enough to narrow down the bug from
the error log. It's too verbose for me.
George
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Patches: 1 for the price of 10.

2004-12-21 Thread Titus Brown
Hello all,

per previous discussion,

http://mail.python.org/pipermail/python-dev/2004-October/049495.html

I'd like to push a trivial little patch to sgmllib (#1087808) on you
gents, in exchange for my reviews & effort etc. on 10 other patches.

Without further ado:

No-brainers:

1055159 -- a docstring+docs update to CGIHTTPServer describing already-
existing behavior.  Recommend apply.

1037974 -- fix HTTP digest auth for broken servers, e.g. LiveJournal.
Trivial code fix, should break nothing.  Recommend apply +
backport.

1028908 -- JJ Lee's updates to urllib2.  Passes regr tests, by an
original author of much of the code (I think).  Recommend apply.

901480 -- patch to urllib2.parse_http_list (bug 735248).  Works.
Updated patch.  Recommend apply + backport.

827559 -- SimpleHTTPServer redirects to 'dir/' when asked for 'dir'.
This behavior mimics common behavior online and fixes a problem
with relative URLs when clicking on files within 'dir'.
Recommend apply.

810023 -- fixes off-by-one bug in urllib reporthook.  regr tests & all.
Good stuff.  Recommend apply + backport.

893642 -- adds allow_none option to SimpleXMLRPCServer & associated
classes.  Doesn't change default behavior.  Recommend apply.

755670 -- modify HTMLParser to accept clearly broken HTML.
Recommend reject.

Slightly more complicated:

1067760 -- float-->long conversion on fileobj.seek calls, rather than
float-->int.  Permits larger floats (2.0**62) to match large
int (2**62) arguments.  rhettinger marked as "won't fix" in
the original bug report; this seems like a clean solution,
tho.  Recommend apply.

755660 -- should HTMLParser fail on all bad input, or do best effort?
I'd recommend more sweeping changes where must-fail situations
are distinguished from fails-by-default situations.
Alternatively take a stand and say "nein!" once and for all.
(See my comment for more information.)

--

For no particularly good reason, all of these were tested against
the current CVS HEAD rather than 2.4.  All of them should be trivial
to backport, although I think only a few are real problems worthy
of the effort.

--

I'm kind of curious to see how this goes, I must admit ;).  Please CC
me on replies so I can listen in...

One comment to Martin: it clearly isn't worth the effort of reviewing 10
patches to push a patch the size of my sgmllib patch.  On the other
hand, it's nice to have a guarantee & it's an educational experience,
that's for sure.

A 5:1 ratio might be more reasonable, since that in practice will
mean 1 serious patch, 2 or 3 updates, and 1 drop-dead easy patch.

cheers,
--titus
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com