473,402 Members | 2,053 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,402 software developers and data experts.

The memory could not be read

Hi,
After successfull execution of my c++ exe there comes an error message like
'the instruction at 0x0034412c referenced memory at 0x3f92b818.The memory could not be read' . 3-4 times the message is coming after that only the exe will close. please help me ....
Aug 5 '08 #1
11 6060
r035198x
13,262 8TB
Any chance that we will see what the code looks like?
Aug 5 '08 #2
JosAH
11,448 Expert 8TB
Hi,
After successfull execution of my c++ exe there comes an error message like
'the instruction at 0x0034412c referenced memory at 0x3f92b818.The memory could not be read' . 3-4 times the message is coming after that only the exe will close. please help me ....
That is Microsoft's way of telling you that your program caused a segmentation
violation, i.e. your program tries to read from a memory location that doesn't
belong to the programs address space. Normally speaking: a bug because a
pointer is pointing into la-la-land.

kind regards,

Jos
Aug 5 '08 #3
Any chance that we will see what the code looks like?

This is a big project .. it is difficul to publish the code . The project consists of around 12-14 cpp files and around 20 more .h files .
Average lines per cpp file is around 4000 and average datasize per cpp file is 3000000.
what are the possible reasons making this problem?
Aug 5 '08 #4
That is Microsoft's way of telling you that your program caused a segmentation
violation, i.e. your program tries to read from a memory location that doesn't
belong to the programs address space. Normally speaking: a bug because a
pointer is pointing into la-la-land.

kind regards,

Jos
thanks Jos...
Is there any way to find out where the memory problem happening in the code . Or is there any way to suppress the error message . any Garbage collector function available for c++.
Aug 5 '08 #5
r035198x
13,262 8TB
thanks Jos...
Is there any way to find out where the memory problem happening in the code . Or is there any way to suppress the error message . any Garbage collector function available for c++.
Perhaps you could debug it to find at which point the error is being thrown?
Aug 5 '08 #6
JosAH
11,448 Expert 8TB
Perhaps you could debug it to find at which point the error is being thrown?
The (fatal) error message even told the location of the instruction that caused
it: 0x34412c; all you need is a linker map and check which function that
instruction is in (another reason to keep your functions small ;-)

kind regards,

Jos
Aug 5 '08 #7
weaknessforcats
9,208 Expert Mod 8TB
The (fatal) error message even told the location of the instruction that caused
it: 0x34412c; all you need is a linker map and check which function that
instruction is in (another reason to keep your functions small ;-)
True. But that may not be the cause of the error. It is likely somewhere else where the addresses are getting screwed up.

To the OP:
Have you used a product like BoundsChecker on this code?
Aug 5 '08 #8
JosAH
11,448 Expert 8TB
True. But that may not be the cause of the error. It is likely somewhere else where the addresses are getting screwed up.
Also true but at least you have a starting point so you can search 'upwards', i.e.
towards the callers of that function. There are indeed quite a few programs that
can do that for you.

kind regards,

Jos
Aug 5 '08 #9
Perhaps you could debug it to find at which point the error is being thrown?
debugging is not giving me any errors . It is working fine till the last line of the code . This happens whle quitting the programe.In debug mode when returning to the main function we can see the programme is stepping into the following functions

template <class T,class Alloc> void TMListImp<T,Alloc>::DoFlush( int del )

2) template <class T,class Alloc>
TMListBlockInitializer<T,Alloc>::~TMListBlockIniti alizer()
these two functions are a part of c:\bc5\include\classlib\listimp.h
Aug 6 '08 #10
The (fatal) error message even told the location of the instruction that caused
it: 0x34412c; all you need is a linker map and check which function that
instruction is in (another reason to keep your functions small ;-)

kind regards,

Jos
it would be very helpfull to me if you could expalin me how to do the linker map. I doesn't know anything regarding that. Can you please?
Aug 6 '08 #11
JosAH
11,448 Expert 8TB
it would be very helpfull to me if you could expalin me how to do the linker map. I doesn't know anything regarding that. Can you please?
It's been ages since I used that MS linker ... type "link /help" and see which
flag makes the linker produce a map file. If I remember well it's simply the "/map"
flag followed by a file name. When the linker is finished check the map for that
particular address and see in which function that instruction is located.
But of course the best thing is to RTFM.

kind regards,

Jos
Aug 6 '08 #12

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

Similar topics

0
by: Andreas Suurkuusk | last post by:
Hi, I just noticed your post in the "C# memory problem: no end for our problem?" thread. In the post you implied that I do not how the garbage collector works and that I mislead people. Since...
3
by: Ian Taite | last post by:
Hello, I'm exploring why one of my C# .NET apps has "high" memory usage, and whether I can reduce the memory usage. I have an app that wakes up and processes text files into a database...
6
by: Ganesan selvaraj | last post by:
I using C# .net. i want to split the text files based of the some condition. my source text file size may be 4 kb to 4 gb. some time when i split the i got the "out of memory exception. when i...
8
by: vikram | last post by:
i have series of questions 1.How a c program is loaded in memory i mean the whats is the structure that the code segment?? data segment?? 2.When you say const int *p; where is p...
72
by: ravi | last post by:
I have a situation where i want to free the memory pointed by a pointer, only if it is not freed already. Is there a way to know whether the memory is freed or not?
18
by: jacob navia | last post by:
In C, we have read-only memory (const), read/write memory (normal data), and write only memory. Let's look at the third one in more detail. Write only memory is a piece of RAM that can only...
8
by: clsmyth | last post by:
Folks, Hi, I have never posted to a language group before so please excuse me if this is inappropriate. I have posted this to comp.unix.solaris (well, I am one of the folks on the thread at...
31
by: William Stacey [MVP] | last post by:
Here is an interesting writing on memory barriers. Not sure if this helps my understanding or raises more questions, but interesting... ...
66
by: Johan Tibell | last post by:
I've written a piece of code that uses sockets a lot (I know that sockets aren't portable C, this is not a question about sockets per se). Much of my code ended up looking like this: if...
3
by: KWienhold | last post by:
I'm currently writing an application (using Visual Studio 2003 SP1 and C#) that stores files and additional information in a single compound file using IStorage/IStream. Since files in a compound...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
0
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...

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.