Strange Malfunction

  • cyberdragon
    8th Jul 2013 Member 0 Permalink

    I don't know what to think but "WHAT THE @#$% ?!" For some reason my mod is actively self destructing, elements are failing everywhere, please give a diagnosis.

     

    https://github.com/cyberdragon442/Mythical-Mod

     

     

    Please help. PLEASE!

  • cyberdragon
    9th Jul 2013 Member 0 Permalink

    I FOUND THE CAUSE! (I rapidly smacked keys untill it bluescreened then ran a debug) This is result:

     

    Unhandled exception at 0x77B23792 (ntdll.dll) in Mythical Mod.exe: 0xC0000005: Access violation reading location 0x00000D01.

  • candorgen
    9th Jul 2013 Member 0 Permalink

    Yes, makes perfect sense to me 

    *sarcasm*

    Whatever went wrong, I hope somebody (not me) fixes this problem.

  • cyberdragon
    9th Jul 2013 Member 0 Permalink

    EUREKA! I tried to replicate the crash so I pressed keys in alphabetical order. It crashed at "mnop".

     

     

    EDIT: OH S***!

     

    Unhandled exception at 0x77BBE6C3 (ntdll.dll) in Mythical Mod.exe: 0xC0000374: A heap has been corrupted (parameters: 0x77BF4268).

     

    in "ntdll.pdb" (whatever that is)

     

    EDIT: Confirmed that pressing "P" crashes it.

  • jacob1
    10th Jul 2013 Developer 0 Permalink
    i'm not going to dig through your entire source code to find what you broke with taking screenshots ...

    I would suggest getting a debugger, and disabling bluescreens (something I haven't done yet for visual studio but should). If you don't know how to disable them, it's in PowderToySDL.cpp, something with some function called Signal or something in main() ? I would just look there and you'll find it. Once you disable it the debugger will tell you where it's crashing.


    P.S., "Unhandled exception at 0x77B23792 (ntdll.dll) in Mythical Mod.exe: 0xC0000005: Access violation reading location 0x00000D01." is virtually useless, doesn't describe the crash at all
  • cyberdragon
    10th Jul 2013 Member 0 Permalink

    void SigHandler()...all gone. :)

     

    It said: Mythical Mod.exe has triggered a breakpoint. 

     

    here, in malloc.c:

     

    if (size <= _HEAP_MAXREQ) {
    for (;;) {

    res = _heap_alloc(size); // here

     

    and this: 

     

    Unhandled exception at 0x77BBE6C3 (ntdll.dll) in Mythical Mod.exe: 0xC0000374: A heap has been corrupted (parameters: 0x77BF4268).

     

     

    OH, and those broken elements, all run from "switch() case:" functions elsewhere, but only some of the cases are broken while the rest work. O_o

     

    As PewDiePie says: "What da hewl?!"

     

    EDIT: "IT WAS THE BARRELS!" :P

  • jacob1
    10th Jul 2013 Developer 0 Permalink
    what? ...

    what is is trying to malloc that's causing the crash then? Are you just using a horrible computer with no RAM?

    Also whatever you mean about switch(), nothing is broken with that, it's fine. The debugger doesn't always stop at breakpoints correctly due to things like optimization or other reasons.
  • cyberdragon
    10th Jul 2013 Member 0 Permalink

    Oh...compiler needs to update. Maybe that will fix it.

     

     

    EDIT: I FIXED THE GOD D*** MOTHER-F***ER! It was attempting to double link. 

     

    EDIT: NO! F***ER! STOP TRYING TO DOUBLE LINK! YOU'RE GOING TO BLOW OUT MY MEMORY! NO! #$%&!!!