testing on 64/32 Linux/SunOS

B

Billy Patton

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, (e-mail address removed)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top