testing on 64/32 Linux/SunOS

Discussion in 'C++' started by Billy Patton, Apr 26, 2005.

  1. Billy Patton

    Billy Patton Guest

    I have to have my code done for 32 and 64 bit machines on both Linux and
    Solaris. Compiling, not a problem.
    Testing 32 is not a problem.
    But I get segmentation faults when I test on 64 bit machines.

    Here's where my problem comes in. I have this macro:
    static char thr_buf[2048];
    #define THROW(msg) { sprintf(thr_buf,"(%s,%s,%d) :
    %s",__FILE__,__FUNCTION__,__LINE__,msg); throw(thr_buf); }

    My test code looks like:
    try { NodeNewArb(-20,1,NULL); }
    catch(const char* s) { OK(strstr(s,"Layer < 0")); }


    The function NodeNewArb looks like:
    node_p NodeNewArb(int layer, int npts,xy_p pts)
    {
    if (layer < 0) THROW("Layer < 0");


    There's more but this is as far as it gets, as it should with a -20 for a
    layer.

    Here's the result of a tb in gbd
    Breakpoint 2, NodeNewArb (layer=-20, npts=1, pts=0x0) at Laff.cxx:6122
    6122 if (layer < 0) THROW("Layer < 0");
    (gdb) p layer
    $1 = -20
    (gdb) n

    Program received signal SIGSEGV, Segmentation fault.
    classify_object_over_fdes (ob=0x729e80, this_fde=0x61a958) at
    unwind-dw2-fde.h:172
    172 {
    Current language: auto; currently c
    (gdb) bt
    #0 classify_object_over_fdes (ob=0x729e80, this_fde=0x61a958) at
    unwind-dw2-fde.h:172
    #1 0x00000000005669b9 in search_object (ob=0x729e80, pc=0x5651b1) at
    unwind-dw2-fde.c:731
    #2 0x0000000000566d95 in _Unwind_Find_FDE (pc=0x5651b1, bases=0x7fbff11698) at
    unwind-dw2-fde.c:997
    #3 0x000000000056471e in uw_frame_state_for (context=0x7fbff115f0,
    fs=0x7fbff111d0) at /apps/local-source/gcc/gcc-3.4.1/gcc/unwind-dw2.c:1015
    #4 0x0000000000564edf in uw_init_context_1 (context=0x7fbff115f0,
    outer_cfa=0x7fbff11710, outer_ra=0x549fb6)
    at /apps/local-source/gcc/gcc-3.4.1/gcc/unwind-dw2.c:1281
    #5 0x00000000005651b2 in _Unwind_RaiseException (exc=0xd01980) at
    unwind.inc:93
    #6 0x0000000000549fb6 in __cxa_throw (obj=0x0, tinfo=0x0, dest=0) at
    /apps/local-source/gcc/gcc-3.4.1/libstdc++-v3/libsupc++/eh_throw.cc:75
    #7 0x00000000004c52ce in NodeNewArb (layer=-20, npts=1, pts=0x0) at
    Laff.cxx:6122
    #8 0x000000000043e343 in t_NodeMalloc () at test.cxx:2867
    #9 0x00000000004af957 in main (argc=1, argv=0x7fbff11b28) at test.cxx:8321
    (gdb) q
    The program is running. Exit anyway? (y or n) y

    ___ _ ____ ___ __ __
    / _ )(_) / /_ __ / _ \___ _/ /_/ /____ ___
    / _ / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
    /____/_/_/_/\_, / /_/ \_,_/\__/\__/\___/_//_/
    /___/
    Texas Instruments ASIC Circuit Design Methodology Group
    Dallas, Texas, 214-480-4455,
     
    Billy Patton, Apr 26, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nishi Bhonsle
    Replies:
    17
    Views:
    932
    Nishi Bhonsle
    Sep 27, 2004
  2. Berthold =?iso-8859-15?q?H=F6llmann?=

    compiling _tkinter.so (2.3) on SunOS 5.8

    Berthold =?iso-8859-15?q?H=F6llmann?=, Aug 26, 2003, in forum: Python
    Replies:
    0
    Views:
    351
    Berthold =?iso-8859-15?q?H=F6llmann?=
    Aug 26, 2003
  3. Replies:
    2
    Views:
    1,740
    gaool
    Sep 16, 2004
  4. gaool

    Buffer problem on SunOS

    gaool, Nov 22, 2004, in forum: Python
    Replies:
    1
    Views:
    578
    Donn Cave
    Nov 22, 2004
  5. Replies:
    17
    Views:
    520
    Ben Pfaff
    Sep 16, 2006
Loading...

Share This Page