How to crash Python in 1 easy step (python 2.2.2)

Jeff Epler jepler at unpythonic.net
Wed Jul 16 11:28:09 EDT 2003


On Tue, Jul 15, 2003 at 03:55:37PM +0000, Michael Hudson wrote:
> This has almost surely got to be a readline problem.  Does it happen
> in (e.g.) gdb?

It happens in bc, but not in gdb or my shell.

The traceback is endless frames of
#2094 0x4045e803 in _rl_dispatch_subseq () from /usr/lib/libreadline.so.4
#2095 0x4045e77e in _rl_dispatch () from /usr/lib/libreadline.so.4
.. the same in bc or python

So does this simple C program:
	#include <stdio.h>
	#include <readline/readline.h>
	#include <readline/history.h>

	int main(void) {
		char *line = readline(">>>");
		if(line == NULL) return 1;
		printf("The user entered %s\n", line);
		free(line);
		return 0;
	}

It seems fairly clear that this is a readline bug.  I'm not sure what
Python can do about it, if anything...

Jeff





More information about the Python-list mailing list