Click here to Skip to main content
15,905,566 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMFC Top Level menu position. Pin
Maximilien29-Apr-19 7:50
Maximilien29-Apr-19 7:50 
AnswerRe: MFC Top Level menu position. Pin
leon de boer1-May-19 0:13
leon de boer1-May-19 0:13 
QuestionImage display problem in listcontrol Pin
tianzhili439925-Apr-19 16:50
tianzhili439925-Apr-19 16:50 
AnswerRe: Image display problem in listcontrol Pin
Victor Nijegorodov25-Apr-19 21:07
Victor Nijegorodov25-Apr-19 21:07 
GeneralRe: Image display problem in listcontrol Pin
tianzhili439925-Apr-19 22:29
tianzhili439925-Apr-19 22:29 
GeneralRe: Image display problem in listcontrol Pin
Victor Nijegorodov26-Apr-19 2:03
Victor Nijegorodov26-Apr-19 2:03 
QuestionConversion from- C++ to C-language < free(): invalid size > Pin
zak10025-Apr-19 9:14
zak10025-Apr-19 9:14 
AnswerRe: Conversion from- C++ to C-language < free(): invalid size > Pin
k505425-Apr-19 10:05
mvek505425-Apr-19 10:05 
Something, somewhere is corrupting one of your malloc() blocks. First off, I count 5 calls to malloc(), but only 2 calls to free() in the code given. That's unlikely to be the source of your problem here, but it does mean you have a memory leak, unless that memory is freed up elsewhere.

Since you have 2 calls to free() and a hex stack dump, we don't know which free() is causing the problem. In order to get better data on where and why you have the corruption first compile your program with debug info enabled. Google suggests that you should be able to pass the -g flag to mpicc. You might also want to use the -o <file-name> option to write the output to file-name instead of a.out e.g. mpicc -g gaussian.c -o gaussian
There is an excellent tool to help debug memory allocation problems available for linux called valgrind. Once again a little googling about suggest that the way to run valgrind with mpirun is
mpirun -n 2 valgrind --tool=memcheck ./a.out
You may need to figure out how to install valgrind on your system.

Update: you can send the output from valgrind to a log file using --logfile=vg_log.%p, which would send the valgrind output to a file vg_log.1479, where 1479 is the process id of the running program. AIUI, you would get a vg_log.nnnn for each process spawned by mpirun. Take a look at the man page for valgrind and/or see the online documentation for further info.
AnswerRe: Conversion from- C++ to C-language < free(): invalid size > Pin
John R. Shaw26-Apr-19 9:19
John R. Shaw26-Apr-19 9:19 
GeneralRe: Conversion from- C++ to C-language < free(): invalid size > Pin
zak10026-Apr-19 10:22
zak10026-Apr-19 10:22 
GeneralRe: Conversion from- C++ to C-language < free(): invalid size > Pin
John R. Shaw26-Apr-19 12:31
John R. Shaw26-Apr-19 12:31 
GeneralRe: Conversion from- C++ to C-language < free(): invalid size > Pin
zak10026-Apr-19 14:57
zak10026-Apr-19 14:57 
GeneralRe: Conversion from- C++ to C-language < free(): invalid size > Pin
zak10026-Apr-19 17:53
zak10026-Apr-19 17:53 
GeneralRe: Conversion from- C++ to C-language < free(): invalid size > Pin
John R. Shaw30-Apr-19 4:56
John R. Shaw30-Apr-19 4:56 
GeneralRe: Conversion from- C++ to C-language < free(): invalid size > Pin
zak10030-Apr-19 5:48
zak10030-Apr-19 5:48 
QuestionPointer to Pointer: Conversion from- C++ to C-language Pin
zak10024-Apr-19 18:47
zak10024-Apr-19 18:47 
AnswerRe: Pointer to Pointer: Conversion from- C++ to C-language Pin
Victor Nijegorodov24-Apr-19 20:41
Victor Nijegorodov24-Apr-19 20:41 
GeneralRe: Pointer to Pointer: Conversion from- C++ to C-language Pin
leon de boer25-Apr-19 2:09
leon de boer25-Apr-19 2:09 
GeneralRe: Pointer to Pointer: Conversion from- C++ to C-language Pin
k505425-Apr-19 7:16
mvek505425-Apr-19 7:16 
GeneralRe: Pointer to Pointer: Conversion from- C++ to C-language Pin
Richard MacCutchan24-Apr-19 21:36
mveRichard MacCutchan24-Apr-19 21:36 
GeneralRe: Pointer to Pointer: Conversion from- C++ to C-language Pin
leon de boer25-Apr-19 2:04
leon de boer25-Apr-19 2:04 
GeneralRe: Pointer to Pointer: Conversion from- C++ to C-language Pin
Richard MacCutchan25-Apr-19 2:46
mveRichard MacCutchan25-Apr-19 2:46 
GeneralRe: Pointer to Pointer: Conversion from- C++ to C-language Pin
zak10025-Apr-19 6:52
zak10025-Apr-19 6:52 
GeneralRe: Pointer to Pointer: Conversion from- C++ to C-language Pin
Joe Woodbury29-Apr-19 6:38
professionalJoe Woodbury29-Apr-19 6:38 
GeneralRe: Pointer to Pointer: Conversion from- C++ to C-language Pin
leon de boer3-May-19 4:20
leon de boer3-May-19 4:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.