Opened 7 years ago

Closed 7 years ago

#13960 closed defect (fixed)

nef.x segfaults on Cygwin

Reported by: jpflori Owned by: tbd
Priority: major Milestone: sage-5.8
Component: packages: standard Keywords: palp nef.x cygwin segfault
Cc: kcrisman, vbraun Merged in: sage-5.8.beta0
Authors: Dmitrii Pasechnik Reviewers: Jean-Pierre Flori
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by jpflori)

On my Windows 7 x64 install of 5.6.rc0 I get segfaults in nef.x.

After rebuilding with CFLAGS="-g -O0" I get the following backtrace

Program received signal SIGSEGV, Segmentation fault.
__chkstk_ms () at ../../../src/libgcc/config/i386/cygwin.S:173
173     ../../../src/libgcc/config/i386/cygwin.S: No such file or directory.
(gdb) bt
#0  __chkstk_ms () at ../../../src/libgcc/config/i386/cygwin.S:173
#1  0x004320e5 in part_nef (_P=0x686a0008, _V=0x20064a38, _E=0x20064b40,
    _OUT_PTL=0x6b470008, _codim=0x280c0c, _F=0x22fb7c) at Nefpart.c:774
#2  0x0042e421 in Make_E_Poly (outFILE=0x61187720, _W=0x280de8,
    _CP=0x7c1e0008, _CV=0x2003a0d0, _CE=0x2003a1d8, _codim=0x280c0c,
    _F=0x28ab70, _D=0x280c10) at E_Poly.c:1327
#3  0x00402061 in main (narg=2, fn=0x28ac40) at nef.c:291

on the file

$ cat ../nef.bug
3 6
 1  0  0 -1  0  0
 0  1  0  0 -1  0
 0  0  1  0  0 -1

To fix this, we need to specify the stack size explicitly on Cygwin. This is done in the updated spkg.

install http://boxen.math.washington.edu/home/jpflori/palp-2.1.p1.spkg

Attachments (1)

palp-2.1.p1.diff (935 bytes) - added by jpflori 7 years ago.
Spkg diff, for review only.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 7 years ago by jpflori

It seems the stack is too small. Recompiling with CFLAGS including -Wl,--stack,10000000 (so 10MB) makes the crash disappear. I guess the best solution would to malloc the problematic stuff on the heap.

comment:2 Changed 7 years ago by vbraun

Thats a known issue in PALP, everything is done with static sizes for maximal speed.

comment:3 Changed 7 years ago by jpflori

Ok so we'll use the --stack fix. Any suggestion on a sensible size?

comment:4 Changed 7 years ago by jpflori

  • Cc vbraun added

comment:5 Changed 7 years ago by vbraun

Why isn't the Cygwin stack 8MB by default, this seems to be a pretty popular value in the Linux world.

comment:6 Changed 7 years ago by jpflori

No idea, I'll use 8MB then.

comment:7 Changed 7 years ago by dimpase

  • Description modified (diff)
  • Status changed from new to needs_review

I've made the spkg where I put this 8MB stack fix for Cygwin in, please test!

comment:8 follow-up: Changed 7 years ago by jpflori

There is a typo in the hg commit message, and find funny the quoting you used in spkg-install when adding the necessary magic to CFLAGS. Is that on purpose?

comment:9 in reply to: ↑ 8 Changed 7 years ago by dimpase

Replying to jpflori:

There is a typo in the hg commit message, and find funny the quoting you used in spkg-install when adding the necessary magic to CFLAGS. Is that on purpose?

none of it is intentional – but it works.

Changed 7 years ago by jpflori

Spkg diff, for review only.

comment:10 Changed 7 years ago by jpflori

  • Authors set to Dmitrii Pasechnik
  • Description modified (diff)
  • Reviewers set to Jean-Pierre Flori
  • Status changed from needs_review to positive_review

Here comes a reviewer version of the spkg. Fixed typos mentioned above, have tested this works as expected, everything looks clean. I'm putting this as positive review.

comment:11 Changed 7 years ago by jdemeyer

  • Milestone changed from sage-5.7 to sage-5.8

comment:12 Changed 7 years ago by jdemeyer

  • Merged in set to sage-5.8.beta0
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.