Author Topic: Worst bug you had?  (Read 86197 times)

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Worst bug you had?
« Reply #30 on: August 09, 2008, 12:45:32 PM »
I guess the reason for my buffer overruns was the "secure" version of sprintf (sprintf_s) in MSVC which in fact was overwriting memory with hex FC. This was because the secure version first clears the buffer size with FC. (or FA, don't remember exactly). I actually saw those mysterious FC's appearing in data when debugging and I wondered a long time where the heck they were coming. So then I replaced every secure version with old school sprintf and the random crashes went away. It's possible that sprintf may cause buffer overruns, but I have to check them later and maybe write a manual overrun check just to be sure.

Also I try to use std::string when possible.

corremn

  • Rogueliker
  • ***
  • Posts: 700
  • Karma: +0/-0
  • SewerJack Extraordinaire
    • View Profile
    • Demise RogueLike Games
Re: Worst bug you had?
« Reply #31 on: August 10, 2008, 10:35:21 AM »
I guess the reason for my buffer overruns was the "secure" version of sprintf (sprintf_s) in MSVC which in fact was overwriting memory with hex FC. This was because the secure version first clears the buffer size with FC. (or FA, don't remember exactly). I actually saw those mysterious FC's appearing in data when debugging and I wondered a long time where the heck they were coming. So then I replaced every secure version with old school sprintf and the random crashes went away. It's possible that sprintf may cause buffer overruns, but I have to check them later and maybe write a manual overrun check just to be sure.

Also I try to use std::string when possible.

I try to use streams for things like this, but I find it so much quicker to use c code.  As long as you know what you are doing ignore the secure versions and switch off the warning message.
corremn's Roguelikes. To admit defeat is to blaspheme against the Emperor.  Warhammer 40000 the Roguelike

Nathan Stoddard

  • Newcomer
  • Posts: 9
  • Karma: +0/-0
    • View Profile
    • My website
    • Email
Re: Worst bug you had?
« Reply #32 on: December 23, 2008, 05:56:53 PM »
The weirdest bug I've had is in the hexagonal roguelike I'm making. Whenever the display is smaller than the dungeon (so part of it wraps around), you can't use any uppercase commands. I think the uppercase letters are getting converted to lowercase. When you save and reload the game, it's fine.

I have absolutely no idea what is causing this.

Gamer_2k4

  • Rogueliker
  • ***
  • Posts: 86
  • Karma: +0/-0
    • View Profile
Re: Worst bug you had?
« Reply #33 on: December 25, 2008, 02:00:15 AM »
My most obscure big was one where the player lost hitpoints inexplicably from time to time.  Turned out I left a pointer to the player on the stairs when he left a level, so the monsters could still attack that.  It was only a lucky guess that found it for me.
Gamer_2k4

Nathan Stoddard

  • Newcomer
  • Posts: 9
  • Karma: +0/-0
    • View Profile
    • My website
    • Email
Re: Worst bug you had?
« Reply #34 on: December 25, 2008, 08:57:07 PM »
I got another weird bug. When I told my game to not generate any enemies, it generated exactly one rat and one gnoll. This was due to me forgetting to initialize a variable.

JoshuaSmyth

  • Newcomer
  • Posts: 32
  • Karma: +0/-0
    • View Profile
    • Email
Re: Worst bug you had?
« Reply #35 on: January 10, 2009, 05:33:08 PM »
I had a bug once when I was learning some DirectX 7 stuff that would reset my computer!

If I remember correctly I was sending malformed information into the index buffer. That was a real painfull once to fix.
www.tinyfrogsoftware.com <- Browser based Roguelike

corremn

  • Rogueliker
  • ***
  • Posts: 700
  • Karma: +0/-0
  • SewerJack Extraordinaire
    • View Profile
    • Demise RogueLike Games
Re: Worst bug you had?
« Reply #36 on: January 12, 2009, 01:08:04 AM »
While not exactly a coding bug....

I just tried to merge two partitions on my harddrive, and of course it crashed halfway through, leaving me with one original partition and two missing ones. Of course the missing ones contained my digital photo collection and about 10  semi-edited videos of home movies.  (that I of course have not backed up)

Anyway in the process of finding some software to repair my file partition table I downloaded about 50 viruses, trojens and malware.  I somehow found my photo partition and recovered it but my video partition is gone bye bye. I guess I can recover the files using some software but that means I need a new harddrive to dump it to. Not a bad idea because windows is now screwy thanks to the viruses.  It wont let me reinstall windows as I get a random error.  Internet Explorer has been hyjacked and a lot of google pages wont show up at all or a redirected.  My expensive (but free) virus scanner hasn't yet found every thing and I cant install spybot for some reason. 

Like I said not exactly a bug...

Fun stuff, thanks you very much partition magic!
corremn's Roguelikes. To admit defeat is to blaspheme against the Emperor.  Warhammer 40000 the Roguelike

Scautura

  • Rogueliker
  • ***
  • Posts: 55
  • Karma: +0/-0
    • View Profile
    • CyberRogue
    • Email
Re: Worst bug you had?
« Reply #37 on: January 12, 2009, 08:51:00 AM »
You might want to get hold of HiJackThis (errr, Google it? Or just go here :) ) and post a log on one of the many forums that helps (or post it to me and I'll make suggestions)

Scautura
Duct tape is like the Force - it has a Dark side, a Light side, and it holds the Universe together.
CyberRogue

corremn

  • Rogueliker
  • ***
  • Posts: 700
  • Karma: +0/-0
  • SewerJack Extraordinaire
    • View Profile
    • Demise RogueLike Games
Re: Worst bug you had?
« Reply #38 on: January 12, 2009, 10:48:58 PM »
Thanks I will give hiJackthis a go.
corremn's Roguelikes. To admit defeat is to blaspheme against the Emperor.  Warhammer 40000 the Roguelike

corremn

  • Rogueliker
  • ***
  • Posts: 700
  • Karma: +0/-0
  • SewerJack Extraordinaire
    • View Profile
    • Demise RogueLike Games
Re: Worst bug you had?
« Reply #39 on: January 13, 2009, 12:53:51 PM »
Here it is.

mwssvc.exe looks bad, dont it?
I cant get rid of the damn thing.  Well I have tried deleting it. Next to search that internet thing for a answer.

Also google is hyjacked by ecata.info.  Urrrrggghhhhh!

Also I cant access malwarebytes or spybot homepages, how can anything be this smart?  I mean what ever has taken hold of my computer is a real nasty peice of work.

Code: [Select]
Logfile of Trend Micro HijackThis v2.0.2
Scan saved at 11:25:18 PM, on 1/13/2009
Platform: Windows XP SP3 (WinNT 5.01.2600)
MSIE: Internet Explorer v7.00 (7.00.5730.0013)
Boot mode: Normal

Running processes:
C:\WINDOWS\System32\smss.exe
C:\WINDOWS\system32\winlogon.exe
C:\WINDOWS\system32\services.exe
C:\WINDOWS\system32\lsass.exe
C:\WINDOWS\system32\Ati2evxx.exe
C:\WINDOWS\system32\svchost.exe
C:\WINDOWS\System32\svchost.exe
C:\WINDOWS\system32\spoolsv.exe
C:\Program Files\Trend Micro\BM\TMBMSRV.exe
C:\WINDOWS\system32\CTsvcCDA.EXE
C:\Program Files\Intel\Intel Application Accelerator\iaantmon.exe
C:\Program Files\Common Files\Microsoft Shared\VS7Debug\mdm.exe
C:\Program Files\Microsoft LifeCam\MSCamS32.exe
C:\Program Files\Trend Micro\Internet Security\SfCtlCom.exe
C:\WINDOWS\system32\svchost.exe
C:\Program Files\Trend Micro\Internet Security\TmPfw.exe
C:\Program Files\Trend Micro\Internet Security\TmProxy.exe
C:\WINDOWS\system32\MsPMSPSv.exe
C:\Program Files\Trend Micro\Internet Security\UfSeAgnt.exe
C:\Program Files\Common Files\Symantec Shared\Security Center\SymWSC.exe
C:\Program Files\Canon\CAL\CALMAIN.exe
C:\WINDOWS\Explorer.EXE
C:\Program Files\Intel\Intel Application Accelerator\iaanotif.exe
C:\Program Files\Intel\Modem Event Monitor\IntelMEM.exe
C:\Program Files\Creative\Sound Blaster Live! 24-bit\Surround Mixer\CTSysVol.exe
C:\WINDOWS\system32\Rundll32.exe
C:\WINDOWS\system32\dla\tfswctrl.exe
C:\WINDOWS\vVX1000.exe
C:\WINDOWS\system32\ctfmon.exe
C:\Program Files\TortoiseSVN\bin\TSVNCache.exe
C:\WINDOWS\system32\wuauclt.exe
C:\Program Files\Trend Micro\Internet Security\UfNavi.exe
C:\Program Files\Trend Micro\Internet Security\UfNavi.exe
C:\WINDOWS\system32\msiexec.exe
C:\Program Files\Java\jre6\bin\jusched.exe
C:\Program Files\Java\jre6\bin\jqs.exe
C:\Program Files\Internet Explorer\iexplore.exe
C:\Documents and Settings\Chris\Desktop\HiJackThis.exe

R1 - HKCU\Software\Microsoft\Internet Explorer\Main,Default_Page_URL = http://www.dell.com
R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Default_Page_URL = http://go.microsoft.com/fwlink/?LinkId=69157
R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Default_Search_URL = http://go.microsoft.com/fwlink/?LinkId=54896
R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Search Page = http://go.microsoft.com/fwlink/?LinkId=54896
R0 - HKLM\Software\Microsoft\Internet Explorer\Main,Start Page = http://go.microsoft.com/fwlink/?LinkId=69157
R1 - HKCU\Software\Microsoft\Internet Connection Wizard,ShellNext = http://www.dell.com/
R3 - URLSearchHook: (no name) - {00A6FAF6-072E-44cf-8957-5838F569A31D} - (no file)
O2 - BHO: MyWebSearch Search Assistant BHO - {00A6FAF1-072E-44cf-8957-5838F569A31D} - (no file)
O2 - BHO: AcroIEHlprObj Class - {06849E9F-C8D7-4D59-B87D-784B7D6BE0B3} - C:\Program Files\Adobe\Acrobat 6.0\Reader\ActiveX\AcroIEHelper.dll
O2 - BHO: Skype add-on (mastermind) - {22BF413B-C6D2-4d91-82A9-A0F997BA588C} - C:\Program Files\Skype\Toolbars\Internet Explorer\SkypeIEPlugin.dll
O2 - BHO: DriveLetterAccess - {5CA3D70E-1895-11CF-8E15-001234567890} - C:\WINDOWS\system32\dla\tfswshx.dll
O2 - BHO: Java(tm) Plug-In SSV Helper - {761497BB-D6F0-462C-B6EB-D4DAF1D92D43} - C:\Program Files\Java\jre6\bin\ssv.dll
O2 - BHO: (no name) - {7E853D72-626A-48EC-A868-BA8D5E23E045} - (no file)
O2 - BHO: Java(tm) Plug-In 2 SSV Helper - {DBC80044-A445-435b-BC74-9C25C1C588A9} - C:\Program Files\Java\jre6\bin\jp2ssv.dll
O2 - BHO: JQSIEStartDetectorImpl - {E7E6F031-17CE-4C07-BC86-EABFE594F69C} - C:\Program Files\Java\jre6\lib\deploy\jqs\ie\jqs_plugin.dll
O4 - HKLM\..\Run: [IAAnotif] C:\Program Files\Intel\Intel Application Accelerator\iaanotif.exe
O4 - HKLM\..\Run: [IntelMeM] C:\Program Files\Intel\Modem Event Monitor\IntelMEM.exe
O4 - HKLM\..\Run: [CTSysVol] C:\Program Files\Creative\Sound Blaster Live! 24-bit\Surround Mixer\CTSysVol.exe /r
O4 - HKLM\..\Run: [P17Helper] Rundll32 P17.dll,P17Helper
O4 - HKLM\..\Run: [UpdReg] C:\WINDOWS\UpdReg.EXE
O4 - HKLM\..\Run: [dla] C:\WINDOWS\system32\dla\tfswctrl.exe
O4 - HKLM\..\Run: [PinnacleDriverCheck] C:\WINDOWS\system32\PSDrvCheck.exe -CheckReg
O4 - HKLM\..\Run: [LifeCam] "C:\Program Files\Microsoft LifeCam\LifeExp.exe"
O4 - HKLM\..\Run: [VX1000] C:\WINDOWS\vVX1000.exe
O4 - HKLM\..\Run: [UfSeAgnt.exe] "C:\Program Files\Trend Micro\Internet Security\UfSeAgnt.exe"
O4 - HKLM\..\Run: [SunJavaUpdateSched] "C:\Program Files\Java\jre6\bin\jusched.exe"
O4 - HKCU\..\Run: [ctfmon.exe] C:\WINDOWS\system32\ctfmon.exe
O8 - Extra context menu item: &Search - http://edits.mywebsearch.com/toolbaredits/menusearch.jhtml?p=ZJxdm172YYAU
O8 - Extra context menu item: E&xport to Microsoft Excel - res://C:\PROGRA~1\MICROS~2\OFFICE11\EXCEL.EXE/3000
O9 - Extra button: Skype - {77BF5300-1474-4EC7-9980-D32B190E9B07} - C:\Program Files\Skype\Toolbars\Internet Explorer\SkypeIEPlugin.dll
O9 - Extra button: Research - {92780B25-18CC-41C8-B9BE-3C9C571A8263} - C:\PROGRA~1\MICROS~2\OFFICE11\REFIEBAR.DLL
O9 - Extra button: Real.com - {CD67F990-D8E9-11d2-98FE-00C0F0318AFE} - C:\WINDOWS\system32\Shdocvw.dll
O9 - Extra button: (no name) - {e2e2dd38-d088-4134-82b7-f2ba38496583} - C:\WINDOWS\Network Diagnostic\xpnetdiag.exe
O9 - Extra 'Tools' menuitem: @xpsp3res.dll,-20001 - {e2e2dd38-d088-4134-82b7-f2ba38496583} - C:\WINDOWS\Network Diagnostic\xpnetdiag.exe
O9 - Extra button: Messenger - {FB5F1910-F110-11d2-BB9E-00C04F795683} - C:\Program Files\Messenger\msmsgs.exe
O9 - Extra 'Tools' menuitem: Windows Messenger - {FB5F1910-F110-11d2-BB9E-00C04F795683} - C:\Program Files\Messenger\msmsgs.exe
O16 - DPF: {1D4DB7D2-6EC9-47A3-BD87-1E41684E07BB} - http://ak.exe.imgfarm.com/images/nocache/funwebproducts/ei-3/ZwinkyInitialSetup1.0.1.0.cab
O16 - DPF: {6E32070A-766D-4EE6-879C-DC1FA91D2FC3} (MUWebControl Class) - http://www.update.microsoft.com/microsoftupdate/v6/V5Controls/en/x86/client/muweb_site.cab?1191407246562
O18 - Protocol: skype4com - {FFC8B962-9B40-4DFF-9458-1830C7DD7F5D} - C:\PROGRA~1\COMMON~1\Skype\SKYPE4~1.DLL
O20 - Winlogon Notify: 84cb4975511 - C:\WINDOWS\
O23 - Service: Ati HotKey Poller - Unknown owner - C:\WINDOWS\system32\Ati2evxx.exe
O23 - Service: Canon Camera Access Library 8 (CCALib8) - Canon Inc. - C:\Program Files\Canon\CAL\CALMAIN.exe
O23 - Service: Creative Service for CDROM Access - Creative Technology Ltd - C:\WINDOWS\system32\CTsvcCDA.EXE
O23 - Service: IAA Event Monitor (IAANTMon) - Intel Corporation - C:\Program Files\Intel\Intel Application Accelerator\iaantmon.exe
O23 - Service: Java Quick Starter (JavaQuickStarterService) - Sun Microsystems, Inc. - C:\Program Files\Java\jre6\bin\jqs.exe
O23 - Service: My Web Search Service (MyWebSearchService) - Unknown owner - C:\PROGRA~1\MYWEBS~1\bar\1.bin\mwssvc.exe (file missing)
O23 - Service: Trend Micro Central Control Component (SfCtlCom) - Trend Micro Inc. - C:\Program Files\Trend Micro\Internet Security\SfCtlCom.exe
O23 - Service: SymWMI Service (SymWSC) - Symantec Corporation - C:\Program Files\Common Files\Symantec Shared\Security Center\SymWSC.exe
O23 - Service: Trend Micro Unauthorized Change Prevention Service (TMBMServer) - Trend Micro Inc. - C:\Program Files\Trend Micro\BM\TMBMSRV.exe
O23 - Service: Trend Micro Personal Firewall (TmPfw) - Trend Micro Inc. - C:\Program Files\Trend Micro\Internet Security\TmPfw.exe
O23 - Service: Trend Micro Proxy Service (TmProxy) - Trend Micro Inc. - C:\Program Files\Trend Micro\Internet Security\TmProxy.exe

--
End of file - 7527 bytes
« Last Edit: January 13, 2009, 01:35:49 PM by corremn »
corremn's Roguelikes. To admit defeat is to blaspheme against the Emperor.  Warhammer 40000 the Roguelike

Scautura

  • Rogueliker
  • ***
  • Posts: 55
  • Karma: +0/-0
    • View Profile
    • CyberRogue
    • Email
Re: Worst bug you had?
« Reply #40 on: January 13, 2009, 02:32:55 PM »
These lines ring alarm bells to me:

Code: [Select]
R3 - URLSearchHook: (no name) - {00A6FAF6-072E-44cf-8957-5838F569A31D} - (no file)
O2 - BHO: MyWebSearch Search Assistant BHO - {00A6FAF1-072E-44cf-8957-5838F569A31D} - (no file)
O2 - BHO: (no name) - {7E853D72-626A-48EC-A868-BA8D5E23E045} - (no file)
O8 - Extra context menu item: &Search - http://edits.mywebsearch.com/toolbaredits/menusearch.jhtml?p=ZJxdm172YYAU
O16 - DPF: {1D4DB7D2-6EC9-47A3-BD87-1E41684E07BB} - http://ak.exe.imgfarm.com/images/nocache/funwebproducts/ei-3/ZwinkyInitialSetup1.0.1.0.cab
O23 - Service: My Web Search Service (MyWebSearchService) - Unknown owner - C:\PROGRA~1\MYWEBS~1\bar\1.bin\mwssvc.exe (file missing)

Anything to do with MyWebSearch (Zwinky) is BAD (I would make it flashing red and yellow in 72 point, but I think you get the idea) so you'll need to get rid of it. Next suggestion is Unlocker which will let you delete "locked" files (it'll also tell you what's using them if you try and delete them while they're in use).

I had to get rid of Vundo from a laptop at work here, managed to get rid of it, but the machine was still left in a state that wasn't entirely stable. In the end, it came down to splatting an image back onto it and starting with a virgin machine. It's not even like the person has gone anywhere iffy, as it's happening in infected advertising (I've seen it happen).

Hope this can help.
Duct tape is like the Force - it has a Dark side, a Light side, and it holds the Universe together.
CyberRogue

corremn

  • Rogueliker
  • ***
  • Posts: 700
  • Karma: +0/-0
  • SewerJack Extraordinaire
    • View Profile
    • Demise RogueLike Games
Re: Worst bug you had?
« Reply #41 on: January 13, 2009, 02:45:43 PM »
Finnally got malewarebytes to work, cleared up mywebsearch and a few others in safe mode.
Thanks for the others, I deleted some through hyjackthis, and hopefully I am finnally clean. Google/IE7 at least works correctly now.

Thankyou very much, I can now get back to the important stuff of programming.

:D
corremn's Roguelikes. To admit defeat is to blaspheme against the Emperor.  Warhammer 40000 the Roguelike

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Worst bug you had?
« Reply #42 on: January 15, 2009, 08:27:15 PM »
IE with all bells and whistles on is asking for trouble.

Nathan Stoddard

  • Newcomer
  • Posts: 9
  • Karma: +0/-0
    • View Profile
    • My website
    • Email
Re: Worst bug you had?
« Reply #43 on: February 03, 2009, 10:19:06 PM »
I just found a new and even weirder bug in my game. The game goes into an infinite loop, but only when g++'s -Os (optimize) flag is enabled and -g (debug) flag is disabled. So I can't debug the **** thing. Fortunately gdb still shows me what functions are executed, and I narrowed it down to about 40 LOC, but I still can't find what's wrong. I guess I'll have to disable some of the code, a little at a time.

corremn

  • Rogueliker
  • ***
  • Posts: 700
  • Karma: +0/-0
  • SewerJack Extraordinaire
    • View Profile
    • Demise RogueLike Games
Re: Worst bug you had?
« Reply #44 on: February 03, 2009, 11:15:05 PM »
Theres nothing worse than a bug that does not show up in debug.  A lot of the time it is stack overflows, memory errors, etc, but usually they result in a crash (but not always).  However I doubt the optimise flag would have much effect on game speed anyway, so you could always disable it (after you try at least to track down the bug). 
corremn's Roguelikes. To admit defeat is to blaspheme against the Emperor.  Warhammer 40000 the Roguelike