Bus error

P

pallav

I have to MAC OS X machines running 10.4.8 (tiger) with perl version
5.8.6. I have a gradebook script that computes some statistics to
student grades etc.

When I run this script on one machine, everything runs fine. But on the
second machine,
I continually get a "Bus error" and there is no diagnostics so I don't
know what to do from here.

I looked at the versions of perl. The only difference I could find is
the following:

< uname='darwin b01.apple.com 8.0 darwin kernel version 8.3.0: mon
oct 3 20:04:04 pdt 2005; root:xnu-792.6.22.obj~2release_ppc power
macintosh powerpc '
---
uname='darwin b14.apple.com 8.0 darwin kernel version 8.3.0: mon oct 3 20:04:04 pdt 2005; root:xnu-792.6.22.obj~2release_ppc power macintosh powerpc '
37d36
< SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962


the bad machine lacks a SPRINTF0 fix but i'm not sure if this would
result in a bus error (a hardware problem?, maybe bad/illegal memory
access?).

any ideas how i can resolve this issue? I di dn't build perl from
source. it was whatever that came with teh OS X installation disk. but
i didn't install modules using the cpan program...but i didn't this on
both machines...so i doubt that is the culprit.

any suggestions are appreciated.

-----------------------------------------------------------------------------------------------------------------

THE GOOD MACHINE
Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
Platform:
osname=darwin, osvers=8.0, archname=darwin-thread-multi-2level
uname='darwin b01.apple.com 8.0 darwin kernel version 8.3.0: mon
oct 3 20:04:04 pdt 2005; root:xnu-792.6.22.obj~2release_ppc power
macintosh powerpc '
config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe
-Dldflags=-Dman3ext=3pm -Duseithreads -Duseshrplib'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-g -pipe -fno-common -DPERL_DARWIN
-no-cpp-precomp -fno-strict-aliasing -I/usr/local/include',
optimize='-O3',
cppflags='-no-cpp-precomp -g -pipe -fno-common -DPERL_DARWIN
-no-cpp-precomp -fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='4.0.1 (Apple Computer, Inc. build 5363)',
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags
='-L/usr/local/lib'
libpth=/usr/local/lib /usr/lib
libs=-ldbm -ldl -lm -lc
perllibs=-ldl -lm -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true,
libperl=libperl.dylib
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-bundle -undefined dynamic_lookup
-L/usr/local/lib'


Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
PERL_IMPLICIT_CONTEXT
Locally applied patches:
23953 - fix for File::path::rmtree CAN-2004-0452 security issue
33990 - fix for setuid perl security issues
SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962
Built under darwin
Compiled at Oct 16 2006 22:54:34
%ENV:
PERL5LIB="/sw/lib/perl5:/sw/lib/perl5/darwin"
@INC:
/sw/lib/perl5
/sw/lib/perl5/darwin
/System/Library/Perl/5.8.6/darwin-thread-multi-2level
/System/Library/Perl/5.8.6
/Library/Perl/5.8.6/darwin-thread-multi-2level
/Library/Perl/5.8.6
/Library/Perl
/Network/Library/Perl/5.8.6/darwin-thread-multi-2level
/Network/Library/Perl/5.8.6
/Network/Library/Perl
/System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level
/System/Library/Perl/Extras/5.8.6
/Library/Perl/5.8.1
 
B

Big and Blue

Jim said:
Bus error is usually a memory address outside your usable address
space. It is rare to see this error in a Perl program. Congratulations!

I think you'll find that accessing memory outside of your address space
is a segmentation violation (SIGSEGV). A Bus Error (SIGBUS) means you are
accessing memory which is not correctly aligned for the (numeric) data type
you are trying to use. eg: 32-bit integers may need to be aligned (on
4-byte boundaries (so the address when fetching/storing it must be a
multiple of 4). This is because of constraints on the way the bus fetches
data to move it into registers.
For palav:

So, "sprintf formatting issues" *could* produce such errors. Indeed, if
you look up what CVE-2005-3962 is (Google is good for this) you will find:

http://www.redhat.com/archives/fedora-legacy-list/2005-December/msg00065.html
...it is possible for an attacker to cause perl to crash or execute arbitrary
code if the attacker is able to process a malicious format string.

Although I can't see anything in your script that would fall foul of this
perhaps a module you use could, although it would also require a bug in your
program, since I doubt that you are intentionally attacking yourself.

However, your script seem incomplete - looks like a long line here truncated
on display?
croak "Record '$rec->{$fields->[1]}': Points for
'$fields->[$i]' is '$rec->{$fields->[$i]}' and exceeds$
 

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,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top