Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

exception dumping doesn't respect any of TMP/TMPDIR/TEMP/TEMPDIR #3885

Closed
wzdev-ci opened this issue Jan 17, 2013 · 11 comments
Closed

exception dumping doesn't respect any of TMP/TMPDIR/TEMP/TEMPDIR #3885

wzdev-ci opened this issue Jan 17, 2013 · 11 comments

Comments

@wzdev-ci
Copy link
Contributor

resolution_fixed type_bug | by pabs


The exception handler hard-codes /tmp/ instead of using the TMP/TMPDIR/TEMP/TEMPDIR environment variables. mkstemp already respects these variables so all that is needed is to drop the /tmp/ from this string. Personally I think ~/.warzone-3.1/crash-dumps/XXXXXX is a better place for these files.

lib/exceptionhandler/exceptionhandler.cpp:
static const char gdmpPath[] = "/tmp/warzone2100.gdmp-XXXXXX";

Issue migrated from trac:3885 at 2022-04-16 10:48:50 -0700

@wzdev-ci
Copy link
Contributor Author

Cyp changed blocking which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

Cyp changed blockedby which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

Cyp commented


If removing the "/tmp/" and running "src/warzone2100 --crash", the dump appears in the working directory.

@wzdev-ci
Copy link
Contributor Author

pabs commented


Hmmm, I thought mkstemp would be smarter than that.

The options appear to be:

Switch to ~/.warzone2100-$v/crash-dumps. This has the advantage that next time the game starts you can automatically ask the user if they want to submit the crash dumps they have.

chdir to TMP, TMPDIR, TEMP, TEMPDIR or /tmp before mkstemp.

Use tempnam with a loop and exclusive locks to prevent security issues.

@wzdev-ci
Copy link
Contributor Author

Per commented


Use QDir::tempPath()? See http://qt-project.org/doc/qt-4.8/qdir.html#tempPath

@wzdev-ci
Copy link
Contributor Author

pabs commented


QDir::tempPath() sounds like a good choice in the interim.

I would still suggest to switch to a dedicated directory since it has a number of advantages, but thats a topic for another ticket I guess.

@wzdev-ci
Copy link
Contributor Author

clueless commented


With 3.1.1, the crash file for windows machines are in the configuration directory called logs and on Ubuntu they are still in /tmp/
Is there a reason why windows uses the configuration directory, and not for linux?

@wzdev-ci
Copy link
Contributor Author

vexed changed status from new to closed

@wzdev-ci
Copy link
Contributor Author

vexed changed owner from `` to vexed

@wzdev-ci
Copy link
Contributor Author

vexed changed resolution from `` to fixed

@wzdev-ci
Copy link
Contributor Author

vexed commented


In Warzone2100/warzone2100@ff1ac37:

#CommitTicketReference repository="" revision="ff1ac373abec15ca4095a82b76d0e584741a15d4"
Use our configdir (which is the only directory WZ should ever write to) for all crash handlers now.

Fixes #3885
refs #4259

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant