November 02, 2017
https://issues.dlang.org/show_bug.cgi?id=12507

--- Comment #10 from Rob T <alanb@ucora.com> ---
I just encounter this issue and spent an hour or so figuring out what the cause was. segfaults tend to be very difficult to track down and deal with.

A quick sub-optimal fix will be better than leaving it to seg fault.

--
June 13, 2018
https://issues.dlang.org/show_bug.cgi?id=12507

Nathan S. <n8sh.secondary@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |n8sh.secondary@hotmail.com

--- Comment #11 from Nathan S. <n8sh.secondary@hotmail.com> ---
Pull request: https://github.com/dlang/phobos/pull/6581

I doubt it is of great interest to anyone precisely what is displayed by `SysTime.init.toString`, but it shouldn't cause a segfault, and fixing that is trivial.

--
June 26, 2018
https://issues.dlang.org/show_bug.cgi?id=12507

--- Comment #12 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/9b1f72d89b6db38a05b958baf2195f552fe0aa57 Fix issue 12507: SysTime.init.toString() segfaults.

This adds a special TimeZone type internal to SysTime which _timezone is directly initialized to so that SysTime.init will work without segfaulting but will still be uniquely identifiable with the is operator. Or at least, _timezone is _supposed_ to be directly initialized to it, but issue# 17740 currently prevents that. So, _timezone has been temporarily renamed to _timezoneStorage and private getters and setters named _timezone have been added. The getter then does a null check and returns InitTimeZone() for SysTime.init to simulate the member variable having been initialized to InitTimeZone(). Once issue# 17740 has been fixed, these accessors will be unnecessary, and the code should be updated so that _timezone is properly a variable again and is directly initialized with InitTimeZone().

The new TimeZone type - InitTimeZone - is internal to SysTime and can only be obtained by the timezone getter on SysTime.init. It acts the same as UTC except that it is not special-cased by the to*String functions and thus will print out its timezone as +00:00 instead of z, which is perfectly legitimate per the spec. And as such, if _timezone were directly initialized with InitTimeZone(), there would be no extra checks due to this change, and everything would just work. However, until issue# 17740 is fixed, there will be an extra null check any time that a function is called on _timezone, because _timezone is currently a wrapper that does a null check rather than being a member variable directly like it's supposed to be.

Unlike previous attempts along these lines, this does not make it so that SysTime.init has NaN behavior such that any operation (other than assignment) on an an uninitialized SysTime would result in SysTime.init, and the timezone setter property does not set the SysTime to SysTime.init if it's passed this TimeZone. So, unfortunately, it _is_ possible to have other SysTime values with the special TimeZone, but it was deemed unnecessarily complex for too little benefit to add the NaN behavior. And regardless, SysTime.init is still uniquely identifiable via the is operator. It's just that it can't technically be uniquely identified by the timezone getter, which was never a supported feature anyway.

https://github.com/dlang/phobos/commit/ec8bb20d28fa2ff9eeac56a00edc9d916638e61c Merge pull request #6591 from jmdavis/issue_17732_again

Fix issue 12507: SysTime.init.toString() segfaults. merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>

--
June 26, 2018
https://issues.dlang.org/show_bug.cgi?id=12507

github-bugzilla@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
1 2
Next ›   Last »