Author Topic: Global/Heap  (Read 4389 times)

shankle

  • Member
  • ****
  • Posts: 840
Global/Heap
« on: March 03, 2015, 09:26:41 PM »
Have some programs that have been tested and seem to work fine in 64-bit versions.
Then at a later time they fail. Microsoft's error code "c0000374".

I'm guessing but I think it involves the use of Global instructions for the Heap Manager.
Maybe there is a problem in using those instructions with 64-bit programs?
I have been leery of using the Heap instructions for that function due to the difficulty
of using them.
Again these same programs work fine in MASM32 and I wonder if 64-bit versions cause
this problem.

Also getting Microsoft's error code "c0000005" in different 64-bit programs but not sure
if it's related to my above problems.

Yuri

  • Member
  • **
  • Posts: 175
Re: Global/Heap
« Reply #1 on: March 03, 2015, 11:01:18 PM »
I have never had any such error on x64 with GlobalAlloc/Free if you mean these.

shankle

  • Member
  • ****
  • Posts: 840
Re: Global/Heap
« Reply #2 on: March 04, 2015, 05:29:08 AM »
Thanks Yuri,
At least I now know to look elsewhere for my error.
Regards,
Jack

rrr314159

  • Member
  • *****
  • Posts: 1382
Re: Global/Heap
« Reply #3 on: March 04, 2015, 08:04:05 AM »
same as Yuri, "I have never had any such error on x64 with GlobalAlloc/Free" but since the error specifically refers to Heap Overrun seems it must be related. I do, however get c0000005 a lot when converting 32 to 64; usually my memory pointer (rdi, say) is 0. It happens because I had to change the pointers quite a lot going 32-64 and made a mistake doing so.

I also got c0000005 in relation to GlobalAlloc; not because there's anything wrong with it, but again, I made errors converting, and was trying to access outside the allocated block. Thinking (as u suspect) there was something wrong with alloc'ed mem, in desperation I converted all my alloc'ed blocks to uninitialized memory (data?) and cured the problem! So if it's convenient u might try that; can be easier to keep track of things that way. Later I went back to alloc'ed mem; was easy enough now, because I was starting with a stable program.

BTW I was converting many thousands of lines, so pointer mistakes were more or less inevitable; if you're dealing with much smaller progs u can probably see at a glance that your pointers are all right, so my experiences might not be applicable.
I am NaN ;)

shankle

  • Member
  • ****
  • Posts: 840
Re: Global/Heap
« Reply #4 on: March 04, 2015, 11:38:50 AM »
Thank you RRR for your informative answer.
Yes the darned pointers can get out of hand.
For me it's very hard to debug with no debugger.

I remember the guy in your avatar in a program many years ago where
he found himself in a retirement home for agents. And he was always looking
for #!. I never found out how it ended.

rrr314159

  • Member
  • *****
  • Posts: 1382
Re: Global/Heap
« Reply #5 on: March 05, 2015, 03:25:08 AM »
shankle, why don't u use windbg? Free download from M$

It ended abruptly when the network axed "The Prisoner" because only thoughtful people watched it; too few of us, plus we don't believe commercials. It was replaced by "My Wife is a Car"
I am NaN ;)

FORTRANS

  • Member
  • *****
  • Posts: 1062
Re: Global/Heap
« Reply #6 on: March 05, 2015, 07:55:36 AM »
Hi,

I remember the guy in your avatar in a program many years ago where
he found himself in a retirement home for agents. And he was always looking
for #!. I never found out how it ended.

   Well, it ended with two episodes that had a sort of farce going
on.  Some questions posed in the series got answered in what
appeared to be an abrupt manner.  And the wonks got to comment
on the series and expound their ideas.

Cheers,

Steve N.

dedndave

  • Member
  • *****
  • Posts: 8825
  • Still using Abacus 2.0
    • DednDave
Re: Global/Heap
« Reply #7 on: March 05, 2015, 11:05:13 AM »
Danger Man 1960-1961
Secret Agent 1964-1967 - this is the one i remember him for   :biggrin:
The Prisoner 1967-1968
Rafferty 1977

remember the song by Johnny Rivers ?
https://www.youtube.com/watch?v=bG0u3-Gbu88

Quote
It was replaced by "My Wife is a Car"

 :lol:
i think you mean, "My Mother the Car"


rrr314159

  • Member
  • *****
  • Posts: 1382
Re: Global/Heap
« Reply #8 on: March 05, 2015, 03:00:18 PM »
Do I remember "Secret Agent Man" by Johnny Rivers!?! Is the Pope Catholic? "They've given you a number, and taken way your name ..."

"My Mother the Car" wasn't mindless enough, I felt, to put my point across with the proper punch, so I made up my own imaginary title. U call it a mistake, I call it poetic license
I am NaN ;)

dedndave

  • Member
  • *****
  • Posts: 8825
  • Still using Abacus 2.0
    • DednDave
Re: Global/Heap
« Reply #9 on: March 06, 2015, 12:58:30 AM »
it was a stupid series - lol
but, i was a little kid, stupid was ok

they had a couple other series at that time that i liked - that also got canceled
one was "The Second Hundred Years"

http://www.imdb.com/title/tt0061293/

another was "The Monroes"

http://www.imdb.com/title/tt0060011/

i had a big ole' crush on a young Barbara Hershey   :P

both of them only ran for 1 season   :(