Okay, this is in relation to my little 'MatAsm' project.

Now I am working on matrix multiplication. Now my problem is that at deinit time, when I am freeing my matrices, Kernel32 crashes my program in GlobalFree. To be specific it crashes when deallocating Matrix1, which is GlobalAlloc'ed as GMEM_FIXED for a size of 8, GlobalReAlloc'ed (as GMEM_MOVEABLE) once when loading it with data (at a size of 28), and GlobalReAlloc'ed again (still at a size of 28, but that shouldn't be a problem, right?) when manipulating the data in it (to be specific, it is Transposed).

These problems never occured before I attempted doing my matrix multiplication thing.

IMX Global* routines seem to generate problems for me quite often, but maybe there is just something I don't know about them. For instance, in my other recent project, the quine-mckluskey program, I kept getting problems when allocating memory using GlobalAlloc, and they always crashed when I got beyond the zeroth cube of implicants (I'm not making much sense here am I?). Yes I was using GlobalAlloc with GMEM_FIXED, allocating new memory areas as I created new implicants, no usage of GlobalReAlloc. Then when creating the first batch of implicants my OS (kernel32.dll) crashed at GlobalAlloc. It happened on Win98SE and a friend's WinXP. What I did then was to create a memory area in the .data? section and used my own routines to partition it, completely excising all Global** calls. However I cannot do something like that now in MatAsm since the matrices change in size every now and then.

Because it would be kinda difficult to dig through the macros, I have taken the liberty of having ml.exe preprocess it to me and am attaching the preprocessed output. Of course included into that output is the windows.inc and other stuff so the *real* code is in fact near the end of it.

I hope someone can get me some insight into this, my head is aching and I still don't understand the scaling functions of Daubechies' wavelets, I am calling it a day and I hope to look at it tommorow when my head is aching slightly less than now. I do hope that someone can point out to me just what my stupidity is though, maybe I should just screw all the Global** things and switch to Virtual*/Heap*, create my own wrappers? Quit doing MatAsm and stick to MatLab? Tell our department head I'd rather be doing OJT than a research paper? Delete all copies of MASM32 on all my computers and never program again?
Posted on 2003-03-27 01:35:53 by AmkG
okay, I have tried using Heap* functions by replacing Global** with my own wrapper functions for the thing. It still crashes at freeing time.

This is hell, you know.

Posted on 2003-03-28 00:55:32 by AmkG
Okay, you probably overwrite some data around the allocated block. Check your program's operation in a debugger.
Posted on 2003-03-29 15:00:06 by Sephiroth3