473,796 Members | 2,621 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.ms state.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 1465

"Naveen Parihar" <pa*****@isip.m sstate.edu> wrote in message
news:12******** *************** ***@posting.goo gle.com...
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.c h> wrote in message news:<c4******* ***@sunnews.cer n.ch>...
"Naveen Parihar" <pa*****@isip.m sstate.edu> wrote in message
news:12******** *************** ***@posting.goo gle.com...
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 singlelinkedlis t. The documentation for both
Vector and SingleLinkedLis t 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 (singlelinkedli sts) 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.c h> wrote in message news:<c4******* ***@sunnews.cer n.ch>...
"Naveen Parihar" <pa*****@isip.m sstate.edu> wrote in message
news:12******** *************** ***@posting.goo gle.com...
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 singlelinkedlis t. The documentation for both
Vector and SingleLinkedLis t 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 (singlelinkedli sts) 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 (singlelinkedli sts) 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 (singlelinkedli sts) 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
2007
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 syslog: May 4 13:53:49 op-fi1 /kernel: pid 60023 (httpd), uid 80: exited on signal 11 The following code segfaults php every time (or apache when accessed
3
3459
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 have two interpreters at the same time. On Red Hat Linux 7.3 with Perl 5.6.1, the attached program segfaults. On Red Hat 9 with Perl 5.8.0, it works perfectly. Save the program code as "test-embed-perl.c" and the build script as "buildte". ...
5
1162
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. 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...
5
1710
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 program exit, when the set's dtor is called, the shared_ptrS would clean up after themselves appropriately. What actually happens though is that the program segfaults when the set is destructed. I noticed that erasing the smart pointers from...
1
1798
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 glibc 2.3.2. I had another binary (Samhain - to which I have source!) which had the same problem and exhibited the same strace. After a recompile, the newly compiled static binary worked fine. Why is this? The first binary I don't have source...
11
1959
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 format (which allows for comments on lines beginning with "#"), and some of the messages are not correctly copied. I believe the problem may be somewhere around the strcpy() call, but am not sure at all.
15
2098
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 have an XML file containing links and I use an XSL file to build a
29
2588
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
1905
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 defined in a header file (class.h:ClassGood), it works fine, but if i call it in a class declared in a header file but defined in a .cpp (ClassBad) it segfaults.
0
10459
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9055
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7553
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6795
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.