Menu

#1000 Build from basefiles fails

Developer_(v3.11.x)
closed-fixed
None
5
2015-07-31
2015-07-30
No

When building from the basefiles I get this error about altivec:

/home/melrobin/packages/math-atlas/./TEST/xextract -langC -lnlen79 -Remtblank -llwarn2 -def topd /home/melrobin/packages/math-atlas/AtlasBase -def incd /home/melrobin/packages/math-atlas/AtlasBase/Clint -def ext /home/melrobin/packages/math-atlas/./TEST/xextract -def BASEdir /home/melrobin/packages/math-atlas/AtlasBase/Antoine/ -def basd /home/melrobin/packages/math-atlas/AtlasBase/Clint -b /home/melrobin/packages/math-atlas/AtlasBase/Clint/atlas-tl1.base -o atlas_altivec.h rout=atlas_altivec.h
Make.ext:146: recipe for target 'atlas_altivec.h' failed
make[1]: [atlas_altivec.h] Segmentation fault (core dumped)
make[1]:
Deleting file 'atlas_altivec.h'
make[1]: Leaving directory '/home/melrobin/packages/math-atlas/TEST/ATLAS/include'
Makefile:157: recipe for target 'ATLAS/include' failed
make: *** [ATLAS/include] Error 2

Could this be a bug in xextract?

Discussion

  • R. Clint Whaley

    R. Clint Whaley - 2015-07-30

    I've been building from basefiles all day every day, and I just succeeded on a different machine.

    Is it possible you have some mix of changed and official basefiles, or your extract directory wasn't deleted, or something?

    it may make sense to do a fresh git pull from the repo into a temp dir, and build from there, and if that works, you know you borked your orig directory somehow.

    Let me know,
    Clint

     
  • R. Clint Whaley

    R. Clint Whaley - 2015-07-30
    • status: open --> open-works-for-me
    • assigned_to: R. Clint Whaley
     
  • R. Clint Whaley

    R. Clint Whaley - 2015-07-30

    BTW, to answer your question, it is definitely possible there are bugs in extract. I wrote it last as a MS student, and have been too afraid to ever really mess with it since. I did edit it slightly last week, but I think all I did was increase the size of some internal buffer. If the problem is repeatable with a fresh directory, you may need to run valgrind on it, or give me access to the machine, since I cann't reproduce the problem.

     
  • Robinson, Melvin D.

    I blew everything away and followed this sequence to get the same error:
    git clone https://github.com/math-atlas/math-atlas.git
    cd math-atlas/
    make srcdir=base
    cd base
    make

    What happens when you try those steps?

     
  • R. Clint Whaley

    R. Clint Whaley - 2015-07-31

    Everything extracts without error when I copy those steps with the mouse on my machine.

     
  • edwardtulane

    edwardtulane - 2015-07-31

    In fact, I was having the exact same issue. Then I looked at the changes in extract.c and restored the buffer sizes; I had to set LNLEN back to 2048 to make it work again.

     
  • R. Clint Whaley

    R. Clint Whaley - 2015-07-31

    Guys,

    I've been able to reproduce the problem by extracting manually. The full extract always works for me. However, I then recompiled extract with debug on, and manually issued the extract command, and I got the seg fault. I'm now trying to figure out if I can find a better fix than just randomly changing the char buffer lengths, which is unfortunately the way I often have to fix extract.

    The problem is I wrote this w/o worrying about buffer overflows using a bunch of static arrays. The better answer is go to dynamic buffers, but that is a complete rewrite, so I've never done it despite having probs like this before.

    I'll let you know what, if anything, I figure out. The fact that the LNLEN change fixes it may be key. I think I may have increased that w/o increasing a buffer that must contain it, or something similar.

    Thanks,
    Clint

     
  • R. Clint Whaley

    R. Clint Whaley - 2015-07-31

    Guys,

    I believe I've fixed the problem. It looks like what we are seeing is stack overflow, due to my declaring long arrays off the stack in recursive routine! In fact, they don't need to be independent arrays, so I utilized the beautiful approach of declaring them both static.

    This fixes things for me, but I'd like confirmation that it works for both of you guys, since our behavior has not been identical.

    I have pushed the change to github, so you should just confirm by building from basefiles as normal, w/o changing extract.

    I think this problem has affected me in the past. I occasionally get "stack stomping detected", but its not repeatable. Stack overflow between threads caused by this problem could generate this gcc warning, I think . . .

    Thanks!
    Clint

     
  • Robinson, Melvin D.

    Yes, this is working fine for me now and I am building. I think we can close now.

     
  • edwardtulane

    edwardtulane - 2015-07-31

    Works for me, as well. Thank you!

     
  • R. Clint Whaley

    R. Clint Whaley - 2015-07-31
    • status: open-works-for-me --> closed-fixed
     
  • R. Clint Whaley

    R. Clint Whaley - 2015-07-31

    OK, closing as fixed. Thanks for the quick confirmations!

     

Log in to post a comment.