473,802 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stuck with a strange core (C code) -- Please help.

SZ
Hi,

I've hit this core multiple times when running an application (coded
in C)
running on BSD OS. Using gdb getting to the core, it shows:

.....
(gdb) bt
#0 0x8541fa3 in mTimerQUnlink (t=0xd7f5a51, head=0x8fec13c)
at ../../rsvp/eventwheel.c:16 0
#1 0x854288d in mTimerInsert (t=0xd7f5a51,
callback=0x873c e88 <retran_unacked >, param=0xd7f5a01 , time=50,
type=1)
at ../../rsvp/eventwheel.c:53 6
#2 0x873d266 in retran_unacked (unacked_cb=0xd 7f5a00)
at ../../rsvp/rrrmsgi3.c:1425
....
Notice that the address (0xd7f5a00) of "unacketd_c b" (pointer of a
struct)
at level 2 is passed to the function of mTimerInsert as "param". But
"param" becomes 0xd7f5a01 (which added a "1" at the end). All the
subsequent processing is based on this wrong address causing the core.
The application is compiled with gcc with "-O2" along with some other
options.

I know address here can not start with ood number. This is a weired
problem. The stack shown with bt command in gdb seems to be complete.

Anyone knows what direction should I go with for the trouble shooting?

Thanks a lot

-SZ
Nov 14 '05
11 1662
SZ
I think the problem is found:

there is a function, which is a couple of layers down from
rrr_resend_pack et(), got something like a[i]++ with a[] defined
as local and i uninitialized. This cause it radmomly pick up
a place (in stack) and increment it.

Geez, I hope there is a better systematic way to catch memory
violation like this.

Thanks everyone for your help.

-SZ
Nov 14 '05 #11
sh******@yahoo. com (SZ) wrote:
there is a function, which is a couple of layers down from
rrr_resend_pack et(), got something like a[i]++ with a[] defined
as local and i uninitialized. This cause it radmomly pick up
a place (in stack) and increment it.

Geez, I hope there is a better systematic way to catch memory
violation like this.


Well, in this case, a good way to catch it would probably have been not
to rely on a memory tracker and your OS alone, but to turn up the
warning level on your compiler until the knob nearly comes off, and then
turning it one stop back. All compilers I've ever worked with were
capable of telling you that you're using an uninitialised variable,
which would've caught this bug before it got out.
(The reason for the one stop back, btw, is that most compilers' "really
anal-retentive" settings are _too_ strict and pick up things that are,
e.g., only a problem if you're compiling for an embedded system, which
you probably aren't; at least one edition of one compiler famously
complains about its own system headers when set to the highest warning
level. Nevertheless, below the extreme, stricter warnings is better.)

Richard
Nov 14 '05 #12

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

Similar topics

9
2417
by: hope | last post by:
Hi Access 97 I'm lost on this code please can you help ================================= Below is some simple code that will concatenate a single field's value from multiple records into a single string separated by a user defined character. There is no error trapping (by design), USE AT YOUR OWN RISK.
3
25061
by: Mads Petersen | last post by:
I'm stuck in this code. Hope you can and will help me. I launch it from excel. I have made the following code work, but not as i whant. I need the ranges to be working with something like xlDown. eg. this only transferes the first record in the area. ..Fields("Uge").Value = ws.Range("A98").Value Sub SelectMaster()
8
2239
by: Harvey Twyman | last post by:
I have code written under the CCS 'C' Compiler to run on a PIC microcontroller. Code Extract: ------------------------------- char a,b,c; ------------------------------- c = ( a == b ); -------------------------------
1
1496
by: Fabrizio | last post by:
On a web page i found a very strange html code (see at the en of this message) to set the type of the characters (like bold, italic, etc.) and I have 2 question 1) How interpreter this code ? 2) can I use this code to set also the colour and the font used for the text (like verdana) ? If yes how ? Thank you in advance for your help
7
1356
by: digimotif | last post by:
All, I'm currently working with a small development company on a PHP application they already have. There are several processing tasks that could be scripted in Python and run in the background to modify a database, instead of the way they have it now, which waits for a webpage to return from processing. There is also the possibility of building client gui applications that work with the database as well, so I'm looking for a way I...
6
1453
by: marmar12 | last post by:
Hi guys, I'm having a little difficulty and kind of stuck writing this particular code for a grade calculator project. I'm using linux OS. So far, i have: #include <stdio.h> int man() {
3
1761
by: BlueroY | last post by:
hi, I'm working on an exercise, i did a lot of work already and i just can't figure where I'm going wrong, this is what I'm trying to achieve Sample IO ******************************************************************************* Welcome to PeopleSoft 2 MENU: (A)dd student, (D)elete, (L)ist, (S)ort, e(X)it a Enter the student number MSXMIC001 Enter the name
2
1346
by: almurph | last post by:
H ieveryone, Can you help me please? I am trying to sort a hashtable but get the error: "Cannot implicity convert type void to System.Collections.ArrayList" I am doing the following: ****BEGIN CODE****
11
2114
by: ThaRealneSS | last post by:
Hi. I have made a blackjack code and need a some help on it. It seems to work overall but there are a few bits here and there that need sorting out, and I'm kinda stuck on it so was wondering if I could get some help? (Would be HUGELY appreciated ) The things I need help are on: - Stopping the program going back to the code (you will know what I mean when you play it) - How to add the re-run code in it and where - How I can count...
0
9699
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10538
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
10305
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
10063
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9115
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...
0
5494
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...
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2966
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.