Opened 7 years ago

Last modified 7 years ago

#15317 closed defect

Troubles with Python and ncurses on Cygwin — at Version 6

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; in fact the real problem is that tries to run ldd on the import library (dll.a) which fails to detect what libraries are already linked and anyway would decide to discard -ltinfo as its already linked to readline, but on Cygwin you have to explicitely pass everything...
  • it segfault at startup when loading the readline module, not sure why. It looks exactly as what is reported at . 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 ; 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: Should be fixed with

Change History (6)

comment:1 Changed 7 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 7 years ago by jpflori

Similar problem on different archs: No solution though...

comment:3 Changed 7 years ago by jpflori

  • Cc jdemeyer added

comment:4 Changed 7 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 7 years ago by jpflori

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

Upstream bug report:

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.

comment:6 Changed 7 years ago by jpflori

  • Description modified (diff)

The BROKEN_LINKER stuff should be fixed in ncurses:

Note: See TracTickets for help on using tickets.