473,322 Members | 1,431 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,322 software developers and data experts.

SIGTRAP during debugging

86
i m gettn a weird problem...my prog doesnt run smoothly and hangs whn run normal but it RUNS smoothly in debugnn mode...dunno how...

additionally it sends a SIGTRAP error...

warning:HEAP
warning:Heap block at 00032550 modified at 00032559 past requested size of 1

can sumone plain this...

shoudl i post my code here??....
Apr 15 '07 #1
22 5893
JosAH
11,448 Expert 8TB
i m gettn a weird problem...my prog doesnt run smoothly and hangs whn run normal but it RUNS smoothly in debugnn mode...dunno how...

additionally it sends a SIGTRAP error...

warning:HEAP
warning:Heap block at 00032550 modified at 00032559 past requested size of 1

can sumone plain this...

shoudl i post my code here??....
Please don't; it's buggy and I don't want to see buggy code. Run your code in
your debugger step by step and pay attention when that message is displayed.
At that particular line/statement your program had corrupted heap memory
by accessing/changing memory that doesn't belong to the process. In other
words: you've got a stray pointer somewhere. Let the debugger do its dirty deeds.

kind regards,

Jos
Apr 15 '07 #2
ayan4u
86
but i dnt understand why only in debuggn mode its works fine but not in normal mode....
Apr 15 '07 #3
JosAH
11,448 Expert 8TB
but i dnt understand why only in debuggn mode its works fine but not in normal mode....
Your debugger checks your heap for you. A heap is memory assigned to your
process from which your program allocates dynamic memory. Memory that
belongs to the heap but isn't allocated by your program should not be accessed
by your program. Have a look again at that debugger warning:
Expand|Select|Wrap|Line Numbers
  1. warning:Heap block at 00032550 modified at 00032559 past requested size of 1
It is trying to tell you that your program has allocated a small block of memory
(size 1) at address00032550 but it is trying to access memory at address
00032559 and that memory doesn't belong to your program.

If your program is running standalone, i.e. without a debugger, it makes the same
mistake but there's noone around to protect your program so it'll strangle and
kill itself in a most miserable way.

kind regards,

Jos
Apr 15 '07 #4
ayan4u
86
thnx fot tht xplanation of warning:HEAP....i was so so much confused abt it...

so ur telln tht f my prog is n debug mode thn it will neway able to access tht piece of memory in heap tht doesnt belong to it.....


one more thng....

suppose i have a class bricks and want to dynamically allocate objects for brick...i dnt kno before hand how much instance of brick i must make....

like if i kno tht i want 5 instance of bricks (runtime) i could have used

Bricks* ob_brick =new Brick[5];

but ths s not the case coz thn i wont able change the number of object...if i need more...
Apr 15 '07 #5
JosAH
11,448 Expert 8TB
thnx fot tht xplanation of warning:HEAP....i was so so much confused abt it...

so ur telln tht f my prog is n debug mode thn it will neway able to access tht piece of memory in heap tht doesnt belong to it.....


one more thng....

suppose i have a class bricks and want to dynamically allocate objects for brick...i dnt kno before hand how much instance of brick i must make....

like if i kno tht i want 5 instance of bricks (runtime) i could have used

Bricks* ob_brick =new Brick[5];

but ths s not the case coz thn i wont able change the number of object...if i need more...
Maybe a vector<Brick> is the solution?

Please don't write using so many SMS speak acronyms and words. It's hardly
readable that way. Please spell out all the words. This is an international forum
using English as the Lingua Franca and many readers (I'm one of them) don't
speak English as their native language; thanks.

kind regards,

Jos
Apr 15 '07 #6
ayan4u
86
ok next time i will keep that in mind....

and another thing...can't we do this without using STL.....i.e., to say is STL the only way to do so...
Apr 16 '07 #7
ayan4u
86
can u please explain what this means...

warning:HEAP
warning:Invalid address specified to RtlFreeHeap(00030000, 00032560)

00032560 is the address of first object of a total of 3 objects......how can it be invalid.....
Apr 16 '07 #8
JosAH
11,448 Expert 8TB
can u please explain what this means...

warning:HEAP
warning:Invalid address specified to RtlFreeHeap(00030000, 00032560)

00032560 is the address of first object of a total of 3 objects......how can it be invalid.....
Did you use the "delete" operator instead of the "delete[]" operator?

kind regards,

Jos
Apr 16 '07 #9
ayan4u
86
loll.. yah ... i fugured it out before but can't remove my silly comment then as this forum doesnt provide such facility....

i know i was silly...


neways i am waiting for a reply for my previous querry....

tht whetr can i implement what i want(read above) without using STL(vector) because then i would have to make a lot of changes....
Apr 16 '07 #10
JosAH
11,448 Expert 8TB
loll.. yah ... i fugured it out before but can't remove my silly comment then as this forum doesnt provide such facility....

i know i was silly...
You do realize that you have quite a smart debugger at your fingertips don't you?

neways i am waiting for a reply for my previous querry....

tht whetr can i implement what i want(read above) without using STL(vector) because then i would have to make a lot of changes....
No you don't: the vector<T> class has (among others) the operator[] overloaded
so textually it looks like an array by all means. Except that you don't have to
worry anymore about the size of your arrays (too small? too many elements?)
It's been taken care of by the vector class template.

kind regards,

Jos

ps. Please don't write in SMS speak; it's hardly readable.
Apr 16 '07 #11
ayan4u
86
all right i am in process of implementing vector in my prog( but really i have to make a lot of changes)....

and again am i still using SMS lingo....i am trying hard to overcome it.....sorry for any inconvinience...
Apr 16 '07 #12
ayan4u
86
ok i used vector container and accomplished my project(somehow) with one problem....since i am giving the user the lberty to make as many objects he likes i am using a loop...say..
Expand|Select|Wrap|Line Numbers
  1. vector<Brick> brick;
  2. int count =0;
  3. char continue ='y';
  4. while (continue =='y')
  5. {
  6.     // initializing data members and creating object
  7.        brick[count].push_back(Brick());
  8.  
  9.     //where input_details() is a function member       
  10.       brick[count].input_details(); 
  11.  
  12.      cout<<"Continue :";
  13.      cin>>continue;
  14.  
  15.       if(continue =='y')  // If user agrees to continue prepare for new object
  16.      count++;
  17. }
  18.  
now the problem is as the scope of my objects are within the loop destructors will be called as soon as loop ends...so thrs any way round to bypass this problem...

Regards,
ayan
Apr 17 '07 #13
JosAH
11,448 Expert 8TB
ok i used vector container and accomplished my project(somehow) with one problem....since i am giving the user the lberty to make as many objects he likes i am using a loop...say..
Expand|Select|Wrap|Line Numbers
  1. vector<Brick> brick;
  2. int count =0;
  3. char continue ='y';
  4. while (continue =='y')
  5. {
  6.     // initializing data members and creating object
  7.        brick[count].push_back(Brick());
  8.  
  9.     //where input_details() is a function member       
  10.       brick[count].input_details(); 
  11.  
  12.      cout<<"Continue :";
  13.      cin>>continue;
  14.  
  15.       if(continue =='y')  // If user agrees to continue prepare for new object
  16.      count++;
  17. }
  18.  
now the problem is as the scope of my objects are within the loop destructors will be called as soon as loop ends...so thrs any way round to bypass this problem...

Regards,
ayan
My guess is that you made that code snippet up as you typed: "continue" is
not a valid identifier name and you don't invok the push_back method on an
element of a vector but on the vector<Brick> itself. Please rephrase your
question, it's my psychic day off today.

kind regards,

Jos
Apr 17 '07 #14
ayan4u
86
would u kindly make ur doubt about tht code snippet much clearer.....i thnk i have presented my querries quite OK.....
Apr 17 '07 #15
JosAH
11,448 Expert 8TB
would u kindly make ur doubt about tht code snippet much clearer.....i thnk i have presented my querries quite OK.....
Did you try to compile your code snippet? My guess is you didn't. We're not
supposed to be able to 'read between the lines' especially not when it comes
to something as exact as program source code. Please be more careful
about the code snippets you post. We can read what you wrote, not what
you thought.

kind regards,

Jos
Apr 17 '07 #16
ayan4u
86
Did you try to compile your code snippet? My guess is you didn't. We're not
supposed to be able to 'read between the lines' especially not when it comes
to something as exact as program source code. Please be more careful
about the code snippets you post. We can read what you wrote, not what
you thought.

kind regards,

Jos

ya i did and it compiled well without compilation error....but the problem lies with the destructor....as the objects are localised within an inner scope...

as far as the code is concernd if u like i can post the entire code itself....
Apr 17 '07 #17
JosAH
11,448 Expert 8TB
ya i did and it compiled well without compilation error
I don't believe that: an identifier cannot be named 'continue'. Your compiler must've
protested against that.

kind regards,

Jos
Apr 17 '07 #18
ayan4u
86
I don't believe that: an identifier cannot be named 'continue'. Your compiler must've
protested against that.

kind regards,

Jos
wat the hell u are talking about....continue is a legal identifier in my prog as i declared it as char and initialized to 'y'......look carefully...
Apr 17 '07 #19
JosAH
11,448 Expert 8TB
wat the hell u are talking about....continue is a legal identifier in my prog as i declared it as char and initialized to 'y'......look carefully...
I'm not talking about anything "what the hell". The name "continue' is a reserved
word in C, C++, Objective C, Java and I guess C# too; it won't compile as an
identifier name period.

Jos
Apr 17 '07 #20
ayan4u
86
ooh i mean continue as _continue....sorry a lot if tht buggd you....
Apr 17 '07 #21
ayan4u
86
thnx for giving this topic a meaning ful heading.....So now can we be back to our discussion.....
Apr 18 '07 #22
ayan4u
86
just giving a bump....so no one interested in continuing this topic.....
Apr 18 '07 #23

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: pantichd | last post by:
<I also posted this on microsoft.public.vsnet.debugging 'cuz I didn't know which was more appropriate or would get quickest response> Hello, Can someone tell me how I can view the contents...
2
by: andand | last post by:
Hi, I have a C# user defined control that I want to place in a form. When I drag it into the form it generates an exception (it works okay if I add the control manually in the code, compile and...
1
by: William Sullivan | last post by:
I was wondering... Are there attributes you can use to mark accessors/variables that will identify them as to be shown when hovering over an instance of the containing object during debugging? As...
1
by: Welman Jordan | last post by:
When I debug an asp.net application, which would consume a considerable amount of memory, the application throws "unhandled exception" and delivers a 500 error page to the browser. I find that...
0
by: John Rivers | last post by:
Hello, When I press F5 to start debugging an ASP.NET application it takes around 6 to 12 seconds before my code actually executes. During most of this time the CPU usage of devenv.exe hits...
3
by: jsh02_nova | last post by:
During debugging a console application using my Visual Studio, I have an instance of a string reference type that I want to watch. When I check the value of a property for that instance, such as...
1
by: Ryan | last post by:
Is there any way to view what data is populating my DataSet tables during debugging? Thanks, Ryan
2
by: JM | last post by:
Hi, I used to chage my code during debugging with Visual Studio 2003 (I just stopped the code using a break point and VS2003 allowed me to change the code, and continue debugging), but now with...
2
by: dissectcode | last post by:
Hello - I am new to this and started a new job; and for now I am in charge of debugging everyone's C code. Can you please tell me the proper way to comment during this debugging process? Should...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.