SIGBUS, Bus error.

  • Thread starter contactmayankjain
  • Start date
C

contactmayankjain

Hi,

I am getting the following error. Can you tell me any solution to this
problem and the reason for this


298

Program received signal SIGBUS, Bus error.
0x000000080137ae02 in __gnu_cxx::__exchange_and_add ()
from /usr/lib/libstdc++.so.5
(gdb) bt
#0 0x000000080137ae02 in __gnu_cxx::__exchange_and_add ()
from /usr/lib/libstdc++.so.5
#1 0x00000000008a3ead in PContainer::Destruct ()
#2 0x000000000044e278 in ~PAbstractArray (
this=0x7fffffffdbb8) at array.h:171
#3 0x000000000046b947 in ~PBaseArray (this=0x7fffffffdbb8)
at array.h:849
#4 0x00000000004af257 in ~PBYTEArray (this=0x7fffffffdbb8)
at h4504.cxx:155
#5 0x00000000004af86c in ~PASN_OctetString (
this=0x7fffffffdb90) at h4504.cxx:155
#6 0x00000000004bb8af in ~H225_H323_UserInformation_user_data
(this=0x7fffffffda68) at h450pdu.cxx:389
#7 0x00000000004bae0f in ~H225_H323_UserInformation (
this=0x7fffffffcc40) at h225_1.cxx:8157

Thanks
Regards
Mayank Jain
 
I

Ian Collins

Hi,

I am getting the following error. Can you tell me any solution to this
problem and the reason for this
You have an error at line 42 of your code.

For better help, post a minimal example that gives the problem.
 
C

contactmayankjain

You have an error at line 42 of your code.

For better help, post a minimal example that gives the problem.

Hi

During the porting of my code on 64 bit I get this error. I don't know
much details about this error so have just put the back trace of
code.


Thanks
Mayank Jain
 
A

Alan Woodland

During the porting of my code on 64 bit I get this error. I don't know
much details about this error so have just put the back trace of
code.
It's hard to tell without more specific details - for all I know from
that backtrace and what you've said you could have a little magic pixie
somewhere in any of those functions!

More seriously though SIGBUS is quite often (but not always) indicative
of an unsupported unaligned load/store. If you want more specific
answers a (simple) example is needed that illustrates your problem so we
can analyse it.

Alan
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

Hi,

I am getting the following error. Can you tell me any solution to this
problem and the reason for this


298

Program received signal SIGBUS, Bus error.
0x000000080137ae02 in __gnu_cxx::__exchange_and_add ()
from /usr/lib/libstdc++.so.5
(gdb) bt
#0 0x000000080137ae02 in __gnu_cxx::__exchange_and_add ()
from /usr/lib/libstdc++.so.5
#1 0x00000000008a3ead in PContainer::Destruct ()
#2 0x000000000044e278 in ~PAbstractArray (
this=0x7fffffffdbb8) at array.h:171
#3 0x000000000046b947 in ~PBaseArray (this=0x7fffffffdbb8)
at array.h:849
#4 0x00000000004af257 in ~PBYTEArray (this=0x7fffffffdbb8)
at h4504.cxx:155
#5 0x00000000004af86c in ~PASN_OctetString (
this=0x7fffffffdb90) at h4504.cxx:155
#6 0x00000000004bb8af in ~H225_H323_UserInformation_user_data
(this=0x7fffffffda68) at h450pdu.cxx:389
#7 0x00000000004bae0f in ~H225_H323_UserInformation (
this=0x7fffffffcc40) at h225_1.cxx:8157

I'm not sure but I think the __exchange_and_add() is one of those atomic
operations that form the foundation of most (all?) threading libraries,
SIGBUS is a bith tough to figure out since there's no standard telling
what it is (depends on your platform) but it might be the physical
address equivalent of SIGSEGV.

My guess would be that PContainer uses either threading, reference
counting, or both and some pointer have been corrupted so when it tries
to perform some action in Destruct() it blows up.

If those P* classes are part of some library you should contact those
that made that library, if not you are on your own. Posting more code
might help but it's hard to tell where the bug is.
 
A

anon

Hi,

I am getting the following error. Can you tell me any solution to this
problem and the reason for this

Try debugging it.
On Linux try using ddd, but you will need to build your program with
debug symbols
 
D

dogatemycomputer

You have an error at line 42 of your code.

Are you implying this is the meaning of the universe? (a debug error)
or is there really an error on line 42?

If its the meaning of the universe then it all makes perfect sense
otherwise i'm still learning C++ and any clarification you could
provide would be appreciated.
 
B

Bo Persson

(e-mail address removed) wrote:
::: You have an error at line 42 of your code.
::
:: Are you implying this is the meaning of the universe? (a debug
:: error) or is there really an error on line 42?
::
:: If its the meaning of the universe then it all makes perfect sense
:: otherwise i'm still learning C++ and any clarification you could
:: provide would be appreciated.

It's a local joke around here.

As you already know, the answer to the most difficult question ever is
42. Unfortunately we didn't get the question.

In your case, you just didn't provide enough background for us to make
an educated guess. Providing some code for the destructors involved
might help some (or not).

Right now, all we know is that The answer is 42. As this is
programming, perhaps it means line 42? Or not?



Bo Persson
 
D

dogatemycomputer

(e-mail address removed) wrote:

::: You have an error at line 42 of your code.
::
:: Are you implying this is the meaning of the universe? (a debug
:: error) or is there really an error on line 42?
::
:: If its the meaning of the universe then it all makes perfect sense
:: otherwise i'm still learning C++ and any clarification you could
:: provide would be appreciated.

It's a local joke around here.

As you already know, the answer to the most difficult question ever is
42. Unfortunately we didn't get the question.

In your case, you just didn't provide enough background for us to make
an educated guess. Providing some code for the destructors involved
might help some (or not).

Right now, all we know is that The answer is 42. As this is
programming, perhaps it means line 42? Or not?

Bo Persson

Just for clarification.. I didn't ask the original question. I was
just curious if I missed a line number or if the universe was just
buggy. ;)
 
J

James Kanze

I'm not sure but I think the __exchange_and_add() is one of those atomic
operations that form the foundation of most (all?) threading libraries,

It's part of the gcc library, used in their implementation of
COW in std::string, for example. The versions I've seen of it
are pretty buggy: the Sparc 32 bit version can deadlock, and the
Sparc 64 bit version is missing the necessary membar
instructions. (I've not looked at the Intel versions.)
SIGBUS is a bith tough to figure out since there's no standard telling
what it is (depends on your platform) but it might be the physical
address equivalent of SIGSEGV.

Traditionally (dating back to the PDP-11), its the result of an
unaligned memory access. Without knowing more about his
platform, it's difficult to say more. (Intel hardware will
execute an unaligned access, so I wouldn't expect a SIGBUS on an
Intel. But sometimes, it is also the result of an illegal
machine instruction.)

Two things I'd look at here: where does the argument to
__exchange_and_add come from. The OP mentionned porting to 64
bits, so there could easily be an alignment problem---the
address is 4 byte aligned, and needs to be 8. The other
possibility might be that he's somehow linking in a .o from a
different machine, and getting an illegal machine instruction.
 
J

Jim Langston

Hi,

I am getting the following error. Can you tell me any solution to this
problem and the reason for this


298

Program received signal SIGBUS, Bus error.
0x000000080137ae02 in __gnu_cxx::__exchange_and_add ()
from /usr/lib/libstdc++.so.5
(gdb) bt
#0 0x000000080137ae02 in __gnu_cxx::__exchange_and_add ()
from /usr/lib/libstdc++.so.5
#1 0x00000000008a3ead in PContainer::Destruct ()
#2 0x000000000044e278 in ~PAbstractArray (
this=0x7fffffffdbb8) at array.h:171
#3 0x000000000046b947 in ~PBaseArray (this=0x7fffffffdbb8)
at array.h:849
#4 0x00000000004af257 in ~PBYTEArray (this=0x7fffffffdbb8)
at h4504.cxx:155
#5 0x00000000004af86c in ~PASN_OctetString (
this=0x7fffffffdb90) at h4504.cxx:155
#6 0x00000000004bb8af in ~H225_H323_UserInformation_user_data
(this=0x7fffffffda68) at h450pdu.cxx:389
#7 0x00000000004bae0f in ~H225_H323_UserInformation (
this=0x7fffffffcc40) at h225_1.cxx:8157

I can't tell you a solution, just help point to the problem.

You are destructing H255_H323_UserInformation, which destructs
H225_H323_UserInformation_user_data, which destructs POASN_OctetString,
which destructs PBYTEArray, which destructs PAbstractArray. Now, this seems
to be where your problem is. PAbstractArray calls PContainer::Destruct
which is causing the error. Look at yoru PAbstractArray (declared in
array.h most likely). You'll want to put a debug stop point on its
destructor and run the problem, then step through.
 

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

Similar Threads


Staff online

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top