Our new Indie Games subforum is now open for business in G&T. Go and check it out, you might land a code for a free game. If you're developing an indie game and want to post about it, follow these directions. If you don't, he'll break your legs! Hahaha! Seriously though.
Our rules have been updated and given their own forum. Go and look at them! They are nice, and there may be new ones that you didn't know about! Hooray for rules! Hooray for The System! Hooray for Conforming!

FUCK YOU, MALLOC

2»

Posts

  • The Black HunterThe Black Hunter Registered User regular
    and we never saw him again...

    sig-1.jpg
  • nevilleneville The Worst Gay (Seriously. The Worst!)Registered User regular
    Defender wrote: »
    neville wrote: »
    Remember Defender, you need to free() what you malloc()

    :P

    Oh shit yeah I should totally find a way to free the NULL that malloc() is returning, or the exception that new throws. Yeah I should free/delete that shit right away!

    This is bullshit, I'm pulling out MSVC++ 6.0, let's see what this does...

    EDIT: And thank god I installed that to my F:\ instead of my C:\, since I can't find the CD anymore and I had to reformat last week.

    Yeah, my professor was talking about compiler differences a month or two ago.. explaining why for every project we do we have to compile it with THREE compilers. Any warnings from any (on highest level of warnings, mind you) = massive points off.

    I told my friend at MSFT and he said "Why? Visual Studio should be enough for anyone, it is the most standards compliant one around."
    Oh how the laughter did flow.

    nevillexmassig1.png
  • DefenderDefender Registered User regular
    neville wrote: »
    Defender wrote: »
    neville wrote: »
    Remember Defender, you need to free() what you malloc()

    :P

    Oh shit yeah I should totally find a way to free the NULL that malloc() is returning, or the exception that new throws. Yeah I should free/delete that shit right away!

    This is bullshit, I'm pulling out MSVC++ 6.0, let's see what this does...

    EDIT: And thank god I installed that to my F:\ instead of my C:\, since I can't find the CD anymore and I had to reformat last week.

    Yeah, my professor was talking about compiler differences a month or two ago.. explaining why for every project we do we have to compile it with THREE compilers. Any warnings from any (on highest level of warnings, mind you) = massive points off.

    I told my friend at MSFT and he said "Why? Visual Studio should be enough for anyone, it is the most standards compliant one around."
    Oh how the laughter did flow.

    Haha yeah that's a good one.

    UPDATE, FUCKERS: It compiles and runs JUST FUCKING FINE under MSVC++ 6.0 Pro (from 1998), but 8.0 (aka 2005, the Express version in this case) manages to make malloc and new crap themselves before I even hit 10 kilobytes of memory. Like I don't even load any game data, this is just dicking around in the startup routines where the crash happens. Oh, and while we're here? 6.0 recognizes that I had this thing bound to Perforce. 8.0 does not recognize any kind of source control for some fucking reason.

    FUCK THIS SHIT.

    Whatever, I guess I gotta use a retarded, ancient IDE for this. Either that or...maybe...maybe 8.0 stripped out some important libraries in the (automatic!) conversion process...hmm...

    hello massa, I jar jar binks
    I've overheard someone say "Don't say something is retarded, its not cool to make fun of retards. Just say its gay."
  • SenjutsuSenjutsu fiddy too Registered User regular
    Are you blowing over _HEAP_MAXREQ, maybe?

    Sarksus wrote: »
    I'm gonna get a PhD in incest.
  • Randall_FlaggRandall_Flagg Registered User
    if it helps, the other day i made a simple webpage in php and it compiled immediately and did exactly what i wanted it to

    yeah

    that helps

    thanks

  • DefenderDefender Registered User regular
    Senjutsu wrote: »
    Are you blowing over _HEAP_MAXREQ, maybe?

    Less than 10K has been allocated total before this thing craps the bed.

    In addition, when compiled under VC 6.0, the only difference being that I don't use "safe" versions of string-manipulation functions, the code runs perfectly.

    So I don't think I'm breaking any reasonable limits. I mean, this is even before I can do so much as load the main-menu graphics, like, this is REALLY early shit.

    EDIT: Thank you for the idea, though.

    hello massa, I jar jar binks
    I've overheard someone say "Don't say something is retarded, its not cool to make fun of retards. Just say its gay."
  • Randall_FlaggRandall_Flagg Registered User
    also, I doubt that tricorders use batteries

  • Cosmic SombreroCosmic Sombrero Registered User
    Larlar wrote: »
    Then we are at an impasse. I propose an underwear party to pass the time.

    Is that a party in our underwear or a party about underwear?

  • OrikaeshigitaeOrikaeshigitae Registered User, ClubPA regular
    if it helps, the other day i made a simple webpage in php and it compiled immediately and did exactly what i wanted it to

    yeah

    that helps

    thanks

    no problem, objectivist superstar randall_flagg

  • SenjutsuSenjutsu fiddy too Registered User regular
    doesn't make sense

    heap corruption issue that only crops up if the safe string functions are used is a hell of a thing

    Sarksus wrote: »
    I'm gonna get a PhD in incest.
  • DefenderDefender Registered User regular
    Senjutsu wrote: »
    doesn't make sense

    heap corruption issue that only crops up if the safe string functions are used is a hell of a thing

    And it's not even like all that many strings were even handled by that point! The best part is, this part of the code is like the one area I haven't touched, which means it was written by John Carmack. Which means, basically, FUCK YOU MSVC++ 2005 EXPRESS. FUUUUUUUCK YOOOOOUUUUUUU!

    I'll go back to 6.0 any day, as long as it works. I hate that the intellisense is broken as fuck, but I'll take 10-year-old broken "helper" features if it means that my goddamn code compiles to something that actually fucking runs.

    Plus I get to use P4 instead of SVN.

    EDIT: I'm not sure that the string functions are really the problem. That's the only thing I changed, like, in the code. But this is being compiled by a different application now...I suspect that the app itself is to blame.

    hello massa, I jar jar binks
    I've overheard someone say "Don't say something is retarded, its not cool to make fun of retards. Just say its gay."
  • SenjutsuSenjutsu fiddy too Registered User regular
    Yeah, at a guess I'd think that the app is doing something somewhere that ends up tapdancing some memory it shouldn't, but manages not to under VS6 through some combinations of bugs, standards (non)compliance, and sheer luck

    debugging it would drive a man insane

    Sarksus wrote: »
    I'm gonna get a PhD in incest.
  • OrikaeshigitaeOrikaeshigitae Registered User, ClubPA regular
    WRITTEN BY JOHN CARMACK EH

    WHAT STUDIO DO YOU WORK FOR AGAIN

  • Randall_FlaggRandall_Flagg Registered User
    if it helps, the other day i made a simple webpage in php and it compiled immediately and did exactly what i wanted it to

    yeah

    that helps

    thanks

    no problem, objectivist superstar randall_flagg

    dog

    why you gotta hurt me, dog

    I ain't ignant

  • DefenderDefender Registered User regular
    WRITTEN BY JOHN CARMACK EH

    WHAT STUDIO DO YOU WORK FOR AGAIN

    You ask that question as though I have given away some sort of clue as to where I work.

    hello massa, I jar jar binks
    I've overheard someone say "Don't say something is retarded, its not cool to make fun of retards. Just say its gay."
  • JaninJanin Registered User
    VS 2005 is full of bullshit. I refuse to use it because it actually declares standard C API functions as "unsafe".

    Have you tried pre-allocating a nice big chunk of memory at startup before calling into the third-party libraries, then using it for string formatting or whatever while debugging?

    [SIGPIC][/SIGPIC]
  • DefenderDefender Registered User regular
    Senjutsu wrote: »
    Yeah, at a guess I'd think that the app is doing something somewhere that ends up tapdancing some memory it shouldn't, but manages not to under VS6 through some combinations of bugs, standards (non)compliance, and sheer luck

    debugging it would drive a man insane

    Well, aside from watching it crash mysteriously, the debugging process isn't very long. Like I said, it doesn't get through its damn startup routine, so I've actually line-by-line'd this thing from start to finish/crash already.

    Now, going into greater depth would mean looking at the ASM code, but even that doesn't really help because "malloc" is a single line in the disassembly, and then the thing I'm watching turns to 0x00000000, which isn't giving me any real help.

    hello massa, I jar jar binks
    I've overheard someone say "Don't say something is retarded, its not cool to make fun of retards. Just say its gay."
  • JaninJanin Registered User
    Also if you can find a way to reduce the problem to a minimal set of code, and if that code happens to compile/run under Linux you can use Valgrind to debug it. Valgrind takes memory errors and crushes them.

    [SIGPIC][/SIGPIC]
  • DefenderDefender Registered User regular
    Janin wrote: »
    VS 2005 is full of bullshit. I refuse to use it because it actually declares standard C API functions as "unsafe".

    Have you tried pre-allocating a nice big chunk of memory at startup before calling into the third-party libraries, then using it for string formatting or whatever while debugging?

    I was actually seriously considering writing my own memory-allocation routine, but then I thought about it and was like "hold on, does this code still work under 6.0?"

    And it does. So for now, I am willing to regress to 6.0.

    Also, it is not actually shitting on me during string manipulation, it's doing it when I ask for memory via malloc or new. And like I said, I have this issue before I even hit 10K of memory. Now, if I allocate (and then immediately free) 50K of memory right in WinMain, it's totally cool with that. So I didn't somehow use up all my RAMs.

    hello massa, I jar jar binks
    I've overheard someone say "Don't say something is retarded, its not cool to make fun of retards. Just say its gay."
  • TenTen Registered User regular
    WRITTEN BY JOHN CARMACK EH

    WHAT STUDIO DO YOU WORK FOR AGAIN

    There must be hundreds of studios by now that are using code written directly by John Carmack. Didn't I hear there are still traces of his code in the Source engine?

  • JaninJanin Registered User
    Defender wrote: »
    Janin wrote: »
    VS 2005 is full of bullshit. I refuse to use it because it actually declares standard C API functions as "unsafe".

    Have you tried pre-allocating a nice big chunk of memory at startup before calling into the third-party libraries, then using it for string formatting or whatever while debugging?

    I was actually seriously considering writing my own memory-allocation routine, but then I thought about it and was like "hold on, does this code still work under 6.0?"

    And it does. So for now, I am willing to regress to 6.0.

    Also, it is not actually shitting on me during string manipulation, it's doing it when I ask for memory via malloc or new. And like I said, I have this issue before I even hit 10K of memory. Now, if I allocate (and then immediately free) 50K of memory right in WinMain, it's totally cool with that. So I didn't somehow use up all my RAMs.

    But 6.0 is such a terrible, terrible compiler.

    Have you considered using MinGW or 7.0?

    [SIGPIC][/SIGPIC]
  • DefenderDefender Registered User regular
    Ten0101 wrote: »
    WRITTEN BY JOHN CARMACK EH

    WHAT STUDIO DO YOU WORK FOR AGAIN

    There must be hundreds of studios by now that are using code written directly by John Carmack. Didn't I hear there are still traces of his code in the Source engine?

    Last time I checked, Q3 was the most popular licensed engine ever.

    For my money, it's the best game engine. (For its time, of course.)

    hello massa, I jar jar binks
    I've overheard someone say "Don't say something is retarded, its not cool to make fun of retards. Just say its gay."
  • OrikaeshigitaeOrikaeshigitae Registered User, ClubPA regular
    Ten0101 wrote: »
    WRITTEN BY JOHN CARMACK EH

    WHAT STUDIO DO YOU WORK FOR AGAIN

    There must be hundreds of studios by now that are using code written directly by John Carmack. Didn't I hear there are still traces of his code in the Source engine?

    no, i know

    i'm just poking fun at d-man

  • DefenderDefender Registered User regular
    Janin wrote: »
    Defender wrote: »
    Janin wrote: »
    VS 2005 is full of bullshit. I refuse to use it because it actually declares standard C API functions as "unsafe".

    Have you tried pre-allocating a nice big chunk of memory at startup before calling into the third-party libraries, then using it for string formatting or whatever while debugging?

    I was actually seriously considering writing my own memory-allocation routine, but then I thought about it and was like "hold on, does this code still work under 6.0?"

    And it does. So for now, I am willing to regress to 6.0.

    Also, it is not actually shitting on me during string manipulation, it's doing it when I ask for memory via malloc or new. And like I said, I have this issue before I even hit 10K of memory. Now, if I allocate (and then immediately free) 50K of memory right in WinMain, it's totally cool with that. So I didn't somehow use up all my RAMs.

    But 6.0 is such a terrible, terrible compiler.

    Have you considered using MinGW or 7.0?

    Hmmm 7.0? Well, as long as I can use my key bindings from 6.0, I may look into that...Intellisense was BETTER, though not really perfect, in 7.0.

    hello massa, I jar jar binks
    I've overheard someone say "Don't say something is retarded, its not cool to make fun of retards. Just say its gay."
  • DefenderDefender Registered User regular
    Ten0101 wrote: »
    WRITTEN BY JOHN CARMACK EH

    WHAT STUDIO DO YOU WORK FOR AGAIN

    There must be hundreds of studios by now that are using code written directly by John Carmack. Didn't I hear there are still traces of his code in the Source engine?

    no, i know

    i'm just poking fun at d-man

    John Carmack is my game development hero. I learned everything from him.

    hello massa, I jar jar binks
    I've overheard someone say "Don't say something is retarded, its not cool to make fun of retards. Just say its gay."
  • TenTen Registered User regular
    Ten0101 wrote: »
    WRITTEN BY JOHN CARMACK EH

    WHAT STUDIO DO YOU WORK FOR AGAIN

    There must be hundreds of studios by now that are using code written directly by John Carmack. Didn't I hear there are still traces of his code in the Source engine?

    no, i know

    i'm just poking fun at d-man

    Yeh, but I thought you were saying he'd given away a clue as to where he works... I think I might've missed the joke.

    I'll let you hardcore programmers get back to debugging assembler, I'll go back to my web and actionscript programming like the lowly dog that I am.

    :P

Sign In or Register to comment.