Visual C++ 2015 Update 2 編譯出來的程式包含了遙測的功能?

| | 0 Comments| 09:33
Categories:

Heresy 是看到《VS2015: How to Remove Windows Telemetry Function Call from your C/C++ Binaries》這篇文章才知道這件事了…

基本上,就是 sammiesdog 在 Reddit 上說(連結),他發現他用 Visual Studio 2015 Update 2 來編譯一個最簡單的 C++ 的程式的時候,編譯器所產生的二進為檔(binary),裡面赫然發現他會去呼叫「telemetry_main_invoke_trigger」和「telemetry_main_return_trigger」!

就算你的 C++ 程式碼只寫了:

int main(){
return 0;}

編譯出來的執行檔裡面,還是可以發現「telemetry」的蹤跡…

微軟的 Visual C++ 團隊開發經理 Steve Carroll 也有針對這件事做回應(連結)。他的說法是:

Our intent was benign – our desire was to build a framework that will help investigate performance problems and improve the quality of our optimizer should we get any reports of slowdowns or endemic perf problems in the field.

We apologize for raising the suspicion levels even further by not including the CRT source, this was just an oversight on our part. Despite that, some of you already investigated how this mechanism works in nice detail. As you have already called out, what the code does is trigger an ETW event which, when it’s turned on, will emit timestamps and module loads events. The event data can only be interpreted if a customer gives us symbol information (i.e. PDBs) so this data is only applicable to customers that are actively seeking help from us and are willing to share these PDBs as part of their investigation. We haven’t actually gone through this full exercise with any customers to date though, and we are so far relying on our established approaches to investigate and address potential problems instead.

大概的意思,是他們加入這功能的目的,是希望可以用來記錄性能的問題、藉此來改善編譯器的最佳化。

而這個程式會會觸發 ETW event(Event Tracing for Windows 事件、MSDN)、並開始記錄事件;不過這些記錄檔案應該只會以 ETL 檔的形式存在本機上(參考),並不會直接傳到微軟那邊。

同時,這些事件的資料,只有在有對應的 symbol information(PBD 檔)時、才有辦法使用;所以除非開發者主動提供這些 PBD 檔,否則這些紀錄資料也是無法使用的。

他也承諾這項功能會在 Update 3 中移除。如果目前使用 Update 2、又不想被加入這項功能的話,請在專案設定裡,找到「Linker」中的「Command Line」,然後在「Additional Options」中加上「notelemetry.obj」,這樣就可以停用這功能了。


總覺得,近年來雖然微軟和開源社群走得越來越近,但是包含 Windows 10 的強迫更新(參考:《Microsoft 強迫升級 Windows 10 帶來一籮筐的困擾》)在內,微軟的一些動作也越來越強硬了…甚至,已經強勢到惹人厭了。

老實說,Heresy 實在無法理解近期的微軟到底在想啥…很多時候,使用者真的已經變成「正版軟體的受害者」了…看來微軟真的快滅了嗎?(但是 Google 和 Apple 也沒好到哪去啊… orz)


額外參考:

Leave a Reply

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *