ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.26k stars 174 forks source link

std::high_resolution_timer messed up when running non-steam game with steam #2255

Closed chipgw closed 11 years ago

chipgw commented 11 years ago

when a game that uses C++11 high_resolution_timer is launched with steam, high_resolution timer returns milliseconds but still says it is returning microseconds. (what it returns normally) consequently the game thinks time is running at 1/1000 the speed and anything time related goes really really slow. problem doesn't occur with a 64bit build of the game, but then the overlay doesn't work either, so it is probably related to that. (when the 64bit overlay is complete I will test it as well)

system info: distro: Arch 64bit (fully up to date) glibc, stdc++, etc. latest available from Arch repositories (not Testing) CPU: i7 870 @ 2.93GHz GPU: Zotac GTX 570 (with proprietary drivers)

Tele42 commented 11 years ago

What specific game are you referring to?

chipgw commented 11 years ago

@Tele42 the game is of my own creation, but a basic test program has the same problem so the problem isn't in my game.

basic test:

#include <chrono>
#include <unistd.h>
#include <iostream>

using namespace std;
using namespace std::chrono;

int main(){
    high_resolution_clock::time_point time = high_resolution_clock::now();

    usleep(100000);

    cout << duration_cast<microseconds>(high_resolution_clock::now() - time).count() * 0.001f;

    return 0;
}

when run normally it says 100.XXX, when run with steam it says 0.1

chipgw commented 11 years ago

I did some digging around and found that the problem is with (Steam Root)/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6.0.16 if the program loads that it has the problem. so then what?

EDIT: it seems to be working now, might it be related to gcc updating to 4.8.0 (system libstdc++ is now 6.0.18) or did you guys do something?

gdrewb-valve commented 11 years ago

Is this issue still active?

chipgw commented 11 years ago

I guess not...

gdrewb-valve commented 11 years ago

Thanks, closing.