Solved

Real vague question on a linux core

Posted on 2004-03-25
8
380 Views
Last Modified: 2010-04-22
Hi All

I am on RedHat Linux advanced server. My program recieves and responds to multiple clients using sockets. Program has been built for concurrent conection requests.
(This program is a huge 500K lines of code  and works on Linux, HP, solaris and windows)


Now,

As long as only one client is sending the requets (consider it as oad teting with one user) - program works fine. as soon as the load is increased to two simultaneous clients, program crashes!!!!!!!!!!!!!

(Now you'll say - so??? solve it)..

Ofcourse I am trying to solve it but :

1. Backtrace of the core file is not consistant. Ihave atleast 20 different backtraces.
2. If code is in debug mode, crash does not happen.
2. All the back traces have atlease one function common. Say funca(). As soon as I start putting printfs to get good idea about the crash location, crash does not happen.

So the question is : How do I solve this issue?

I am on linux advanced server 2.1 My code has been compiled using gcc 2.96.

Any kind of help/pointers would be appreciated.

Thanks
-Ajay

0
Comment
Question by:avi_india
8 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 10684535
The information you have so far provided is really too less but this is most likely a problem with signals or other IPC ... alternatively you could be having several bugs instead of just one

Are you doing some sort of signalling ... Try building signal handler for all catchable signals and print the signal number and originator ... you will have to use sigaction and not signal interface for this
0
 
LVL 23

Expert Comment

by:brettmjohnson
ID: 10685165
In my experience, you are likely experiencing one of these three problems:

1) You have a multithreaded program with unprotected (non-threadsafe)
access to one or more shared data items.  This could even be as a result
of uses of non-threadsafe library calls (like strtok).  Adding printf statements
injects console i/o into the flow of control.  the i/o triggers a thread context
switch, possibly rearranging the context switches such that you avoid concurrent
access.


2) You are corrupting the stack. Probably in funca() or one of the functions it
calls.  Again, adding printf() statements changes how the stack is utilized.


3) There is a compiler optimization problem.  If running in "debug mode" means
you  compiled with -g -O0, rebuild with -g and your normal optimization level.
this will give you symbols into the the offending code (although linenumbers might
not match up).  Then see if the debugger traps.


0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10686543
Take a look at Valgrind (http://valgrind.kde.org/) to resolve any stack (and in general memory) related problems. The advantage of Valgrind is that you don't have to modify your code, so you can run it on the app that crashes.

Also, Helgrind (part of the Valgrind suite of tools) allows you to find potential race conditions in multithreaded apps.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 51

Expert Comment

by:ahoffmann
ID: 10689908
> If code is in debug mode, crash does not happen.
in 99.9xx% this is a problem with allocated memory, pointer problem, memory leak, whatever ..
I'd go vi Valgrind, Mpatrol, Electric Fence ...
  http://www.cbmamiga.demon.co.uk/mpatrol/
  http://perens.com/FreeeSoftware
  http://valgrind.kde.org/
0
 

Author Comment

by:avi_india
ID: 10690070
Thanks guys.. I m trying to use valgrind. Will update the status as soon as i find something.

(only problem which I can forsee is that - my code also uses smart heap. valgring might clash with this)
0
 

Author Comment

by:avi_india
ID: 11319229
Nothing helped here. bug has been marked as deffered for next release of the product.
0
 

Accepted Solution

by:
CetusMOD earned 0 total points
ID: 12126725
PAQed, with points refunded (500)

CetusMOD
Community Support Moderator
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now