Menu

#245 build failure, nmg_class.c

closed-fixed
6
2010-06-23
2010-03-03
Fred
No

When compiling on Slackware-13.0 32bit with the configure options listed, the build fails with the following error:
primitives/nmg/nmg_class.c: In function 'nmg_class_pt_s':
primitives/nmg/nmg_class.c:710: error: array subscript is above array bounds
primitives/nmg/nmg_class.c:710: error: array subscript is above array bounds
primitives/nmg/nmg_class.c:710: error: array subscript is above array bounds
make[2]: *** [nmg_class.lo] Error 1

Configure options are as follows:
./configure --enable-optimized --enable-unigraphics --prefix=/opt/BRL-Cad/ --with-ogl

Configure produces the following summary:

Build Tcl ............................: no (using system)
Build Tk .............................: no (using system)
Build Itcl/Itk .......................: yes
Build IWidgets .......................: yes
Build tkhtml3 ........................: yes
Build tkImg ..........................: yes
Build libpng .........................: no (using system)
Build libregex .......................: no (using system)
Build zlib ...........................: no (using system)
Build termlib ........................: no (using system)
Build Utah Raster Toolkit.............: yes
Build Template Numerical Toolkit......: yes
Build openNURBS.......................: yes
Build NIST STEP Class Libraries.......: yes
Build jove ...........................: no
X11 support (optional)................: yes
OpenGL support (optional).............: yes
librtserver JDK support (optional)....: yes
Enable run-time debugging (optional)..: yes

Build 64-bit release .................: no (32-bit)
Build optimized release ..............: yes
Build debug release ..................: auto
Build profile release ................: no
Build SMP-capable release ............: yes
Build static libraries ...............: yes
Build shared/dynamic libraries .......: yes
Print verbose compilation warnings ...: no
Print verbose compilation progress ...: no

Only build benchmark suite ...........: no
Only build librtserver ...............: no
Install example geometry models ......: yes
Install extra docs ...................: yes (man/html only)

JDK-6_U18 from Sun is installed as the JDK.

This error occurs with SVN version as well as 7.16.6.

If the following flags are given with make, the build succeeds but mged produces a segmentation fault when run. Also, the tests and benchmark fail.
make CFLAGS="-O2 -march=i486 -mtune=i686" CXXFLAGS="-O2 -march=i486 -mtune=i686"

Discussion

  • Sean Morrison

    Sean Morrison - 2010-04-06
    • assigned_to: nobody --> brlcad
    • milestone: --> other bug / workaround
    • status: open --> pending-fixed
     
  • Sean Morrison

    Sean Morrison - 2010-04-06

    Fred, a change to the code was made in our trunk sources that addresses this error. It's a curious error that I can't reproduce anywhere -- what compiler are you using?

    Regardless, r38347 has a change that should fix this so please test trunk or report if it works for you after the upcoming 7.16.8 release.

    Cheers!

     
  • Fred

    Fred - 2010-04-06

    First, thanks for the fix. I'll be trying it shortly. I'm using gcc shipped with Slackware 13.0 I've tried compiling this on another machine (dual amd64 with Slackware64-13.0) with the same results as originally posted. Here is the gcc version info from my installed compiler:

    gcc -v
    Reading specs from /usr/lib/gcc/i486-slackware-linux/4.3.3/specs
    Target: i486-slackware-linux
    Configured with: ../gcc-4.3.3/configure --prefix=/usr --libdir=/usr/lib --enable-shared --enable-bootstrap --enable-languages=ada,c,c++,fortran,java,objc --enable-threads=posix --enable-checking=release --with-system-zlib --disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp --with-gnu-ld --verbose --with-arch=i486 --target=i486-slackware-linux --build=i486-slackware-linux --host=i486-slackware-linux
    Thread model: posix
    gcc version 4.3.3 (GCC)

     
  • Fred

    Fred - 2010-04-06
    • status: pending-fixed --> open-fixed
     
  • Fred

    Fred - 2010-04-08

    nmg_class.c works but this file does not:

    nmg_pr.c

    Now this file gives the same error:

    /bin/sh ../../libtool --silent --tag=CC --silent --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../include -DOBJ_BREP=1 -I../../src/other/tnt -I../../src/other/openNURBS -I/usr/local/include -I/usr/X11/include -DBRLCADBUILD=1 -I../../include -I../../src/other/openNURBS -pedantic -W -Wall -Werror -Wno-long-long -O2 -march=i486 -mtune=i686 -pipe -fno-strict-aliasing -fno-common -fexceptions -ggdb3 -D_FORTIFY_SOURCE=2 -O3 -MT nmg_pr.lo -MD -MP -MF .deps/nmg_pr.Tpo -c -o nmg_pr.lo `test -f 'primitives/nmg/nmg_pr.c' || echo './'`primitives/nmg/nmg_pr.c
    cc1: warnings being treated as errors
    primitives/nmg/nmg_pr.c: In function 'nmg_pr_vua':
    primitives/nmg/nmg_pr.c:806: error: array subscript is above array bounds
    make[2]: *** [nmg_pr.lo] Error 1
    make[2]: Leaving directory `/home/fred/extras/BRL-Cad/brlcad/src/librt'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/fred/extras/BRL-Cad/brlcad/src'
    make: *** [all-recursive] Error 1

    I tried to look at your fix to nmg_class.c but I am not that experienced of a programmer so I was not able to replicate your fix on this file to try.

     
  • Sean Morrison

    Sean Morrison - 2010-04-09

    We will just have to hit these up one at a time as I'm unable to reproduce the problem here even with GCC 4.3.3 .. a change to nmg_pr.c has been applied. You actually caught a subtle (albeit minor) bug with that error. The change is applied to latest svn as r38410.

    Any more?

     
  • Sean Morrison

    Sean Morrison - 2010-04-09
    • status: open-fixed --> pending-fixed
     
  • Fred

    Fred - 2010-04-09

    I'm building the source code now without problems where there were before. I think that I will also try compiling on a system with a fresh install of Slackware-13.0 and see what happens. It depends on how much time I have this weekend.

    Thanks for the fixes!

    Fred

     
  • Fred

    Fred - 2010-04-09
    • status: pending-fixed --> open-fixed
     
  • Sean Morrison

    Sean Morrison - 2010-04-09

    Glad to hear it! Feel free to file more reports if you notice other problems.

     
  • Sean Morrison

    Sean Morrison - 2010-04-09
    • status: open-fixed --> closed-fixed
     
  • Fred

    Fred - 2010-04-09
    • status: closed-fixed --> open-fixed
     
  • Fred

    Fred - 2010-04-09

    Well,

    Here's another one. Let me know if I need to be filing a different bug report for this:

    /bin/sh ../../libtool --silent --tag=CC --silent --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../include -I/usr/local/include -I/usr/X11/include -DBRLCADBUILD=1 -I../../include -I../../src/other/openNURBS -pedantic -W -Wall -Werror -Wno-long-long -DIF_REMOTE -DIF_AB -DIF_X -DIF_TK -DIF_OGL -O2 -march=i486 -mtune=i686 -pipe -fno-strict-aliasing -fno-common -fexceptions -gstabs3 -D_FORTIFY_SOURCE=2 -O3 -MT libfb_la-fbserv_obj.lo -MD -MP -MF .deps/libfb_la-fbserv_obj.Tpo -c -o libfb_la-fbserv_obj.lo `test -f 'fbserv_obj.c' || echo './'`fbserv_obj.c
    /bin/sh ../../libtool --silent --tag=CC --silent --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../include -I/usr/local/include -I/usr/X11/include -DBRLCADBUILD=1 -I../../include -I../../src/other/openNURBS -pedantic -W -Wall -Werror -Wno-long-long -DIF_REMOTE -DIF_AB -DIF_X -DIF_TK -DIF_OGL -O2 -march=i486 -mtune=i686 -pipe -fno-strict-aliasing -fno-common -fexceptions -gstabs3 -D_FORTIFY_SOURCE=2 -O3 -MT libfb_la-if_X.lo -MD -MP -MF .deps/libfb_la-if_X.Tpo -c -o libfb_la-if_X.lo `test -f 'if_X.c' || echo './'`if_X.c
    cc1: warnings being treated as errors
    if_X.c: In function 'X_wmap':
    if_X.c:1168: error: ignoring return value of 'write', declared with attribute warn_unused_result
    make[2]: *** [libfb_la-if_X.lo] Error 1
    make[2]: *** Waiting for unfinished jobs....

    Everything else compiles without warnings or errors.

    Thanks,

    Fred

     
  • Fred

    Fred - 2010-04-15
     
  • Fred

    Fred - 2010-04-15
     
  • Fred

    Fred - 2010-04-15

    As of yesterday, I have built the source from svn successfully and ran benchmark and tests without problems. I did have to modify the attached files. Please forgive my poor coding and lack of diffs as I am not too good at that sort of thing.

    Thanks,

    Fred

     
  • Sean Morrison

    Sean Morrison - 2010-06-23

    This issue has been resolved in the latest (unreleased) version of the source code. Thank you for bringing the issue to our attention! You're welcome and encouraged to test and make sure this issue is resolved after the next source release of BRL-CAD.

     
  • Sean Morrison

    Sean Morrison - 2010-06-23
    • priority: 5 --> 6
    • status: open-fixed --> closed-fixed
     
  • Sean Morrison

    Sean Morrison - 2010-06-23

    Fred, feel free to verify trunk compilation for any new/remaining warnings or errors. The ones you mention should now be fixed.

    For future reference, in leu of attaching the entire file you modify, SVN will produce a patch file automatically if you run "svn diff > file.patch" and the resulting patch file is considerably easier to review and apply. Thanks again for the report regardless.

    Cheers!

     
  • Fred

    Fred - 2010-06-23

    I built the latest stable release without any problems recently and have been using it. It crashes when rendering sometimes. I will check it with gdb in the near future. Otherwise, I am checking out the latest from svn and will let it compile today and get back to you. I don't expect that there are any more issues with this though.

    Thanks for the advice on generating a patch.

    Take Care

    Fred

     

Log in to post a comment.