Bus Error Core Dumped Solaris
Contents |
I'm not pointing my finger at gcc here, this is a Sun gotcha).Here's an example program (simplified for something much more complex that I was debugging), that illustrates how memory alignment on SPARC systems can bite you if you are bus error core dumped solaris 10 doing low-level things in C. In the example the program allocates space for a thing solaris signal 10 bus error structure which will be prepended with a header. The header structure has a dummy byte array called data which will be used to reference segmentation fault - core dumped in solaris the start of the thing.struct thing { int an_int;};struct header { short id; char data[0];};struct header * maker( int size ) { return (struct header *)malloc( sizeof( struct header ) + size );}int main( void ) { struct header
Bus Error Core Dumped Linux
* a_headered_thing = maker( sizeof( struct thing ) ); struct thing * a_thing = (struct thing *)&(a_headered_thing->data[0]); a_thing->an_int = 42;}If you build this on a SPARC machine you'll get the following error when you run it:Bus Error (core dumped)Annoyingly, if you build a debugging version of this program the problem magically goes away and doesn't dump core in the debugger. So you either resort to printf-style debugging or going into gdb and looking at the assembly output.Here's what bus error core dumped c happens when you run this in gdb (non-debug code):(gdb) runProgram received signal SIGSEGV, Segmentation fault.0x000106d8 in main ()Since you can't get back to the source we're forced to do a little disassembly:(gdb) disassembleDump of assembler code for function main:0x000106b0
& Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers Search Forums Show Threads Show Posts Tag Search Advanced Search Unanswered Threads Find All python bus error core dumped Thanked Posts Go to Page... learn linux and unix commands - unix shell scripting bus
Bus Error Core Dumped C Programming
error on solaris UNIX for Dummies Questions & Answers Thread Tools Search this Thread Display Modes #1 01-29-2004 hcclnoodles Registered
Bus Error (core Dumped) Centos
User Join Date: Mar 2002 Last Activity: 20 January 2016, 4:16 AM EST Posts: 303 Thanks: 1 Thanked 1 Time in 1 Post bus error on solaris Hi there I am running soalris 9 on a sun fire 480r and http://blog.jgc.org/2007/04/debugging-solaris-bus-error-caused-by.html all of a sudden (today) whenever the users run the command `top` we get the following message `bus error` does anybody have any information on what this is all about and whether there is a routine i can perform to gather more information on this any help on this would greatly appreciated Remove advertisements Sponsored Links hcclnoodles View Public Profile Find all posts by hcclnoodles #2 01-29-2004 jsilva Registered User Join Date: Apr 2003 Last Activity: 28 July 2010, 3:08 http://www.unix.com/unix-for-dummies-questions-and-answers/12838-bus-error-solaris.html PM EDT Posts: 169 Thanks: 0 Thanked 2 Times in 1 Post Hi, There're many reasons for a "bus error". It may be because the program ( top ) is trying to do some I/O operation to a device that has no permissions or does not exist... confirm that that only happens with top... is there any core dump ? It can be caused by bad programming too... or some OS issue... Remove advertisements Sponsored Links jsilva View Public Profile Visit jsilva's homepage! Find all posts by jsilva #3 01-29-2004 rhfrommn Registered User Join Date: Nov 2003 Last Activity: 25 January 2012, 5:08 PM EST Location: Minnesota Posts: 447 Thanks: 0 Thanked 3 Times in 3 Posts Unfortunately this is often caused by failed hardware, either a dead disk or a mainboard problem with the bus to the disk. Try doing other commands that will access each of your disks like du, ls, cd, etc. and see if you can pin down a pattern. If it truly is just the top command doing it a corrupted program or version conflict is possible, but if you get many different commands all failing when trying to access the same disk it is probably hardware. rhfrommn View Public Profile Find all posts by rhfrommn #4 01-29-2004 Perderabo Unix Daemon (Administrator Emeritus) Join Date: Aug 2001 Last Activity: 26 February 2016, 12:31 PM EST Location: Ashburn, Virginia Posts: 9,931 Thanks: 64 Thanked 462
UTC Modified: 2007-06-04 08:35 UTC From: shane dot kinsch at netracorp dot com Assigned: Status: Not a bug Package: *Compile Issues PHP Version: 4.4.7 OS: Solaris 10 (SunOS 5.10) https://bugs.php.net/bug.php?id=41552 Private report: No CVE-ID: View Add Comment Developer Edit [2007-05-31 16:25 UTC] shane dot kinsch at netracorp dot com Description: ------------ Running the "make test" for PHP 4.4.7 caused a core dump under Solaris Using GCC 3.4.6 under Solaris 10 (SunOS 5.10) and receive the same Bus Error / core dump on an elaborate configure or a basic configure. In the example below, I'm using a bus error simple configure in order to isolate where the issue may live, but unfortunately I'm still stumped. Reproduce code: --------------- I received a simple warning about libiconv, so I've downgraded libiconv from 1.11 to 1.9.2 with no different results. I've since removed 1.9.2 and re-applied libiconv 1.11. I get the same bus error / core dump when I configure PHP with only these options: # make clean bus error core # CC="gcc" \ ./configure --disable-xml --without-pear It configures what appears to be fine: http://my.gi.net/shane.kinsch/php-configure-log.txt It compiles what appears to be fine as well: http://my.gi.net/shane.kinsch/php-make-log.txt OS and Package Versions: SunOS web1 5.10 s10_72 sun4u sparc SUNW,UltraSPARC-IIi-cEngine - openssl-0.9.8e - autoconf 2.60 - automake 1.10 - bison 2.3 - expat 1.95.5 - flex 2.5.33 - fontconfig 2.4.2 - freetype 2.3.1 - gcc 3.4.6 - gd 2.0.33 - jpeg 6b - libiconv 1.9.2 - libpng 1.2.16 - libtool 1.5 - libxml2 2.6.26 - libxslt 1.1.17 - m4 1.4.7 - make 3.81 - perl 5.8.8 - texinfo 4.8 - xpm 3.4k - zlib 1.2.3 Expected result: ---------------- "make test" to complete successfully, or even execute. Actual result: -------------- # make test Bus Error - core dumped make: [test] Error 138 (ignored) core dump Patches Add a PatchPull Requests Add a Pull RequestHistoryAllCommentsChangesGit/SVN commitsRelated reports [2007-05-31 16:33 UTC] tony2001@php.net Try updating GCC to the latest available version. [2007-06-01 14:45 UTC] shane dot kinsch at netracorp dot com I downloaded the Sun Studio 11 compiler from: http://opensolaris.org/os/community/tools/sun_studio_tools/sun_studio_11_tools/ Then recompiled PHP using these options: arch=`isainfo -k | sed s/sparc//` \ CC="/opt/SUNWspro/bin/cc -fast -xarch=${arch}" \ CXX="/opt/SUNWspro/bin/CC -fast -xarch=${arch}" \ CPPFLAGS="-I/usr/local/ssl/include" \ LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib --L/usr/local/mysql/lib -L/us