Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac M Series Chip Issues(Not Crashing Issue) #87

Open
JobberRT opened this issue Dec 19, 2024 · 20 comments
Open

Mac M Series Chip Issues(Not Crashing Issue) #87

JobberRT opened this issue Dec 19, 2024 · 20 comments

Comments

@JobberRT
Copy link

Issue Detail(Logs at below)

When opening the FE executable through terminal, it indicates that:

  1. port open failed
  2. HTTP request failures prevent the APP from starting (not the custom getfiddler.com and identity requests). Perhaps the request interception is not comprehensive enough?

------- Translated by ChatGPT -------
通过终端打开 FE 可执行文件时提示:

  1. 端口打开失败
  2. HTTP 请求失败导致应用无法启动(不是自定义的 getfiddler.com 和 identity 请求)。是否拦截请求的功能不够全面?

Some other info

This is not a "spammed" macos crashing issue. I have already replace the dylibs, and sucessfully start the FE without crashing. It just exit normally(by NORMAL, I mean it encounted some errors and decided to exit)

If this issue can be resolved, I'll write the complete steps for macOS to function.

------- Translated by ChatGPT -------
这不是一个“频繁发帖”的 macOS 崩溃的问题。我已经替换了 dylib,并成功启动了 FE 而没有发生崩溃。它只是正常退出(所谓“正常”,我的意思是它遇到了一些错误并决定退出)。
如果这个问题能解决,我会编写完整的 macOS 操作步骤。

Complete log:

➜  WebServer "/Applications/Fiddler Everywhere.app/Contents/MacOS/Fiddler Everywhere"       
[2024-12-19 19:39:30.559] [info] libfiddler initialize
19:39:30.561 › [Product information] Fiddler Everywhere 6.0.0
19:39:30.564 › [System information] darwin (Darwin/arm64) - version 24.2.0
19:39:30.565 › Loaded network capturing extension.
19:39:30.592 › Initializing splash screen.
19:39:30.651 › Ensure no running cleanup nodejs and cleanup .net processes.
19:39:30.709 › No matching processes to clean.
19:39:30.770 › Displaying splash screen.
19:39:30.805 › Attempting to run server - 4 attempts left.
19:39:30.805 › Trying to start server at port [65281].
2024-12-19 19:39:30.937 Fiddler Everywhere[5111:49782] +[IMKClient subclass]: chose IMKClient_Modern
2024-12-19 19:39:30.937 Fiddler Everywhere[5111:49782] +[IMKInputSession subclass]: chose IMKInputSession_Modern
19:39:31.209 › Unable to start server process, closed with code: 252
19:39:31.210 › Attempt failed with Application port calculation failed. Contact support..
19:39:31.210 › Attempting to run server - 3 attempts left.
19:39:31.210 › Trying to start server at port [26878].
19:39:31.308 › Unable to start server process, closed with code: 252
19:39:31.308 › Attempt failed with Application port calculation failed. Contact support..
19:39:31.309 › Attempting to run server - 2 attempts left.
19:39:31.309 › Trying to start server at port [52093].
19:39:31.404 › Unable to start server process, closed with code: 252
19:39:31.405 › Attempt failed with Application port calculation failed. Contact support..
19:39:31.405 › Attempting to run server - 1 attempts left.
19:39:31.405 › Trying to start server at port [4537].
19:39:31.504 › Unable to start server process, closed with code: 252
19:39:31.504 › Attempt failed with Application port calculation failed. Contact support..
19:39:31.505 › Maximum number of attempts reached - quitting application.
19:39:31.505 › Unable to start the server, error is Maximum number of attempts reached - quitting application.
19:39:31.523 › [CPU information] The processor model is: Apple M1 Pro with number of cores: 8 and working at 2.4 GHz frequency
19:39:31.523 › [Memory information] The total amount of memory is 16384 MBs.
19:39:31.568 › PM: Fiddler Everywhere(5116):CPU 2.40%, MEM 51.95MB/0.32% / Fiddler Everywhere(5111):CPU 5.10%, MEM 139.38MB/0.85% / Fiddler Everywhere Helper(5113):CPU 0.40%, MEM 33.09MB/0.20% / Fiddler Everywhere Helper (GPU)(5112):CPU 1.30%, MEM 50.03MB/0.31% / Fiddler Everywhere Helper (Renderer)(5114):CPU 2.80%, MEM 100.56MB/0.61%
[2024-12-19T11:39:31.569Z] Warning: Error from HTTP request. FetchError: request to http://localhost:4537/fiddlerhub/negotiate?type=electron&negotiateVersion=1 failed, reason: .
[2024-12-19T11:39:31.569Z] Error: Failed to complete negotiation with the server: FetchError: request to http://localhost:4537/fiddlerhub/negotiate?type=electron&negotiateVersion=1 failed, reason: 
[2024-12-19T11:39:31.569Z] Error: Failed to start the connection: Error: Failed to complete negotiation with the server: FetchError: request to http://localhost:4537/fiddlerhub/negotiate?type=electron&negotiateVersion=1 failed, reason: 
19:39:31.569 › Error while starting default SignalR connection: Error: Failed to complete negotiation with the server: FetchError: request to http://localhost:4537/fiddlerhub/negotiate?type=electron&negotiateVersion=1 failed, reason: 
19:39:31.569 › Clearing the proxy settings to the main window.
[2024-12-19T11:39:31.569Z] Warning: Error from HTTP request. FetchError: request to http://localhost:4537/fiddlerhub/negotiate?negotiateVersion=1 failed, reason: .
[2024-12-19T11:39:31.570Z] Error: Failed to complete negotiation with the server: FetchError: request to http://localhost:4537/fiddlerhub/negotiate?negotiateVersion=1 failed, reason: 
[2024-12-19T11:39:31.570Z] Error: Failed to start the connection: Error: Failed to complete negotiation with the server: FetchError: request to http://localhost:4537/fiddlerhub/negotiate?negotiateVersion=1 failed, reason: 
19:39:31.570 › Error while starting response SignalR connection: Error: Failed to complete negotiation with the server: FetchError: request to http://localhost:4537/fiddlerhub/negotiate?negotiateVersion=1 failed, reason: 
19:39:31.570 › Unable to get default proxy info. Error: Failed to complete negotiation with the server: FetchError: request to http://localhost:4537/fiddlerhub/negotiate?type=electron&negotiateVersion=1 failed, reason: 
19:39:31.570 › Loading application in window.
19:39:31.571 › Getting the URL of Angular application.
19:39:31.574 › Starting the app without a deep link.
(node:5111) UnhandledPromiseRejectionWarning: Error: Failed to complete negotiation with the server: FetchError: request to http://localhost:4537/fiddlerhub/negotiate?type=electron&negotiateVersion=1 failed, reason: 
    at C5._getNegotiationResponse (/Applications/Fiddler Everywhere.app/Contents/Resources/app/out/main.js:260:48027)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async C5._startInternal (/Applications/Fiddler Everywhere.app/Contents/Resources/app/out/main.js:260:45951)
    at async C5.start (/Applications/Fiddler Everywhere.app/Contents/Resources/app/out/main.js:260:43709)
    at async e._startInternal (/Applications/Fiddler Everywhere.app/Contents/Resources/app/out/main.js:260:17213)
    at async e._startWithStateTransitions (/Applications/Fiddler Everywhere.app/Contents/Resources/app/out/main.js:260:16604)
(Use `Fiddler Everywhere --trace-warnings ...` to show where the warning was created)
(node:5111) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 7)
(node:5111) UnhandledPromiseRejectionWarning: Error: Failed to complete negotiation with the server: FetchError: request to http://localhost:4537/fiddlerhub/negotiate?type=electron&negotiateVersion=1 failed, reason: 
    at C5._getNegotiationResponse (/Applications/Fiddler Everywhere.app/Contents/Resources/app/out/main.js:260:48027)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async C5._startInternal (/Applications/Fiddler Everywhere.app/Contents/Resources/app/out/main.js:260:45951)
    at async C5.start (/Applications/Fiddler Everywhere.app/Contents/Resources/app/out/main.js:260:43709)
    at async e._startInternal (/Applications/Fiddler Everywhere.app/Contents/Resources/app/out/main.js:260:17213)
    at async e._startWithStateTransitions (/Applications/Fiddler Everywhere.app/Contents/Resources/app/out/main.js:260:16604)
(node:5111) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 8)
(node:5111) UnhandledPromiseRejectionWarning: Error: Failed to complete negotiation with the server: FetchError: request to http://localhost:4537/fiddlerhub/negotiate?type=electron&negotiateVersion=1 failed, reason: 
    at C5._getNegotiationResponse (/Applications/Fiddler Everywhere.app/Contents/Resources/app/out/main.js:260:48027)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async C5._startInternal (/Applications/Fiddler Everywhere.app/Contents/Resources/app/out/main.js:260:45951)
    at async C5.start (/Applications/Fiddler Everywhere.app/Contents/Resources/app/out/main.js:260:43709)
    at async e._startInternal (/Applications/Fiddler Everywhere.app/Contents/Resources/app/out/main.js:260:17213)
    at async e._startWithStateTransitions (/Applications/Fiddler Everywhere.app/Contents/Resources/app/out/main.js:260:16604)
(node:5111) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 9)
19:39:31.596 › ERR_FAILED (-2) loading 'file:///Applications/Fiddler%20Everywhere.app/Contents/Resources/app/out/WebServer/ClientApp/dist/index.html#./popout/blank'
@msojocs
Copy link
Owner

msojocs commented Dec 19, 2024

Open directory with Fiddler Everywhere 6.0.0\resources\app\out\WebServer and execute the command ./Fiddler.WebUi --port=16225 "--logDirectory=./Logs" --verboseLogging=false --logMaxSize=4194304 to see what happened.

@JobberRT
Copy link
Author

@msojocs

./Fiddler.WebUi --port=16225 "--logDirectory=./Logs" --verboseLogging=false --logMaxSize=4194304
Error while calculating application port! Contact Support

@JobberRT
Copy link
Author

Look deep into the logs, it seems that FE is trying to listen to some port for fiddlerhub, each retry will use a different/random port. After all retries failed, FE will try to connect to the last port it tried, and exit

@JobberRT
Copy link
Author

And I found a similar error log in here: #38

@msojocs
Copy link
Owner

msojocs commented Dec 20, 2024

The nessage is fake, your libopen file was not work.

@JobberRT
Copy link
Author

I was using YUI patch v1.1.3, tried both arm64 and arm64e, neither of them worked. Maybe I need to compile the libopen.dylib myself? I will give it a try when I got time, maybe later today.

@msojocs
Copy link
Owner

msojocs commented Dec 20, 2024

Did you do this? Maybe DYLD_INSERT_LIBRARIES not worked.

@msojocs
Copy link
Owner

msojocs commented Dec 20, 2024

image

Sorry this.

@msojocs
Copy link
Owner

msojocs commented Dec 20, 2024

Or try this to see what happened

#!/bin/bash
export DYLD_PRINT_LIBRARIES=1
export X=1
export DYLD_INSERT_LIBRARIES=./libopen.dylib
./Fiddler.WebUi1 $@

@JobberRT
Copy link
Author

Did you do this? Maybe DYLD_INSERT_LIBRARIES not worked.

Yes, I've followed the full steps

Or try this to see what happened

#!/bin/bash
export DYLD_PRINT_LIBRARIES=1
export X=1
export DYLD_INSERT_LIBRARIES=./libopen.dylib
./Fiddler.WebUi1 $@

Didn't help
image

@JobberRT
Copy link
Author

JobberRT commented Dec 20, 2024

Let me do a fresh reinstall and try again(I do it step by step, after finished one step, I wrote here):

  1. Uninstall FE and rm all the caches
  2. Install FE 6.0.0, open it, when FE runs to Welcome to Fiddler Everywhere, quit the app
  3. Download YUI patches V 1.1.3(ARM64, not ARM64e)
  4. Move YUI's fiddler.dylib to Frameworks/libfiddler.dylib (at macOS, it 's libfiddler.dylib rather than fiddler.dylib)
image
  1. Move YUI's libopen.dylib to app/out/WebServer
image
  1. Rename Fiddler.WebUi to Fiddler.WebUi1, and create a custom Fiddler.WebUi
    image

  2. chmod for Fiddler.WebUi and Fiddler.WebUi1 and libopen.dylib and libfiddler.dylib

  3. Create patch.json at app/out/WebServer

image
  1. Make original copys for app/out/main.js and app/out/ClientApp/dist/main-XXXX.js
image image
  1. Modify main.js and main.xxxx.js
image image image
  1. Copy servcer/file to app/out/file
image
  1. [OPTIONAL] Change auth identity

The error still here

image

@msojocs
Copy link
Owner

msojocs commented Dec 22, 2024

image

try to allow DYLD environment.

@JobberRT
Copy link
Author

I found the source page of this image: https://xz.aliyun.com/t/12803?time__1311=GqGxuDcD2DgQQGN4WxU2DAhEK74iI3KDkAeD

And according to this topic, the image should belongs to Apple's Hardened Runtime feature, which is a developer-side function, as a user, I cannot find a way to disable FE's Hardened Runtime.

@JobberRT
Copy link
Author

It seems that FE in macOS only allow JIT code

MacOS codesign -d --entitlements :- "/Applications/Fiddler Everywhere.app/Contents/MacOS/Fiddler Everywhere"
Executable=/Applications/Fiddler Everywhere.app/Contents/MacOS/Fiddler Everywhere
warning: Specifying ':' in the path is deprecated and will not work in a future release
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>com.apple.application-identifier</key><string>CHSQ3M3P37.com.progress-telerik.fiddler</string><key>com.apple.developer.networking.networkextension</key><array><string>app-proxy-provider-systemextension</string></array><key>com.apple.developer.system-extension.install</key><true/><key>com.apple.developer.team-identifier</key><string>CHSQ3M3P37</string><key>com.apple.security.application-groups</key><array><string>com.progress-telerik.fiddler</string></array><key>com.apple.security.automation.apple-events</key><true/><key>com.apple.security.cs.allow-jit</key><true/><key>com.apple.security.network.client</key><true/></dict></plist>

@msojocs
Copy link
Owner

msojocs commented Dec 23, 2024

maybe I need to find a new way for mac.

@JobberRT
Copy link
Author

OK, is there any plan for this?

@VegieIsCute
Copy link

Any updates on this? And I'd like to add some suggestions. It is possible to resign FE with your own certificate, and sign the libraries themselves with the same certificate? and as far as loading the library, executables have a section in the macho header filled with dylib_command structs. an example shown in the image below:

Screenshot 2025-01-02 at 10 42 02 PM

It would be possible to patch the library to load our lib, which would in turn load the original lib, acting as a proxy.

@msojocs
Copy link
Owner

msojocs commented Jan 8, 2025

I have found a new way to do it without cpp, I wrote the patch with C#.

I will write the document after some time.

@Sun-Wen-Jie
Copy link

I have found a new way to do it without cpp, I wrote the patch with C#.我找到了一种没有 cpp 的新方法,我用 C# 编写了补丁。

I will write the document after some time.我会在一段时间后写这份文件。

Cheer up author, looking forward to your good news. When I tried to modify it in the same way on my Mac, I received a prompt to move it to the trash can. I am very sad

@msojocs
Copy link
Owner

msojocs commented Jan 11, 2025

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

No branches or pull requests

4 participants