 |
|
 |
|
|
 |
Arithmetic Error on Sun Solaris GCC compiled program |
 |
 |
|
|
08-28-04 10:48 PM
Hello all,
Last year I was an MVS (OS/390) Systems Programmer - this year I'm an
admin for Sun Solaris, so please be gentle :-).
I've written a ISC dhcpd sanity checker/data extractor/static host
verifier in C to run as a standard tool on MacOS X 10.3.5/GCC 3.3 under
Xcode. The sanity checker (chkdhcp) reads the dhcpd.conf and dhcpd.leases
files and extracts all the relavant info including subnets, host list, and
static host list and outputs them to a flat file. A host checker (pinghosts)
then attempts to post-process the static hosts file and check to see that
they're really there.
Everything runs fine on MacOS X 10.3.5, but when I attempt to port the
code to a Solaris 5.8 system with GCC 2.95.2 and run, I get:
chkdhcp v1.0a1 begin execution
Processing begun on file "/etc/dhcpd.conf"
Arithmetic Exception(coredump)
... which isn't terribly helpful.
Everything compiles cleanly, I'm running root so there are no permission
issues. I've used this developement schema to develop code on MacOS X for
deployment on AIX 5, and it worked nicely - though I guess AIX is also
PPC-based.
Really, the only things I can think of that I'm counting on arithmetically
is that I've got an unsigned long int at least 32 bits in length (capable of
holding an IP address).
Has anyone seen anything like this, and can they point me in a good
direction - like what in general they've seen cause problems like this or
what I should be looking at?
Monday I'll be trying it on a Solaris 9 Sunblade I have under my desk
(with the latest GCC), but I was hoping to get it running on the current
production system - and that's all I can access from here (home).
Thanks in advance for any response.
-- Verne
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Arithmetic Error on Sun Solaris GCC compiled program |
 |
 |
|
|
08-29-04 01:48 AM
"Verne Arase" <VerneA@pobox.com> wrote in message
news:0001HW.BD567B5100277E64F00805B0@news.usenetserver.com...
> Hello all,
>
> Last year I was an MVS (OS/390) Systems Programmer - this year I'm an
> admin for Sun Solaris, so please be gentle :-).
>
> I've written a ISC dhcpd sanity checker/data extractor/static host
> verifier in C to run as a standard tool on MacOS X 10.3.5/GCC 3.3 under
> Xcode. The sanity checker (chkdhcp) reads the dhcpd.conf and dhcpd.leases
> files and extracts all the relavant info including subnets, host list, and
> static host list and outputs them to a flat file. A host checker
(pinghosts)
> then attempts to post-process the static hosts file and check to see that
> they're really there.
>
> Everything runs fine on MacOS X 10.3.5, but when I attempt to port the
> code to a Solaris 5.8 system with GCC 2.95.2 and run, I get:
>
> chkdhcp v1.0a1 begin execution
>
>
> Processing begun on file "/etc/dhcpd.conf"
>
> Arithmetic Exception(coredump)
>
> ... which isn't terribly helpful.
>
> Everything compiles cleanly, I'm running root so there are no
permission
> issues. I've used this developement schema to develop code on MacOS X for
> deployment on AIX 5, and it worked nicely - though I guess AIX is also
> PPC-based.
>
> Really, the only things I can think of that I'm counting on
arithmetically
> is that I've got an unsigned long int at least 32 bits in length (capable
of
> holding an IP address).
>
> Has anyone seen anything like this, and can they point me in a good
> direction - like what in general they've seen cause problems like this or
> what I should be looking at?
>
> Monday I'll be trying it on a Solaris 9 Sunblade I have under my desk
> (with the latest GCC), but I was hoping to get it running on the current
> production system - and that's all I can access from here (home).
>
> Thanks in advance for any response.
>
> -- Verne
>
>
Are you accidentally performing an integer divide by zero?
What does the core dump file tell you?
--
Fletcher Glenn
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Arithmetic Error on Sun Solaris GCC compiled program |
 |
 |
|
|
08-29-04 01:48 AM
In article <0001HW.BD567B5100277E64F00805B0@news.usenetserver.com>,
Verne Arase <VerneA@pobox.com> wrote:
> Hello all,
>
> Last year I was an MVS (OS/390) Systems Programmer - this year I'm an
> admin for Sun Solaris, so please be gentle :-).
>
> I've written a ISC dhcpd sanity checker/data extractor/static host
> verifier in C to run as a standard tool on MacOS X 10.3.5/GCC 3.3 under
> Xcode. The sanity checker (chkdhcp) reads the dhcpd.conf and dhcpd.leases
> files and extracts all the relavant info including subnets, host list, and
> static host list and outputs them to a flat file. A host checker (pinghost
s)
> then attempts to post-process the static hosts file and check to see that
> they're really there.
>
> Everything runs fine on MacOS X 10.3.5, but when I attempt to port the
> code to a Solaris 5.8 system with GCC 2.95.2 and run, I get:
>
> chkdhcp v1.0a1 begin execution
>
>
> Processing begun on file "/etc/dhcpd.conf"
>
> Arithmetic Exception(coredump)
>
> ... which isn't terribly helpful.
>
> Everything compiles cleanly, I'm running root so there are no permissio
n
> issues. I've used this developement schema to develop code on MacOS X for
> deployment on AIX 5, and it worked nicely - though I guess AIX is also
> PPC-based.
>
> Really, the only things I can think of that I'm counting on arithmetica
lly
> is that I've got an unsigned long int at least 32 bits in length (capable
of
> holding an IP address).
>
> Has anyone seen anything like this, and can they point me in a good
> direction - like what in general they've seen cause problems like this or
> what I should be looking at?
>
> Monday I'll be trying it on a Solaris 9 Sunblade I have under my desk
> (with the latest GCC), but I was hoping to get it running on the current
> production system - and that's all I can access from here (home).
>
> Thanks in advance for any response.
>
> -- Verne
>
>
Is this an endian issue?
respect...
Peter
(former 370 Systems Programmer)
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Arithmetic Error on Sun Solaris GCC compiled program |
 |
 |
|
|
08-29-04 12:48 PM
On Sat, 28 Aug 2004 18:11:29 -0500, Verne Arase wrote:
> Arithmetic Exception(coredump)
There are several possibilities. See man sigfpe (also, man
fex_set_handling may offer some additional explanation.)
You have to investigate the core dump (or the failing program)
in a debugger to get an idea about the where the problem
occurs.
--
mail1dotstofanetdotdk
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Arithmetic Error on Sun Solaris GCC compiled program |
 |
 |
|
|
08-30-04 01:49 AM
On Sun, 29 Aug 2004 08:12:43 -0500, Bjorn Reese wrote
(in article <pan.2004.08.29.13.12.40.905996@see.signature> ):
> There are several possibilities. See man sigfpe (also, man
> fex_set_handling may offer some additional explanation.)
No floating point used - I assume that fpe stands for floating point
exception.
> You have to investigate the core dump (or the failing program)
> in a debugger to get an idea about the where the problem
> occurs.
Yeah, I guess.
I sure hope they've got some of those Solaris manuals around ...
-- Verne
P.S. Are Solaris core dumps formatted, or structured so some other app
reads/interprets 'em?
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Arithmetic Error on Sun Solaris GCC compiled program |
 |
 |
|
|
08-30-04 07:50 AM
On Sun, 29 Aug 2004, Verne Arase wrote:
> P.S. Are Solaris core dumps formatted, or structured so some other app
> reads/interprets 'em?
That's what dbx, mdb, and co are for...
--
Rich Teer, SCNA, SCSA, author of "Solaris Systems Programming",
published in August 2004.
President,
Rite Online Inc.
Voice: +1 (250) 979-1638
URL: http://www.rite-group.com/rich
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Arithmetic Error on Sun Solaris GCC compiled program |
 |
 |
|
|
08-30-04 07:50 AM
In article <0001HW.BD567B5100277E64F00805B0@news.usenetserver.com>,
Verne Arase <VerneA@pobox.com> wrote:
> Everything runs fine on MacOS X 10.3.5, but when I attempt to port the
> code to a Solaris 5.8 system with GCC 2.95.2 and run, I get:
>
> chkdhcp v1.0a1 begin execution
>
>
> Processing begun on file "/etc/dhcpd.conf"
>
> Arithmetic Exception(coredump)
>
> ... which isn't terribly helpful.
That's why gcc always has gdb nearby. Running the tool under gdb will
probably prove useful. I'd guess it's something like a calculation
returning "inf" or "NaN", that ends up getting handled differently, but
gdb should clear it right up.
--
Tom "Tom" Harrington
Macaroni, Automated System Maintenance for Mac OS X.
Version 2.0: Delocalize, Repair Permissions, lots more.
See http://www.atomicbird.com/
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Arithmetic Error on Sun Solaris GCC compiled program |
 |
 |
|
|
09-02-04 11:50 PM
Verne Arase <VerneA@pobox.com> writes:
>P.S. Are Solaris core dumps formatted, or structured so some other app
>reads/interprets 'em?
They're structured; they're ELF files with ELF sections.
Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Arithmetic Error on Sun Solaris GCC compiled program |
 |
 |
|
|
09-28-04 01:28 PM
On Sun, 29 Aug 2004 23:05:45 -0500, Tom Harrington wrote
(in article <tph-AFF3E3.22054529082004@localhost> ):
> That's why gcc always has gdb nearby. Running the tool under gdb will
> probably prove useful. I'd guess it's something like a calculation
> returning "inf" or "NaN", that ends up getting handled differently, but
> gdb should clear it right up.
Nah, it was a zero divide by the 4th element of a vector with only three
initialized.
Apparently, on the Sun it automatically initialized the element to zero - on
the Mac, it probably didn't bother (lord knows what its value was).
Thanks for the gdb hint.
-- Verne
[ Post a follow-up to this message ]
|
|
|
 |
|
|
|
|
Sponsored Links |
 |
 |
|
|
 |
All times are GMT. The time now is 09:47 AM. |
 |
|
|
 |
|
 |
|
|
 |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
|
|
|
|
Medical and Health forum | Computer Games Reviews | Graphics design forum
|
 |
|
 |
|