[Python-Dev] FreeBSD test suite failure -> curses

"Martin v. Löwis" martin at v.loewis.de
Sun Mar 9 20:23:18 CET 2008


> One result I get is this:
>> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 0x8173000 (LWP 100121)]
> 0x28ac4102 in PyCurses_getsyx (self=0x0)
> at /usr/home/asmodai/projects/python/Modules/_cursesmodule.c:1770
> 1770 getsyx(y, x);
>> Is a value of 0x0 valid for self? I'd figure it would be a memory address,
> but I do not know the internals well enough for that.

That's fine. It's a module-level function; self is typically NULL for
these.
Another issue is that there should be an additional (ignored) parameter
args in PyCurses_getsyx; you might try adding one.
However, the real culprit should be getsyx(). What does this entire
function expand to when run through a preprocessor, and where does
it crash when you run the expanded code in the debugger?
For reference, on Linux (ncurses) it expands to
 do {
 if (((newscr)->_leaveok))
 (y) = (x) = -1;
 else
 ((y) = ((newscr) ? (newscr)->_cury : (-1)),
 (x) = ((newscr) ? (newscr)->_curx : (-1))); }
 while(0);
which should be equivalent to
 if (newscr->_leaveok)
 y = x = -1;
 else {
 y = newscr ? newscr->_cury : -1;
 x = newscr ? newscr->_curx : -1;
 }
If it's similar on FreeBSD, the only reason why this
could break is that newscr is NULL.
Regards,
Martin
	


More information about the Python-Dev mailing list

AltStyle によって変換されたページ (->オリジナル) /