Details
-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 3.2.2
-
cf09ac882c25cc6d40ea1caf73f8fb538784c6fb
Description
On my setup if I issue "p4 Repository Log" it will cause Qt Creator to crash.
Below you can find my dialogue on #qt-creator irc channel:
[11:37] <cadam> hi there, I have a crash with the perforce plugin in Qt Creator 3.2.2
[11:38] <cadam> this happens when I log a repository
[11:38] <hunger> cadam: Do you have a backtrace/
[11:38] <hunger> ?
[11:38] <cadam> I've compiled QtCreator and ran in debug mode
[11:38] == timsche quassel@port-92-192-114-82.dynamic.qsc.de has joined #qt-creator
[11:39] <cadam> crash happens in Core::IEditor *PerforcePlugin::showOutputInEditor
[11:39] == Tr0p1caL Tr0p1caL@2a02:1205:5038:5d90:e82f:7d6f:6f2c:d17 has joined #qt-creator
[11:39] <cadam> Core::IEditor *editor = Core::EditorManager::openEditorWithContents(id, &s, output.toUtf8());
[11:39] <cadam> editor is null
[11:40] <hunger> cadam: Can you please file a bug report with that information?
[11:40] <cadam> editor is null because of bool BaseTextDocument::setPlainText(const QString &text)
[11:41] <cadam> there is this if (text.size() > EditorManager::maxTextFileSize()) { in bool BaseTextDocument::setPlainText(const QString &text)
[11:41] <cadam> as it turns out if you have a file bigger than 3 << 24 (50MB) it returns false
[11:41] <cadam> which will generate a null editor and crash
[11:42] <cadam> if it would return true.... you will get an information like: "The text is too large to be displayed (55 MB)."
[11:43] <cadam> Question is... what should happen in this case? The string with text is too large doesn't help me at all
[11:43] <cadam> I can't make it smaller
[11:43] <cadam> since it comes from perforce
[11:43] <andre_> cadam: what would you expect to happen?
[11:44] <andre_> (the crash of course should be avoided)
[11:44] <cadam> display the 50mb of log and at the end... "text was capped at 50mb"
[11:44] <andre_> or half from begin, half from end?
[11:44] <cadam> I'm interested in the newest perforce logs
[11:45] <cadam> right now I need to go to the perforce visual client, I would go there if I need older entries...