🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.soft-sys.khoros
Article #1073

Problems adding functions to khoros using -O

#1073
From: John C. Schultz
Date: Tue, 12 Jan 1993 17:51
28 lines
1719 bytes
I have been adding some functions to Khoros on a Sparc 2, Sun OS
4.1.2, gcc 2.3.2.  The libraries are compiled shared using cc (even
though sun.cf says to use gcc) e.g.

cc -c -DSHAREDCODE -DSUNSHLIB -O -PIC  -I/usr/khoros/include     -DVFORK -DTEMPNAM -DPUTENV  -DRANDOM   -DWAIT3      lvstats.c
mv lvstats.o shared/lvstats.o

The problem that I have noticed was that my routine compiled with gcc
(or cc) and -O, core dumped, but only when I was not running within a
debugger.  For example, if I compiled using gcc with -O and -g, the
program would run fine from within gdb.  From the command line it
would core dump. (I was using a local copy of lvstats.c to debug the
problem.)  Using gdb to examine the core dump, I got a bus error at
line 730 of lvstats.c - shown below.

      new_stats = stats[i];
->      new_stats->integ = (float)sum;


I could find nothing wrong with sum, i, new_stats,...

One way I resolved the problem was to compile MY top-level function
without -O but I still do not know WHY there even IS a problem.

Very puzzling.  I thought I would simply pass it on.
--
   John C. Schultz   +1 (612) 733-4047   schultz@halley.serc.3m.com
   How to include the taste of Glendronach in a multi-media system?
Technical Details
Message-ID: <SCHULTZ.93Jan12114830@halley.est.3m.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!mmm.serc.3m.com!news

Show Full Headers
Complete Article Headers
Newsgroups: comp.soft-sys.khoros
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!mmm.serc.3m.com!news
From: schultz@halley.est.3m.com (John C. Schultz)
Subject: Problems adding functions to khoros using -O
Message-ID: <SCHULTZ.93Jan12114830@halley.est.3m.com>
Sender: news@mmm.serc.3m.com
Organization: 3M Company, 3M Center, Minnesota, USA
Distribution: comp
Date: Tue, 12 Jan 93 17:51:53 GMT
Lines: 28