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

Crash when getting permanent subscriptions created with old Orion versions #3256

Closed
fgalan opened this issue Aug 1, 2018 · 1 comment
Closed
Milestone

Comments

@fgalan
Copy link
Member

fgalan commented Aug 1, 2018

A bug was introduced by 1a49367 in PR #3084 around January 22nd, 2018 as part of issue #3004 implementation, in the 1.13.0 development cycle.

In particular the bug is due to this change:

-#define PERMANENT_SUBS_DATETIME ((int64_t) 9e18)
+#define PERMANENT_EXPIRES_DATETIME ((int64_t) 0x7FFFFFFFFFFFFFFF)

where:

(int64_t) 9e18               = 9000000000000000000
(int64_t) 0x7FFFFFFFFFFFFFFF = 9223372036854775807

What is happening is that permanent subscriptions created before 1.13.0 are using the first one, so now the following checking in Subscription::toJson():

  if (this->expires != PERMANENT_EXPIRES_DATETIME)
  {
    jh.addDate("expires", this->expires);
  }

is failing and activates the jh.addDate() even when subscription is permanent, so causing the crash (add addDate calls internally gmtime() with so large value and fails).

@fgalan
Copy link
Member Author

fgalan commented Aug 1, 2018

Fixed by PR #3257

@fgalan fgalan closed this as completed Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant