This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [user] segfault w/ error 4


U.Mutlu wrote, On 09/11/2012 07:52 AM:
Ian Lance Taylor wrote, On 09/11/2012 07:34 AM:
On Mon, Sep 10, 2012 at 10:06 PM, U.Mutlu <for-gmane@mutluit.com> wrote:

recently a server daemon program suddenly started repeatedly crashing.
syslog says:
  segfault at 7f6d003d5453 ip 00007f6d49c9dd6d sp 00007f6d469c1b60 error 4 in
libstdc++.so.6.0.17[7f6d49bff000+e8000]

What does "error 4" mean? Is this documented somewhere?

Is this an application error or rather an error in libstdc++.so ?

The error is not always repeatable, ie. happens occasionally, reason unknown
yet.

What's the easiest method to locate the bug in this server daemon pgm?

That message does not come from libstdc++. You neglected to mention anything about the system, but that looks like the log from an x86 Linux kernel when a program crashes. For the Linux kernel, error 4 means that this is a user-mode access.

You can get this kind of thing if you pass a NULL pointer to a
libstdc++ routine that is not expecting one, so this may be a bug in
your program.  Or it may be a bug in libstdc++.

There was in a function a string comparisions whereby a const std::string was compared against a const ptr to char ("if (s == psz) ..."). Not sure if that could be the reason (IMHO yes), as it indeed looked ugly & dangerous I now have replaced the char ptr by an ordinary std::string. Will wait & observe what happens... :-)

System is debian 7 (wheezy) w/ latest updates from the debian repository.
The error happens only with the 64-bit version of the system library on multicore systems (amd64).
On 32bit-multicore-systems the error doesn't happen. That's the weird thing.
Any suggestions for locating and fixing the bug are welcome as the program crashes every half hour or so :-(



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]