Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Writes to freed blocks detected
Writes to freed blocks detected [message #20050] Fri, 13 February 2009 17:22 Go to next message
darthspawn is currently offline  darthspawn
Messages: 58
Registered: February 2009
Member
I have this error:

PANIC: Writes to freed blocks detected

The project is a recorder that receive from a socket 300-400 string every second.

I don't know how to resolv this thing. Thank you!

Sam

Sorry, I wrong the section. Could a moderator move the topic? thanks!

[Updated on: Fri, 13 February 2009 17:24]

Report message to a moderator

Re: Writes to freed blocks detected [message #20067 is a reply to message #20050] Mon, 16 February 2009 09:02 Go to previous messageGo to next message
mr_ped is currently online  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
So you use some "new" somewhere in your code? Maybe you don't allocate enough memory, then you write beyond the end of buffer.
If you have some buffer allocated by "new", check if the size is correct, eventually add some safety checking upon write to it (simple assert for example).
Re: Writes to freed blocks detected [message #20068 is a reply to message #20050] Mon, 16 February 2009 09:14 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
darthspawn wrote on Fri, 13 February 2009 11:22

I have this error:

PANIC: Writes to freed blocks detected

The project is a recorder that receive from a socket 300-400 string every second.

I don't know how to resolv this thing. Thank you!

Sam

Sorry, I wrong the section. Could a moderator move the topic? thanks!


Well, it means what it says. Somewhere your code is writing to memory blocks that are already freed. In debug mode, U++ sets unique pattern to memory areas that are not allocated. During allocation this pattern is checked - if it is corrupted, it means that in the time between deallocation of block and its realocation, something has written a data to the block.

This might be result of either "dangling pointer" or some bulk routine going out of range (e.g. memset with wrong parameters).

You can get the first clue of what is wrong by checking the log - the data in wrong block are dumped there (Alt+L in TheIDE).

Mirek
Re: Writes to freed blocks detected [message #20070 is a reply to message #20068] Mon, 16 February 2009 10:47 Go to previous messageGo to next message
darthspawn is currently offline  darthspawn
Messages: 58
Registered: February 2009
Member
I think that the problem is the class socket that I use. I have tryed to use the u++ socket but I have some linking problem.. I don't understand why!


C:/Lavori/Kosmos/Vcc/KMarketRecord/main.cpp:10: undefined reference to `Upp::Socket::ReadUntil(char, int, int)'
C:/Lavori/Kosmos/Vcc/KMarketRecord/main.cpp:18: undefined reference to `Upp::Socket::Close(int)'

but in my code I don't use that function in that way!

ipsck_Socket->ReadUntil('\n');
ipsck_Socket->Close();

[Updated on: Mon, 16 February 2009 10:52]

Report message to a moderator

Re: Writes to freed blocks detected [message #20075 is a reply to message #20050] Mon, 16 February 2009 11:25 Go to previous message
darthspawn is currently offline  darthspawn
Messages: 58
Registered: February 2009
Member
Ok, I solved the problem! thanks to all for your reply!
Previous Topic: More GLCtrl
Next Topic: BarPane::GetPaneSize( b, INT_MAX ) fails?
Goto Forum:
  


Current Time: Thu Apr 25 23:29:32 CEST 2024

Total time taken to generate the page: 0.06335 seconds