Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix silent crash with incorrect time formats in Windows #2971

Merged
merged 4 commits into from
Jan 4, 2019
Merged

Fix silent crash with incorrect time formats in Windows #2971

merged 4 commits into from
Jan 4, 2019

Conversation

mpbagot
Copy link
Contributor

@mpbagot mpbagot commented Jan 3, 2019

This is a pull request to address issue #2729 . It sets the PosixDate.format() function as a partial function, and catches the structured exception thrown by Windows, throwing a Pony error instead.

@chalcolith
Copy link
Member

Looks like the debug builds timed out on Windows. I'll restart to see if they run faster.

@SeanTAllen SeanTAllen added changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge changelog - changed Automatically add "Changed" CHANGELOG entry on merge labels Jan 3, 2019
@SeanTAllen
Copy link
Member

Thanks @mpbagot !

@chalcolith
Copy link
Member

What's happening is that the windows runtime pops up a modal dialog when an assert is hit in debug code. I'll look into disabling that dialog.

@chalcolith chalcolith added the do not merge This PR should not be merged at this time label Jan 3, 2019
@chalcolith
Copy link
Member

The attached patch should disable the exception popups in debug builds.

disable_popups.diff.txt

@mpbagot
Copy link
Contributor Author

mpbagot commented Jan 4, 2019

@kulibali Sorry, I'm a bit confused, I haven't done many pull requests before. What should I be doing with that patch?

@chalcolith
Copy link
Member

No worries. You can apply that patch (e.g. git apply disable_popups.diff.txt), commit the changes, then push to GitHub. That should trigger a new build on AppVeyor which shouldn't pop up any more debug windows.

Thanks for the PR!

#ifdef PLATFORM_IS_WINDOWS
_invalid_parameter_handler old_handler, new_handler;
new_handler = format_invalid_parameter_handler;
old_handler = _set_invalid_parameter_handler(new_handler);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we better use: _set_thread_local_invalid_parameter_handler in order to not interfere with other scheduler threads?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, that would be a much better idea, given the multi-threaded nature of Pony.

@chalcolith chalcolith removed the do not merge This PR should not be merged at this time label Jan 4, 2019
@chalcolith chalcolith merged commit b5050b8 into ponylang:master Jan 4, 2019
ponylang-main added a commit that referenced this pull request Jan 4, 2019
@chalcolith
Copy link
Member

Thanks again @mpbagot

@mpbagot mpbagot deleted the posixdate-bug-fix branch January 5, 2019 02:16
mfelsche added a commit to ponylang/http that referenced this pull request Jan 6, 2019
mfelsche added a commit to ponylang/http that referenced this pull request Jan 23, 2019
* adapt to new partial PosixDate.format

introduced with ponylang/ponyc#2971

* change circle-cli setup

to test master against ponyc master
and release branch against the latest ponyc release

this way we maintain compatibility between http master and ponyc master
and between http releases and ponyc releases.

* fix circleci config.yaml

* add test ensuring common log format

and also that the PosixDate.format call does not error.
@SeanTAllen
Copy link
Member

@mpbagot do you feel up to writing the release notes comment for this? it would:

  • detail the change briefly.
  • mention that it is a breaking API change (format is now partial)
  • show before and after code of how to update to address

@SeanTAllen SeanTAllen mentioned this pull request Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - changed Automatically add "Changed" CHANGELOG entry on merge changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants