Compare commits

...

13 Commits

Author SHA1 Message Date
John Preston
a6fb0e372e Beta version 2.9.11.
- Resolve (again) a video playback crash in 32 bit Windows version.
2021-08-24 18:12:26 +03:00
John Preston
7948fc509e Remove (incorrect) checks for double casts. 2021-08-24 18:11:47 +03:00
John Preston
2d6155fc85 Throw fp exceptions in Windows 32 bit build. 2021-08-24 17:43:31 +03:00
John Preston
c7e60ef723 Beta version 2.9.10.
- Resolve (hopefully) a video playback crash in 32 bit Windows version.
2021-08-24 12:42:58 +03:00
John Preston
8f5830d520 Workaround both std::round-s in video streaming. 2021-08-24 12:42:27 +03:00
John Preston
f21d7821e7 Beta version 2.9.9.
- Still(3) debugging a video playback crash in 32 bit Windows version.
2021-08-23 20:34:38 +03:00
John Preston
e8f1373edc Add some checks for NAN in video playback. 2021-08-23 20:29:40 +03:00
John Preston
c8d1e01159 Beta version 2.9.8.
- And still debugging a video playback crash in 32 bit Windows version.
2021-08-23 18:30:14 +03:00
John Preston
7e6f24552a Add basic OpenGL info to crash annotations. 2021-08-23 18:29:20 +03:00
John Preston
27d58ba07b Try to do a non-failed double->crl::time cast.
A crash on some old CPUs show, that in video frame processing
sometimes a cast from double to crl::time fails, writing to
the resulting crl::time value INT64_MIN (0x8000000000000000).

This is shown in crash logs, with lines like:

...,rounded:104,casted:-9223372036854775808,...

where logs are written like:

...
).arg(std::round(adjust * _options.speed)
).arg(crl::time(std::round(adjust * _options.speed))
...

I don't know what to do and how to workaround this. Trying other casts.
2021-08-23 17:58:59 +03:00
23rd
3a92a181a1 Fixed editing on Up arrow in sections with non-empty input field. 2021-08-23 13:57:35 +03:00
23rd
ddd5617043 Fixed processing GIF images as non-album files.
Fixed #16844.
2021-08-23 13:57:31 +03:00
John Preston
70b3e414ce Fix crash in Update-requested-by-tg://-link. 2021-08-23 13:54:49 +03:00
18 changed files with 123 additions and 35 deletions

View File

@@ -9,7 +9,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="2.9.7.0" />
Version="2.9.11.0" />
<Properties>
<DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>

View File

@@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,9,7,0
PRODUCTVERSION 2,9,7,0
FILEVERSION 2,9,11,0
PRODUCTVERSION 2,9,11,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram FZ-LLC"
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "2.9.7.0"
VALUE "FileVersion", "2.9.11.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2021"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "2.9.7.0"
VALUE "ProductVersion", "2.9.11.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,9,7,0
PRODUCTVERSION 2,9,7,0
FILEVERSION 2,9,11,0
PRODUCTVERSION 2,9,11,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -53,10 +53,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram FZ-LLC"
VALUE "FileDescription", "Telegram Desktop Updater"
VALUE "FileVersion", "2.9.7.0"
VALUE "FileVersion", "2.9.11.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2021"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "2.9.7.0"
VALUE "ProductVersion", "2.9.11.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -281,7 +281,8 @@ void ConfirmBox::confirmed() {
}
} else if (const auto callbackPtr = std::get_if<2>(confirmed)) {
if (auto callback = base::take(*callbackPtr)) {
callback([=] { closeBox(); });
const auto weak = Ui::MakeWeak(this);
callback(crl::guard(weak, [=] { closeBox(); }));
}
}
}

View File

@@ -42,6 +42,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lang/lang_instance.h"
#include "mainwidget.h"
#include "core/file_utilities.h"
#include "core/crash_reports.h"
#include "main/main_account.h"
#include "main/main_domain.h"
#include "main/main_session.h"
@@ -94,6 +95,27 @@ constexpr auto kQuitPreventTimeoutMs = crl::time(1500);
constexpr auto kAutoLockTimeoutLateMs = crl::time(3000);
constexpr auto kClearEmojiImageSourceTimeout = 10 * crl::time(1000);
void SetCrashAnnotationsGL() {
#ifdef Q_OS_WIN
CrashReports::SetAnnotation("OpenGL ANGLE", [] {
if (Core::App().settings().disableOpenGL()) {
return "Disabled";
} else switch (Ui::GL::CurrentANGLE()) {
case Ui::GL::ANGLE::Auto: return "Auto";
case Ui::GL::ANGLE::D3D11: return "Direct3D 11";
case Ui::GL::ANGLE::D3D9: return "Direct3D 9";
case Ui::GL::ANGLE::D3D11on12: return "D3D11on12";
case Ui::GL::ANGLE::OpenGL: return "OpenGL";
}
Unexpected("Ui::GL::CurrentANGLE value in SetupANGLE.");
}());
#else // Q_OS_WIN
CrashReports::SetAnnotation(
"OpenGL",
Core::App().settings().disableOpenGL() ? "Disabled" : "Enabled");
#endif // Q_OS_WIN
}
} // namespace
Application *Application::Instance = nullptr;
@@ -287,6 +309,7 @@ void Application::run() {
LOG(("Shortcuts Error: %1").arg(error));
}
SetCrashAnnotationsGL();
if (!Platform::IsMac() && Ui::GL::LastCrashCheckFailed()) {
showOpenGLCrashNotification();
}

View File

@@ -270,12 +270,12 @@ std::unique_ptr<Launcher> Launcher::Create(int argc, char *argv[]) {
return std::make_unique<Platform::Launcher>(argc, argv);
}
Launcher::Launcher(
int argc,
char *argv[])
Launcher::Launcher(int argc, char *argv[])
: _argc(argc)
, _argv(argv)
, _baseIntegration(_argc, _argv) {
crl::toggle_fp_exceptions(true);
base::Integration::Set(&_baseIntegration);
}

View File

@@ -13,9 +13,7 @@ namespace Core {
class Launcher {
public:
Launcher(
int argc,
char *argv[]);
Launcher(int argc, char *argv[]);
static std::unique_ptr<Launcher> Create(int argc, char *argv[]);

View File

@@ -22,7 +22,7 @@ constexpr auto AppId = "{53F49750-6209-4FBF-9CA8-7A333C87D1ED}"_cs;
constexpr auto AppNameOld = "Telegram Win (Unofficial)"_cs;
constexpr auto AppName = "Telegram Desktop"_cs;
constexpr auto AppFile = "Telegram"_cs;
constexpr auto AppVersion = 2009007;
constexpr auto AppVersionStr = "2.9.7";
constexpr auto AppVersion = 2009011;
constexpr auto AppVersionStr = "2.9.11";
constexpr auto AppBetaVersion = true;
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;

View File

@@ -1094,7 +1094,7 @@ void ComposeControls::initKeyHandler() {
return;
}
if (key == Qt::Key_Up && !hasModifiers) {
if (!isEditingMessage()) {
if (!isEditingMessage() && _field->empty()) {
_editLastMessageRequests.fire(std::move(keyEvent));
return;
}

View File

@@ -412,7 +412,9 @@ void File::start(not_null<FileDelegate*> delegate, crl::time position) {
_reader->startStreaming();
_context.emplace(delegate, _reader.get());
_thread = std::thread([=, context = &*_context] {
crl::toggle_fp_exceptions(true);
context->start(position);
while (!context->finished()) {
context->readNextPacket();

View File

@@ -13,6 +13,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/crash_reports.h"
#include "zlib.h"
#include <cfenv>
extern "C" {
extern int __isa_available;
}
#define TO_LOG(x) debugLog(QString x)
@@ -73,6 +78,31 @@ static_assert(kDisplaySkipped != kTimeUnknown);
return result;
}
[[nodiscard]] float64 SafeRound(float64 value) {
Expects(!std::isnan(value));
if (const auto result = std::round(value); !std::isnan(result)) {
return result;
}
const auto errors = std::fetestexcept(FE_ALL_EXCEPT);
LOG(("Streaming Error: Got NAN in std::round(%1), fe: %2."
).arg(value
).arg(errors));
if (const auto result = std::round(value); !std::isnan(result)) {
return result;
}
std::feclearexcept(FE_ALL_EXCEPT);
if (const auto result = std::round(value); !std::isnan(result)) {
return result;
}
CrashReports::SetAnnotation("FE-Error-Value", QString::number(value));
CrashReports::SetAnnotation("FE-Errors-Were", QString::number(errors));
CrashReports::SetAnnotation(
"FE-Errors-Now",
QString::number(std::fetestexcept(FE_ALL_EXCEPT)));
Unexpected("NAN after third std::round.");
}
} // namespace
class VideoTrackObject final {
@@ -199,7 +229,7 @@ VideoTrackObject::VideoTrackObject(
Expects(_error != nullptr);
TO_LOG(("created,speed:%1,mode:%2,position:%3,sync:%4,"
"loop:%5,wait:%6,duration:%7,initialized:%8"
"loop:%5,wait:%6,duration:%7,initialized:%8,isa:%9"
).arg(options.speed
).arg(int(options.mode)
).arg(options.position
@@ -207,7 +237,8 @@ VideoTrackObject::VideoTrackObject(
).arg(options.loop ? "true" : "false"
).arg(options.waitForMarkAsShown ? "true" : "false"
).arg(_stream.duration
).arg(_shared->initialized() ? "true" : "false"));
).arg(_shared->initialized() ? "true" : "false"
).arg(__isa_available));
}
rpl::producer<> VideoTrackObject::checkNextFrame() const {
@@ -373,6 +404,7 @@ void VideoTrackObject::debugLog(const QString &entry) const {
_debugLog.push_back("stp.worldTime:"
+ QString::number(_syncTimePoint.worldTime)
+ ";stp.trackTime:" + QString::number(_syncTimePoint.trackTime)
+ ";fe:" + QString::number(std::fetestexcept(FE_ALL_EXCEPT))
+ ";" + entry);
}
@@ -846,16 +878,19 @@ TimePoint VideoTrackObject::trackTime() const {
}
}
const auto adjust = (result.worldTime - _syncTimePoint.worldTime);
result.trackTime = _syncTimePoint.trackTime
+ crl::time(std::round(adjust * _options.speed));
const auto adjustSpeed = adjust * _options.speed;
const auto roundAdjustSpeed = SafeRound(adjustSpeed);
const auto timeRoundAdjustSpeed = crl::time(roundAdjustSpeed);
const auto trackTime = _syncTimePoint.trackTime + timeRoundAdjustSpeed;
TO_LOG(("track_time_adjusted,world:%1,adjust:%2,speed:%3,delta:%4,rounded:%5,casted:%6,final:%7"
).arg(result.worldTime
).arg(adjust
).arg(_options.speed
).arg(adjust * _options.speed
).arg(std::round(adjust * _options.speed)
).arg(crl::time(std::round(adjust * _options.speed))
).arg(result.trackTime));
).arg(adjustSpeed
).arg(roundAdjustSpeed
).arg(timeRoundAdjustSpeed
).arg(trackTime));
result.trackTime = trackTime;
debugAssertKnownTime(11, result.trackTime);
return result;
}
@@ -988,9 +1023,11 @@ auto VideoTrack::Shared::presentFrame(
return { kTimeUnknown, kTimeUnknown, addedWorldTimeDelay };
}
const auto trackLeft = position - time.trackTime;
const auto adjustedBySpeed = trackLeft / playbackSpeed;
const auto roundedAdjustedBySpeed = SafeRound(adjustedBySpeed);
frame->display = time.worldTime
+ addedWorldTimeDelay
+ crl::time(std::round(trackLeft / playbackSpeed));
+ crl::time(roundedAdjustedBySpeed);
// Release this frame to the main thread for rendering.
_counter.store(

View File

@@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/gl/gl_shader.h"
#include "media/streaming/media_streaming_common.h"
#include "base/platform/base_platform_info.h"
#include "core/crash_reports.h"
#include "styles/style_media_view.h"
namespace Media::View {
@@ -119,6 +120,12 @@ void OverlayWidget::RendererGL::init(
FragmentSampleARGB32Texture(),
FragmentGlobalOpacity(),
}));
const auto renderer = reinterpret_cast<const char*>(
f.glGetString(GL_RENDERER));
CrashReports::SetAnnotation(
"OpenGL Renderer",
renderer ? renderer : "[nullptr]");
}
void OverlayWidget::RendererGL::deinit(

View File

@@ -17,6 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/file_utilities.h"
#include "core/mime_type.h"
#include "core/ui_integration.h"
#include "core/crash_reports.h"
#include "ui/widgets/popup_menu.h"
#include "ui/widgets/buttons.h"
#include "ui/image/image.h"
@@ -294,6 +295,8 @@ OverlayWidget::OverlayWidget()
, _lastAction(-st::mediaviewDeltaFromLastAction, -st::mediaviewDeltaFromLastAction)
, _stateAnimation([=](crl::time now) { return stateAnimationCallback(now); })
, _dropdown(_widget, st::mediaviewDropdownMenu) {
CrashReports::SetAnnotation("OpenGL Renderer", "[not-initialized]");
Lang::Updated(
) | rpl::start_with_next([=] {
refreshLang();

View File

@@ -291,7 +291,8 @@ void PrepareDetails(PreparedFile &file, int previewWidth) {
if (ValidPhotoForAlbum(*image, file.information->filemime)) {
UpdateImageDetails(file, previewWidth);
file.type = PreparedFile::Type::Photo;
} else if (Core::IsMimeSticker(file.information->filemime)) {
} else if (Core::IsMimeSticker(file.information->filemime)
|| image->animated) {
file.type = PreparedFile::Type::None;
}
} else if (const auto video = std::get_if<Video>(

View File

@@ -1,7 +1,7 @@
AppVersion 2009007
AppVersion 2009011
AppVersionStrMajor 2.9
AppVersionStrSmall 2.9.7
AppVersionStr 2.9.7
AppVersionStrSmall 2.9.11
AppVersionStr 2.9.11
BetaChannel 1
AlphaVersion 0
AppVersionOriginal 2.9.7.beta
AppVersionOriginal 2.9.11.beta

View File

@@ -1,3 +1,19 @@
2.9.11 beta (24.08.21)
- Resolve (again) a video playback crash in 32 bit Windows version.
2.9.10 beta (24.08.21)
- Resolve (hopefully) a video playback crash in 32 bit Windows version.
2.9.9 beta (23.08.21)
- Still(3) debugging a video playback crash in 32 bit Windows version.
2.9.8 beta (23.08.21)
- And still debugging a video playback crash in 32 bit Windows version.
2.9.7 beta (23.08.21)
- Still debugging a video playback crash in 32 bit Windows version.

2
cmake

Submodule cmake updated: 7260711ec5...76ece84e77