Opened 6 years ago

Last modified 6 years ago

#15317 closed defect

Troubles with Python and ncurses on Cygwin — at Version 5

Reported by: jpflori Owned by:
Priority: major Milestone: sage-6.2
Component: porting: Cygwin Keywords: cygwin spkg ncurses
Cc: dimpase, vbraun, jdemeyer Merged in:
Authors: Reviewers:
Report Upstream: Workaround found; Bug reported upstream. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by jpflori)

Python currently fails/is suboptimal on Cygwin because:

  • it does not properly detect readline which is only installed as a shared library, patch "2.7.3-dylib.patch" from Cygwin package fixes that;
  • the curses module is not built because of undefined refs, just passing -lcurses when linking is not enough, one should add -ltinfo;
  • it segfault at startup when loading the readline module, not sure why. It looks exactly as what is reported at http://trac.macports.org/ticket/29496 . Rebuilding ncurses with debug info (including CFLAGS="-O0 -g" which cannot easily be passed right now) does not give much info. The offending line pointed by GCC is "char *result = exit_attribute_mode;"; maybe some dark magic going on as reported in http://lists.gnu.org/archive/html/bug-ncurses/2006-10/msg00002.html ; please not that on Cygwin the stack is small by default but playing a little bit with that did not really help. Further info: ncurses 5.7 is fine, ncurses 5.8 fails in the same way. Upstream bu report: http://lists.gnu.org/archive/html/bug-ncurses/2013-10/msg00014.html

Change History (5)

comment:1 Changed 6 years ago by jpflori

Had no time to investigate the diff between 5.7 and 5.8, especially around the offending lines, function calls. Any help/clues welcomed.

comment:2 Changed 6 years ago by jpflori

Similar problem on different archs: http://lists.busybox.net/pipermail/buildroot/2011-April/042350.html No solution though...

comment:3 Changed 6 years ago by jpflori

  • Cc jdemeyer added

comment:4 Changed 6 years ago by jpflori

Playing a little bit around, it seems that setting TERM to something non-existing (e.g. "" or "blblbblblbl") makes the segfault disappear.

comment:5 Changed 6 years ago by jpflori

  • Description modified (diff)
  • Report Upstream changed from N/A to Workaround found; Bug reported upstream.

Upstream bug report: http://lists.gnu.org/archive/html/bug-ncurses/2013-10/msg00014.html

The problem is that when the config BROKEN_LINKER is set, then a pointer CurTerm? is used but never set to something else than zero. Setting it as in other cases seems to fix the problem. Or unsetting BROKEN_LINKER on Cygwin.

Note: See TracTickets for help on using tickets.