Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Phase of the moon bug

Phase of the moon bug

Scheduled Pinned Locked Moved The Lounge
helpcsscomquestion
16 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Blake Coverett
    wrote on last edited by
    #1

    We joke about bugs that depend on the phase of the moon to reproduce. Last night I ran across one that was even less frequent. I was coding away quietly, went to save some code I'd been editing on and off for a few hours, and my editor suddenly complained that the file had been changed while I was editing and asked if I really wanted to save. Odd. I was quite sure I hadn't touched the file, but I made a copy of the underlying file and forced the save. A comparison showed nothing unusual. Odder still, a few minutes later, the next time I try to save, the same thing happens. Now I get worried. Various investigations and countermeasures and the problem still occurs. Not with just with this file, with all of them. I got distracted and when I returned the problem has silently gone away. It wasn't till this morning in the shower that I realized what was broken. I'm off to dig through the editor source code and submit a bugfix. Anyone figure out what must have happened based on my story thus far? Extra brownie points for anyone who can tell what editor it is. -Blake

    B M J 3 Replies Last reply
    0
    • B Blake Coverett

      We joke about bugs that depend on the phase of the moon to reproduce. Last night I ran across one that was even less frequent. I was coding away quietly, went to save some code I'd been editing on and off for a few hours, and my editor suddenly complained that the file had been changed while I was editing and asked if I really wanted to save. Odd. I was quite sure I hadn't touched the file, but I made a copy of the underlying file and forced the save. A comparison showed nothing unusual. Odder still, a few minutes later, the next time I try to save, the same thing happens. Now I get worried. Various investigations and countermeasures and the problem still occurs. Not with just with this file, with all of them. I got distracted and when I returned the problem has silently gone away. It wasn't till this morning in the shower that I realized what was broken. I'm off to dig through the editor source code and submit a bugfix. Anyone figure out what must have happened based on my story thus far? Extra brownie points for anyone who can tell what editor it is. -Blake

      B Offline
      B Offline
      Blake Coverett
      wrote on last edited by
      #2

      This bug only reproduces for one hour a year. -Blake

      C B 3 Replies Last reply
      0
      • B Blake Coverett

        This bug only reproduces for one hour a year. -Blake

        C Offline
        C Offline
        Colin Angus Mackay
        wrote on last edited by
        #3

        Daylight saving time... --Colin Mackay--

        "In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)

        1 Reply Last reply
        0
        • B Blake Coverett

          This bug only reproduces for one hour a year. -Blake

          B Offline
          B Offline
          Blake Coverett
          wrote on last edited by
          #4

          Different timezone/daylight savings time logic is used in different code paths, causing the editor to think that a file it just saved was actually saved in the future - but only during that one magic overlapping hour when the time changes. Makes me think I should revisit some unit testing code of my own. What fun. -Blake

          M 1 Reply Last reply
          0
          • B Blake Coverett

            This bug only reproduces for one hour a year. -Blake

            C Offline
            C Offline
            Colin Angus Mackay
            wrote on last edited by
            #5

            I used to work on a database system that had a licence manager that screamed blue murder for the same reason - It thought the clock was being turned back in an attempt to defeat the licence manager. Eventually it was sorted so the timer was based on UTC instead of local time - But only after one of its customers who was using the software as part of an emergency response system threatened to sue if it happened again. They said they would have sued immediately if an emergency had arisen during that hour. --Colin Mackay--

            "In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)

            B S 2 Replies Last reply
            0
            • B Blake Coverett

              Different timezone/daylight savings time logic is used in different code paths, causing the editor to think that a file it just saved was actually saved in the future - but only during that one magic overlapping hour when the time changes. Makes me think I should revisit some unit testing code of my own. What fun. -Blake

              M Offline
              M Offline
              Michael Dunn
              wrote on last edited by
              #6

              Blake Coverett wrote: but only during that one magic overlapping hour when the time changes. I just got the same thing, but it was about 8 AM local time. I wasn't awake between 1-2 AM (or the other 1-2 AM ;)) --Mike-- Ericahist [updated Oct 26] | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."   -- Buffy

              1 Reply Last reply
              0
              • C Colin Angus Mackay

                I used to work on a database system that had a licence manager that screamed blue murder for the same reason - It thought the clock was being turned back in an attempt to defeat the licence manager. Eventually it was sorted so the timer was based on UTC instead of local time - But only after one of its customers who was using the software as part of an emergency response system threatened to sue if it happened again. They said they would have sued immediately if an emergency had arisen during that hour. --Colin Mackay--

                "In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)

                B Offline
                B Offline
                Blake Coverett
                wrote on last edited by
                #7

                Lots of software breaks if the time change happens while the software is running. I suspect given the nature of a license manager that was the case for you? This was the first time I've seen something that breaks even when launched afresh during that window. -Blake

                C 1 Reply Last reply
                0
                • B Blake Coverett

                  Lots of software breaks if the time change happens while the software is running. I suspect given the nature of a license manager that was the case for you? This was the first time I've seen something that breaks even when launched afresh during that window. -Blake

                  C Offline
                  C Offline
                  Colin Angus Mackay
                  wrote on last edited by
                  #8

                  Blake Coverett wrote: Lots of software breaks if the time change happens while the software is running Yeah! Programmers are too linear in their thinking. ;) We must create software that will continue to work in case time travel is invented. Actually - I used to have real hassle with Outlook when I travelled a lot. It doesn't like users who cross timezones and change the timezone information accordingly - Outlook demands to reposition all the appointments so they are all over the place. I eventually just ran my laptop on GMT the whole time. I can't imagine what Microsoft were thinking: Okay so the user has an appointment at 15:00 and they've just changes the timezone from GMT to CET (Central European Time) so lets move the appointment to 16:00 so it will still occur at 15:00 GMT despite the fact their previous entry is a flight between Edinburgh and Madrid. Aaarrrggghhh! :mad: Why can't I put in timezone information with an appointment? - then it could adjust it properly. I would love to have travel time information insertable that would allow me to put in something like: 08:40GMT EDInburgh-MADrid flight arriving at 14:20CET and that would trigger the timezone change in the PC too. Anyway - I don't travel so much now. So I no longer care about this feature. I would have thought it would be quite useful for Americans (seeing as there are a few timezones across the country) --Colin Mackay--

                  "In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)

                  C 1 Reply Last reply
                  0
                  • B Blake Coverett

                    We joke about bugs that depend on the phase of the moon to reproduce. Last night I ran across one that was even less frequent. I was coding away quietly, went to save some code I'd been editing on and off for a few hours, and my editor suddenly complained that the file had been changed while I was editing and asked if I really wanted to save. Odd. I was quite sure I hadn't touched the file, but I made a copy of the underlying file and forced the save. A comparison showed nothing unusual. Odder still, a few minutes later, the next time I try to save, the same thing happens. Now I get worried. Various investigations and countermeasures and the problem still occurs. Not with just with this file, with all of them. I got distracted and when I returned the problem has silently gone away. It wasn't till this morning in the shower that I realized what was broken. I'm off to dig through the editor source code and submit a bugfix. Anyone figure out what must have happened based on my story thus far? Extra brownie points for anyone who can tell what editor it is. -Blake

                    M Offline
                    M Offline
                    Marc Clifton
                    wrote on last edited by
                    #9

                    Daylight savings happened. For an hour, the filetime on your disk was, let's see, later than your computer time. [edit]--and yes, I figured that out without looking at the hint or the answer.[/edit] Marc Latest AAL Article My blog Join my forum!

                    B 1 Reply Last reply
                    0
                    • M Marc Clifton

                      Daylight savings happened. For an hour, the filetime on your disk was, let's see, later than your computer time. [edit]--and yes, I figured that out without looking at the hint or the answer.[/edit] Marc Latest AAL Article My blog Join my forum!

                      B Offline
                      B Offline
                      Blake Coverett
                      wrote on last edited by
                      #10

                      Heh, I was thinking of you and your series of articles about unit testing when I wrote the answer part. And yes and no on the nature of the bug. Definitely daylight-savings time related, but not a problem with the filetimes - which is what made it an interesting/subtle bug. I checked that all three of the filetimes matched the system time when I was debugging the problem at the time. The even exhibited the problem with brand new files. -Blake

                      M 1 Reply Last reply
                      0
                      • B Blake Coverett

                        Heh, I was thinking of you and your series of articles about unit testing when I wrote the answer part. And yes and no on the nature of the bug. Definitely daylight-savings time related, but not a problem with the filetimes - which is what made it an interesting/subtle bug. I checked that all three of the filetimes matched the system time when I was debugging the problem at the time. The even exhibited the problem with brand new files. -Blake

                        M Offline
                        M Offline
                        Marc Clifton
                        wrote on last edited by
                        #11

                        Blake Coverett wrote: Heh, I was thinking of you and your series of articles about unit testing when I wrote the answer part Yeah, that's a cool bug for unit testing! Blake Coverett wrote: And yes and no on the nature of the bug. Interesting. I read your answer afterwards. Different code paths? Huh. Can you explain some more (as to why there would be different code paths?) You're not talking about differences in source vs. object file dates, are you? I had some problem like that once--the computer clock got hosed and it refused to compile any changes I made in the source, unless I forced a recompile of the specific file. Took me at least an hour to figure out why the bug I was trying to fix wasn't going away. The debugger going out of sync with the source finally gave me a clue. Marc Latest AAL Article My blog Join my forum!

                        B 1 Reply Last reply
                        0
                        • C Colin Angus Mackay

                          I used to work on a database system that had a licence manager that screamed blue murder for the same reason - It thought the clock was being turned back in an attempt to defeat the licence manager. Eventually it was sorted so the timer was based on UTC instead of local time - But only after one of its customers who was using the software as part of an emergency response system threatened to sue if it happened again. They said they would have sued immediately if an emergency had arisen during that hour. --Colin Mackay--

                          "In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)

                          S Offline
                          S Offline
                          Shog9 0
                          wrote on last edited by
                          #12

                          Thanks. I was having a good morning. Now you reminded me of how much i hate "license managers". :mad:

                          A servant to formulaic ways.

                          Shog9

                          1 Reply Last reply
                          0
                          • M Marc Clifton

                            Blake Coverett wrote: Heh, I was thinking of you and your series of articles about unit testing when I wrote the answer part Yeah, that's a cool bug for unit testing! Blake Coverett wrote: And yes and no on the nature of the bug. Interesting. I read your answer afterwards. Different code paths? Huh. Can you explain some more (as to why there would be different code paths?) You're not talking about differences in source vs. object file dates, are you? I had some problem like that once--the computer clock got hosed and it refused to compile any changes I made in the source, unless I forced a recompile of the specific file. Took me at least an hour to figure out why the bug I was trying to fix wasn't going away. The debugger going out of sync with the source finally gave me a clue. Marc Latest AAL Article My blog Join my forum!

                            B Offline
                            B Offline
                            Blake Coverett
                            wrote on last edited by
                            #13

                            Marc Clifton wrote: Can you explain some more (as to why there would be different code paths?) You're not talking about differences in source vs. object file dates, are you? I'm not talking about the code I was editing here, but the source code for the editor itself. It appears to be calculating the date one way when writing the file and a different way when checking the file attributes before a write. I've just downloaded the code in question and am digging through it now. -Blake

                            1 Reply Last reply
                            0
                            • B Blake Coverett

                              We joke about bugs that depend on the phase of the moon to reproduce. Last night I ran across one that was even less frequent. I was coding away quietly, went to save some code I'd been editing on and off for a few hours, and my editor suddenly complained that the file had been changed while I was editing and asked if I really wanted to save. Odd. I was quite sure I hadn't touched the file, but I made a copy of the underlying file and forced the save. A comparison showed nothing unusual. Odder still, a few minutes later, the next time I try to save, the same thing happens. Now I get worried. Various investigations and countermeasures and the problem still occurs. Not with just with this file, with all of them. I got distracted and when I returned the problem has silently gone away. It wasn't till this morning in the shower that I realized what was broken. I'm off to dig through the editor source code and submit a bugfix. Anyone figure out what must have happened based on my story thus far? Extra brownie points for anyone who can tell what editor it is. -Blake

                              J Offline
                              J Offline
                              JohnJ
                              wrote on last edited by
                              #14

                              Timezone Daylight to Standard time or (standard to Daylight time change):-D The early hours of the last Sunday in October is the big change time for most of Europe, America's plus other backward (timezone wize) bits like the place where the Aussies live:omg: There are some exceptions but most change then. Windows obviously did it's stuff while you were coding and altered the clock back, and then during a save the editor couldn't cope with saving a file that was time stamped one hour or so earlier than the one on the drive:~ Don't worry about it, but just go to bed rather than code on the last Sat/Sun in March when it all changes again & if you have a dual/multiple boot system remember to reboot into the other partitions soon and adjust the clock manually in control Panel/Data & Time:rolleyes: John Hudson Megan Forbes after having cage slightly rattled: Grrrrrrr....:baaaa!: humbug I say!:omg: JohnJ makes a note to wear protective clothing/goggles next time;P http://www.rainbow-innov.co.uk[^]

                              B 1 Reply Last reply
                              0
                              • J JohnJ

                                Timezone Daylight to Standard time or (standard to Daylight time change):-D The early hours of the last Sunday in October is the big change time for most of Europe, America's plus other backward (timezone wize) bits like the place where the Aussies live:omg: There are some exceptions but most change then. Windows obviously did it's stuff while you were coding and altered the clock back, and then during a save the editor couldn't cope with saving a file that was time stamped one hour or so earlier than the one on the drive:~ Don't worry about it, but just go to bed rather than code on the last Sat/Sun in March when it all changes again & if you have a dual/multiple boot system remember to reboot into the other partitions soon and adjust the clock manually in control Panel/Data & Time:rolleyes: John Hudson Megan Forbes after having cage slightly rattled: Grrrrrrr....:baaaa!: humbug I say!:omg: JohnJ makes a note to wear protective clothing/goggles next time;P http://www.rainbow-innov.co.uk[^]

                                B Offline
                                B Offline
                                Blake Coverett
                                wrote on last edited by
                                #15

                                Right general problem, though read the discussion between Marc and I for more details. Nothing to do with the change actually happening while the editor was running. -Blake

                                1 Reply Last reply
                                0
                                • C Colin Angus Mackay

                                  Blake Coverett wrote: Lots of software breaks if the time change happens while the software is running Yeah! Programmers are too linear in their thinking. ;) We must create software that will continue to work in case time travel is invented. Actually - I used to have real hassle with Outlook when I travelled a lot. It doesn't like users who cross timezones and change the timezone information accordingly - Outlook demands to reposition all the appointments so they are all over the place. I eventually just ran my laptop on GMT the whole time. I can't imagine what Microsoft were thinking: Okay so the user has an appointment at 15:00 and they've just changes the timezone from GMT to CET (Central European Time) so lets move the appointment to 16:00 so it will still occur at 15:00 GMT despite the fact their previous entry is a flight between Edinburgh and Madrid. Aaarrrggghhh! :mad: Why can't I put in timezone information with an appointment? - then it could adjust it properly. I would love to have travel time information insertable that would allow me to put in something like: 08:40GMT EDInburgh-MADrid flight arriving at 14:20CET and that would trigger the timezone change in the PC too. Anyway - I don't travel so much now. So I no longer care about this feature. I would have thought it would be quite useful for Americans (seeing as there are a few timezones across the country) --Colin Mackay--

                                  "In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)

                                  C Offline
                                  C Offline
                                  ColinDavies
                                  wrote on last edited by
                                  #16

                                  Colin Angus Mackay wrote: Why can't I put in timezone information with an appointment? That is a good idea !! Regardz Colin J Davies

                                  *** WARNING *
                                  This could be addictive
                                  **The minion's version of "Catch :bob: "

                                  It's a real shame that people as stupid as you can work out how to use a computer. said by Christian Graus in the Soapbox

                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  • Login

                                  • Don't have an account? Register

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • World
                                  • Users
                                  • Groups