C/C++ :: 64bit Application Crashes Due To Unknown Memory Corruption In Linux

Dec 15, 2012

The application that I ported from 32 bit linux to 64 bit linux is crashing due to unknown memory corruption Also some time teh address is printed in 32 bit only as below

this=0x6787e0

any reason why this is happening?

View 1 Replies


ADVERTISEMENT

C++ :: Memory Corruption In Clutter Gui App?

Mar 31, 2012

I wrote most of a gui using clutter, using tons of global variables.

Clutter has a function which you use to connect an event or action like a mouse click to a function, and lets you pass one user data variable to it.

I wanted to eliminate globals. So I put everything in a struc to pass to each function, and after a few hours of doing all of this, I thought I almost got it working, but it's not the case.

I have this in the main

Code:
for (int i=0; i < 8; ++i )
clutter_actor_add_action(MV_CL_GUI.Actor_Wav[i], MV_CL_GUI.Wav_Action[i]);

which causes an error attempted to read or write protected memory.

When I comment that line out, the gui at least comes up, but as soon as a mouse event launches a function, the program crashes and gives a Debug Assertion Failed...click retry.

Then it points to a line in dbgdel.cpp

Code:
/* get a pointer to memory block header */
pHead = pHdr(pUserData);
/* verify block type */
_ASSERTE(_BLOCK_TYPE_IS_VALID(pHead->nBlockUse));

Here is what my struct looks like.

Code:
struct Clutter_GUI {
string ProjectName;
ClutterActor *Actor_Enter_Source_Bar;
ClutterLayoutManager *Actor_Source_Directories_Box_Layout;
int Source_Row_Selected;
ClutterAction *Action_Track_Row_Rect[12];

[code]....

Except it has about 5 times as many variables in it. And I am accessing all of the members just using object dot member syntax.

here is an example of the functions used to connect functions to events or actions.

Code:
g_signal_connect ( MV_CL_GUI.Action_Root_Row_Rect[1], "clicked", G_CALLBACK (Root_Row_1_Clicked), &MV_CL_GUI);

The last parameter is the struct I am passing to the function.and my functions look like this.

Code:
void Root_Row_1_Clicked (Clutter_GUI_Object MV_CL_GUI) {...}

But when I launch a function not with g_signal_connect, I don't use the &,

Code:
play(MV_CL_GUI)

View 9 Replies View Related

C++ :: Correct Values Passed To The Pointers - Memory Corruption

Apr 26, 2012

My project is say that it has memory leaks. When I view it in the debugger, it shows the correct values being passed to the pointers.

Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
bool ConfigGetEntry( char *pcFile, char *pcNameMust, char* &pcResult ) {
char pcBuffer[ 512 ];

[Code] ....

Its saying that i have memory corrupting at..

Code:
if ( !ConfigGetEntry( pcFile, pcName, pcRet ) ) return _strdup( pcDefault );

Also is it normal to have a bad pointer then point data into it to then clear that of the bad pointer. To have valid data now in that pointer.

View 3 Replies View Related

C/C++ :: Opening Application From Another Linux Mac

Dec 15, 2014

I want to open an application A from another application B. By opening it, I don't want to open it within B. I found many ways to call an application from within another. However, what I want to do is open the other one(A) simultaneously. How can I achieve this? fork() and exec() seem to open A within B. I am developing a code for Linux and Mac.

View 7 Replies View Related

C++ :: Reads Process And Return Values From It - Application Crashes Because Of Buffer Size

Nov 11, 2014

I have an application that reads a process and return values from it. The problem it works fine with small processes but i have some processes that are about 1GB or even 2GB and when i try to read such big processes the application crashes. I'm trying to find a way to read the process memory in chunks of maximum 10 MB. The read code looks like:

Code:
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, entry.th32ProcessID);
unsigned char *p = NULL;
MEMORY_BASIC_INFORMATION info;
for (p = NULL; VirtualQueryEx(hProcess, p, &info, sizeof(info)) == sizeof(info); p += info.RegionSize)

[Code] ....

This reads the info.regionsize which can be as large as 100 MB. Is there any way to read it in chunks ?

View 12 Replies View Related

C++ :: Passing Unknown Arguments To Unknown Function

May 1, 2013

So I'm making setTimeout and setInterval functions.

I have this remember function (that is part of Timing class) which takes a function pointer and a void pointer, which are remembered in that object.

Another (timing) function of that object is called in every loop of the program and when specific time passes that function calls the remembered function whit the remembered void pointer as argument.

The problem is that the functions that need to be called require unknown multiple parameters, so what I need to do is make a new class that will store the needed arguments. I make the function that needs to be called and that storage object and pass pointers to them to my remember function, when the remembered function is called it stores the data from storage object in new variables and dose it's thing.

View 3 Replies View Related

C++ :: Filling Memory Causes Application Crash

Jul 5, 2012

I have a question about allocating 2MB memory then filling it...

@ Platform:
=> DOS, and application is compiled/linked via Watcom C + DOS32/A (...memory model is "flat" mode)

@ phenomenon:
1. I allocate 2M memory by calloc() function. Then I got "!NULL" and it means allocating 2MB memory is ok( right ? )
2. then I tried to "fill" this 2MB memory by for loop(one byte by one byte) like below:

for( DWORD i=0; i<0x200000; i++) {
*((BYTE *)(A[0].B[0]->C) + i ) = 0x5A; // C is 4-byte address value
}

here :
* DWORD means "unsigned long(4-byte)" and 0x200000 means "2MByte"
* in actual case the value of pointer(to allocated memory) is 3019AF3C(~768MB) <- running in flat mode...

3. after filling this range of memory(2MB) the application crashed...

@ my observations:
1. if allocating 2MB and no fill(no write data to memory) => OK
2. if allocating 2MB and just fill the former 32 bytes => OK
3. if allocating 4KB and fill all => OK

my question is: why can't I filling this 2M memory totally "even memory allocation succeeds" ?

View 5 Replies View Related

C++ :: Two Dimensional Array In Form Application - Memory Corrupt

Mar 9, 2013

I'm using C++ Form Application in Visual Studio 2010. I defined a new two dimentional array. like this "static int dizi[26][26];" I want to change the value when I clicked the button1. For example, I can change as dizi[2][3]=1. But I couldn't change like in this code. dizi[a][b]=1 didn't happen.

Error is... "access violation exception was unhandled. attempted to read or write protected memory. this is often an indication that other memory is corrupt."

for(int i=1;i<=26;i++){
uzunluk=0;
for(int uzun=1;uzun<=26;uzun++){
if(ogrenci[i].ders[uzun]!=0)
uzunluk+=1;
else break;

[Code] ....

I don't use zeroth variable here.So, It started from 1. My problem is variable can't be changed.I can't assign a value to variable. I have to use 'ogrenci[i].ders[j]'s index for dizi array in this code. It's really weird.

View 1 Replies View Related

C++ :: Shared Memory To Make Objects Of Application Persistent?

Aug 18, 2014

I have a question concerning shared memory (in linux-environment). In our company we currently have an application that is restarted once in a while. There are multiple instances running of this application (on different physical machines), and all access the same centralized database. Because of IO and Network bottleneck the start gets very slow, and takes about 10 Minutes. Besides some new data, most of the data stays the same, so reading from the database again is quite redundant. An idea is to write all relevant object to a shared memory segment, when the application is shut down. A second dummy process attaches to the same shared memory (just so that some process is still attached). If the application is restarted, it is attached again to its shared memory, and reads it to its own adress range again. There might occur a difference regarding the data so it might me necessary to load some new data afterwards, but that is different problem.

The current idea is to serialize all Objects (could be about 1-2 Gigabyte) with Apache Thrift, and write them into shared memory. With Thrift the data is more or less ordered, so creating the objects anew is possibly easier (not sure here).

My Question is:

- Does it even make sense to consider shared memory in this scenario. I've read a lot stuff about in the last few days, and for now I don't see big disadvantages (except if the application crashes, in this case I've to read from database again). On the other hand I don't know how to really implement this functionality (as I'm no experienced Developer)

- Should I aim for Boost::Interproces, considering even memory mappable files, or stay with the traditional shmat (and stuff..)?

- I guess 1-2 Gigabyte shared memory will be necessary. This amount is only needed in the gap between application shutdown and restart. Will the sheer amount of needed shared memory be a problem (all examples I found just used a few Bytes or Kilobytes)

View 9 Replies View Related

Visual C++ :: Enable Virtualization In 64bit Mfc App?

Dec 5, 2012

I have a version of an app in 64bit but the problem is under program files on windows 8 64bit it doesn't have access to the programs files folder... usually virtualization will redirect it to the virtual store but with 64bit exe's this doesn't happen automatically. How do I enable it in code or in the manifest file?

From MSDN:

Virtualization is only enabled for:

32 bit interactive processes
Administrator writeable file/folder and registry keys
Virtualization is disabled for:

64 bit processes
Non-interactive processes
Processes that impersonate
Kernel mode callers
Executables that have a requestedExecutionLevel

View 1 Replies View Related

C++ :: How To Define DWORD As Still 32-bit When Compiling Program In 64bit

Jan 7, 2014

#define DWORD ?

How to I write this statement?

In my program, the DWORDs are treated as unsigned long, so that They are 64-bit "DWORDs" instead of 32-bit ones...

View 5 Replies View Related

Visual C++ :: Utility To Check DLL Is 32bit Or 64bit?

Jul 25, 2013

I have two third party DLL files that I wanted to check if they are 32bit or 64. I searched the web and some suggested corflags, I found it under "C:Program Files (x86)Microsoft SDKsWindowsv7.0ABin" (my machine is 64bit but I didn't find the utility under "Program Files" folder), it came out with the message:

corflags : error CF007 : The specified file does not have a valid NT file header

Whats wrong with it?

View 4 Replies View Related

C++ :: Data Corruption In Vector

May 2, 2013

I have this code that is supposed to store numbers in one vector and another vector stores pointers to the values in the first vector:

#include <iostream>
#include <algorithm>
#include <sstream>
#include <cstring>
#include <vector>
#include <cstdio>

[Code] ....

However, when I print out the values stored by the pointer vector, the first 2 values are not the same as what the input was. I have tried it with 4 - 10 values and always, the first 2 are not the same as the input but the rest are. I tried printing out the values as they are stored in the vector in the first for-loop and it seems to contain them all, but after that first for-loop, when I try to print *station.front(), it is now changed to something else.

input:
4
1231 234354 4544343 121312

output:
34144320 0 4544343 121312

input:
6
123 2435 353 12221 356567 4544452

output:
21704768 0 353 12221 356567 4544452

View 9 Replies View Related

C++ :: Variable Array Corruption Error

Mar 17, 2014

I finished my project and it does work, but every time I hit enter to end the program I get an error that says my variable array is corrupted.

here is my code:

#include <iostream>
#include <ctime>
using namespace std;
int main() {
system ("color C");

[Code] ....

How could I stop this end error from occurring?

View 6 Replies View Related

Visual C++ :: MFC CRecordset Heap Corruption Detected At Close

Oct 28, 2013

I recently upgraded my operating system from Windows XP to Windows 7 SP1 64 bit. We are using Visual Studio 2008 Professional Edition and Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production.

When I try to execute this code I am getting the below exceptions

HTML Code:
try {
CDatabase *pDatabase = CDatabaseConnection::getDatabaseConnectionProcessLog();
ORSProcessLog rsProcessLog(pDatabase);

[Code] .....

Where rsProcessLog is the CRecordset object using a successfully connected database pointer pDatabase

In 32- bit Debug version I get a message box at rsProcessLog.Close(); with the below text Debug Error

Program: ......Test.exe

HEAP CORRUPTION DETECTED: after Normal block (#506) at 0x0087F628. CRT detected that the application wrote to memory after end of heap buffer.

Memory allocated at f:ddvctoolsvc7libsshipatlmfcsrcmfcdbcore.cpp(2626)

(Please Retry to debug the application)

In 32- bit Release version I get a message box at rsProcessLog.Close(); with the below text Windows has triggered a breakpoint in Test.exe

This may be due to a corruption of the heap, which indicates a bug in Test.exe or any of the DLLS it has loaded.

This may also be due to the user pressing F12 while Test.exe has focus.

The output window may have more diagnostic information.

The above code was a working code in Windows XP with the rest of the env remaining the same and it continues to run in Windows XP but not in Windows 7.

View 9 Replies View Related

Visual C++ :: Open QuickTime VR Image Into MFC Dialog - Heap Corruption?

May 17, 2013

I need to write a piece of code that opens a QuickTime VR image into an MFC Dialog. I drew a Dialog and put an "Apple QuickTime Control 2.0" into it. Then I created a Control variable in my Dialog class, called QtControl. In the OnInitDialog I set the file to open, calling the put_FileName of the control.

I tested it by:

- opening a dialog --> worked
- closing it --> worked
- opening again --> crashed. The error was:

"Windows has triggered a breakpoint in TestOcx.exe.

This may be due to a corruption of the heap, which indicates a bug in TestOcx.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while TestOcx.exe has focus.

The output window may have more diagnostic information."

I tried many things and googled a lot, but the only way that I found to avoid this crash was hardcoding a valid URL in the QtControl resources at compile time. In other words, if I write a valid absolute path to a .mov into the URL property of the QtControl from Visual Studio and compile it, then it works. Obviously, I can't do this because the absolute Path is valid only on my PC.

View 14 Replies View Related

C# :: Server Application Using Tcp Protocol And Then Establish Connection With A Client Application

Nov 29, 2014

What happens if I make a server application using tcp protocol and then establish connection with a client application but the server crash and then the client send data. Will the data be lost or the system will continue trying to send it?

View 2 Replies View Related

C# :: How To Start Application And Automatically Pass Input To That Application

May 9, 2012

I want to create an application that starts an application and passes input to that application. I know how to start a process using the classes in System.Diagnostics, but I don't know how to pass data to the process.

For example, and this is just an example, I would like to be able to automatically start an application that requires a username and password and automatically enter the username and password. Of course, that might open the door to security vulnerabilities, but that's not the point of the exercise.

How to implement the functionality I described? Is there a general way to go about doing this or does it depend entirely on the idiosyncrasies of the application in question?

View 2 Replies View Related

C Sharp :: Run Application When Log Off In Console Application

Oct 4, 2012

i have task scheduling application which execute every 30 minute i want to keep this process when system is log off in c# console application

View 2 Replies View Related

C++ :: Matrix With Unknown Dimension?

Feb 18, 2014

I try to write code for one problem which is worked with the matrix.I have written in specific size 5 by 5 and I know the general formula for these matrix based on dimension,I want to write a general form that take the matrix size and then create my favor matrix.However,when I write like below the following error is appeared

int m;
cin>>m;
int A[m][m];

Error: m must be constant

View 2 Replies View Related

C/C++ :: Unknown Type Name PGconn

Feb 27, 2015

I have the following code

#include <stdio.h>
#include <stdlib.h>
#include <postgresql/libpq-fe.h>

[Code].....

View 2 Replies View Related

C++ :: Cin And Unknown Number Of Integers

Dec 2, 2012

i dont usually write console programs, and i cant seem to find out how one parses an unknown number of arguments with cin.

the program receives an unknown amount of integers in stdin, and i need to parse them withouth hanging.

Unfortunately, stdin is a async. stream and blocks, if it doesnt find any integers left.

I cant use peek() or seek() either, as both are async, too, (which makes me wonder what their exact use is?).

View 3 Replies View Related

C :: Recursive Crashes Program?

May 13, 2014

cause I cant find why it crashes. It compiles without any error,but crushes when i run it and I can't find where is wrong the code.

Code:

#include <stdio.h>
#include <time.h>
#include <math.h>

[Code].....

View 7 Replies View Related

C++ :: Code Blocks Crashes When Try To Run

Jun 9, 2013

This has happened before, when I try to run a code it will say "blah.exe has stopped working" and I would have to change the code in some way to make it work.

View 1 Replies View Related

C :: Warning - Unknown Escape Sequence

Feb 2, 2013

I'm doing some file input/output work here in C and received this warning during compilation (GCC). My research indicates that this error is in response to white space or a character cancellation function or something like that. I'm not 100% sure exactly what it means. My code works fine, but the following warning does appear.

Code:
warning: unknown escape sequence: '40'

Here's my code (excluding a bunch of comments at the bottom of the file).

Code:
#include <stdio.h>
int main(void){
FILE *file;
file = fopen("Running Practice.c", "a");
fprintf(file, "Testing...
");
fclose(file);
}

I believe the error I received has to do with either the ' ' I used when appending text to my file, or something to do with there being a space in the file name itself.

View 6 Replies View Related

C :: Reading Files Of Unknown Size

Jan 23, 2013

I want my program to be able to read text files in the format:

number number
number number
number number...

and so on, so there are two columns of values. The problem I'm having is, there are a lot of numbers in the file, and it can vary. The program needs to read the numbers, put one column into one array, and the other in another, perform some operations on it all, and eventually pop out two different arrays. In other words, after I've got these arrays, I don't need them for much longer. I was hoping I could dynamically allocated some arrays to store the numbers and just free them as soon as I'm done with them.

If the file wasn't of such variable size or if it was guaranteed to be under a certain number of variables, I would have used:

Code:

while ( fscanf(input, "%lf %lf
", &col_1[], &col_2[]) == 2 )
{
no_rows++;
}

The problem is I want to allocate "no_rows" as the array size, which I don't have until after I have read the file.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved