473,396 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Weird segfaults

I've a binary that runs on most of our servers but segfaults on one of
the servers. Further, even on this specific machine, the binary runs
successfully sometimes but segfaults most of the time. While trying to
debug this behaviour using gdb, I found out that the segfaults occurs
randomly at different places in the code. For example, once a pointer
was not initiallized to NULL (it was pointing to x8 insterad of x0) in
a constructor, even though it ran through the intialization code.

Has anyone come across this kind of behavior? Any help and/or
information sf highly appreciated.

-Naveen

Here is the configuration of the machine where the problem occurs:
isip213_[1]: g++ -v
Reading specs from /usr/local/lib/gcc-lib/i386-pc-solaris2.7/3.2.1/specs
Configured with: ../gcc-3.2.1/configure --prefix=/usr/local
--with-gnu-as --with-as=/usr/local/bin/as --with-gnu-ld
--with-ld=/usr/local/bin/ld
Thread model: posix
gcc version 3.2.1
isip213_[1]: uname -a
SunOS isip213.isip.msstate.edu 5.7 Generic_106542-20 i86pc i386
isip213_[1]: psrinfo -v
Status of processor 0 as of: 04/01/04 14:38:57
Processor has been on-line since 03/29/04 16:22:01.
The i386 processor operates at 826 MHz,
and has an i387 compatible floating point processor.
Status of processor 1 as of: 04/01/04 14:38:57
Processor has been on-line since 03/29/04 16:22:06.
The i386 processor operates at 826 MHz,
and has an i387 compatible floating point processor.
isip213_[1]:
Jul 22 '05 #1
5 1447

"Naveen Parihar" <pa*****@isip.msstate.edu> wrote in message
news:12**************************@posting.google.c om...
I've a binary that runs on most of our servers but segfaults on one of
the servers. Further, even on this specific machine, the binary runs
successfully sometimes but segfaults most of the time. While trying to
debug this behaviour using gdb, I found out that the segfaults occurs
randomly at different places in the code. For example, once a pointer
was not initiallized to NULL (it was pointing to x8 insterad of x0) in
a constructor, even though it ran through the intialization code.

Has anyone come across this kind of behavior? Any help and/or
information sf highly appreciated.

-Naveen


Did you step through the initialization and then the initialized pointer was
still NULL? I somehow doubt that unless your compiler is very broken. Could
it be that you´re missing an appropriate copy constructor? Without some
example code that can reproduce the problem one cannot really give a precise
answer.

Regards
Chris
Jul 22 '05 #2
"Chris Theis" <Ch*************@nospam.cern.ch> wrote in message news:<c4**********@sunnews.cern.ch>...
"Naveen Parihar" <pa*****@isip.msstate.edu> wrote in message
news:12**************************@posting.google.c om...
I've a binary that runs on most of our servers but segfaults on one of
the servers. Further, even on this specific machine, the binary runs
successfully sometimes but segfaults most of the time. While trying to
debug this behaviour using gdb, I found out that the segfaults occurs
randomly at different places in the code. For example, once a pointer
was not initiallized to NULL (it was pointing to x8 insterad of x0) in
a constructor, even though it ran through the intialization code.

Has anyone come across this kind of behavior? Any help and/or
information sf highly appreciated.

-Naveen


Did you step through the initialization and then the initialized pointer was
still NULL? I somehow doubt that unless your compiler is very broken. Could
it be that you´re missing an appropriate copy constructor? Without some
example code that can reproduce the problem one cannot really give a precise
answer.


Thanks for the reply.

This problem occurs while using a fairly complicated speech
recognition system. And the code base and runtime is so large that it
is not feasible to step through every single step of execution. Note
that the segfaults occurs randomly.
One of the instances of segfault occured immediately after declaring a
vector of about 10,000 singlelinkedlist. The documentation for both
Vector and SingleLinkedList is available here:

http://www.isip.msstate.edu/projects...documentation/

It turns out that the last (tail) pointer of the element of vector, a
single linked list object, was not initialized to NULL. All the other
elements (singlelinkedlists) that I looked at were properly intialized
through the default constructor.

All these segfaults occur on a specific machine. We have other servers
identical (in hardware and OS) and everything runs fine on them. Also,
we share the same developement binaries (compiler, linker, etc.)
across all the machines and so, complier should not be an issue.

-Naveen
Jul 22 '05 #3
"Chris Theis" <Ch*************@nospam.cern.ch> wrote in message news:<c4**********@sunnews.cern.ch>...
"Naveen Parihar" <pa*****@isip.msstate.edu> wrote in message
news:12**************************@posting.google.c om...
I've a binary that runs on most of our servers but segfaults on one of
the servers. Further, even on this specific machine, the binary runs
successfully sometimes but segfaults most of the time. While trying to
debug this behaviour using gdb, I found out that the segfaults occurs
randomly at different places in the code. For example, once a pointer
was not initiallized to NULL (it was pointing to x8 insterad of x0) in
a constructor, even though it ran through the intialization code.

Has anyone come across this kind of behavior? Any help and/or
information sf highly appreciated.

-Naveen


Did you step through the initialization and then the initialized pointer was
still NULL? I somehow doubt that unless your compiler is very broken. Could
it be that you´re missing an appropriate copy constructor? Without some
example code that can reproduce the problem one cannot really give a precise
answer.


Thanks for the reply.

This problem occurs while using a fairly complicated speech
recognition system. And the code base and runtime is so large that it
is not feasible to step through every single step of execution. Note
that the segfaults occurs randomly.
One of the instances of segfault occured immediately after declaring a
vector of about 10,000 singlelinkedlist. The documentation for both
Vector and SingleLinkedList is available here:

http://www.isip.msstate.edu/projects...documentation/

It turns out that the last (tail) pointer of the element of vector, a
single linked list object, was not initialized to NULL. All the other
elements (singlelinkedlists) that I looked at were properly intialized
through the default constructor.

All these segfaults occur on a specific machine. We have other servers
identical (in hardware and OS) and everything runs fine on them. Also,
we share the same developement binaries (compiler, linker, etc.)
across all the machines and so, complier should not be an issue.

-Naveen
Jul 22 '05 #4
>
It turns out that the last (tail) pointer of the element of vector, a
single linked list object, was not initialized to NULL. All the other
elements (singlelinkedlists) that I looked at were properly intialized
through the default constructor.

All these segfaults occur on a specific machine. We have other servers
identical (in hardware and OS) and everything runs fine on them. Also,
we share the same developement binaries (compiler, linker, etc.)
across all the machines and so, complier should not be an issue.

-Naveen


Your errant server must be being bombarded by cosmic rays or other ionizing
radiation. Try lead shielding, it is cheap.

john
Jul 22 '05 #5
>
It turns out that the last (tail) pointer of the element of vector, a
single linked list object, was not initialized to NULL. All the other
elements (singlelinkedlists) that I looked at were properly intialized
through the default constructor.

All these segfaults occur on a specific machine. We have other servers
identical (in hardware and OS) and everything runs fine on them. Also,
we share the same developement binaries (compiler, linker, etc.)
across all the machines and so, complier should not be an issue.

-Naveen


Your errant server must be being bombarded by cosmic rays or other ionizing
radiation. Try lead shielding, it is cheap.

john
Jul 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: marko | last post by:
I'm having big problems with php and mysql. php segfaults on certain mysql calls, with the following logs in apache error log: child pid 60386 exit signal Segmentation fault (11) and in the...
3
by: David F. Skoll | last post by:
Hi, I'm tearing my hair out on this one. I'm trying to embed a Perl interpreter into a C program. I need to be able to create and destroy the interpreter periodically, but will never actually...
5
by: Naveen Parihar | last post by:
I've a binary that runs on most of our servers but segfaults on one of the servers. Further, even on this specific machine, the binary runs successfully sometimes but segfaults most of the time....
5
by: Matthias Kaeppler | last post by:
Hi, I thought it'd be a better idea to start a new thread dealing directly with my problem. Okay, here's again what's happening: I'm storing boost::shared_ptrS in an std::set. I supposed that on...
1
by: David Douthitt | last post by:
I have a binary statically linked application that was compiled against Red Hat 7.3 (presumably glibc 2.2.5). The application SegFaults when run in a Red Hat Advanced Server environment - with...
11
by: ncf | last post by:
Ok, I've been tring to resolve this issue for some time now (~1 day which is way longer than normal for me) to no avail. I am reading a file into a list in memory, using a "%" delimited file...
15
by: lucky | last post by:
Hi Guys You are probably my last chance to avoid getting crazy To help you understand my problem I have put images online showing the issue I have: http://www.australix.net/images/pb I...
29
by: Pietro Cerutti | last post by:
Hello, here I have a strange problem with a real simple strtok example. The program is as follows: ### BEGIN STRTOK ### #include <string.h> #include <stdio.h>
1
by: nsm.nikhil | last post by:
I'm writing a small game, and I've been getting an almost pathetic bug with SDL. I've written a small wrapper (textutil.h:rtTextUtil) to make rendering easy. Now if i call it from a class...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.