Closed yang4515 closed 11 months ago
This is a regression from #8042.
The panic occurs line 191 when line
is empty and debug
logging is enabled:
The error occurs when read_line
returns an error (e.g. invalid UTF-8 character).
@yang4515 As you were unable to reproduce the issue with a demo, could you please provide us with the (verbose) logs before the failure? At least a few lines, including one with the words Running
and Command
...
@olivierlemasle The last command executed was bundle_dmg.sh, the difference between the demo and my application is that the demo is not signed, this issue may be related to the signature.
Running [tauri_bundler::bundle::common] Command `security list-keychain -d user -s /Users/dev/Library/Keychains/login.keychain-db /private/var/folders/dv/xxx/T/t-YDPWjo/1.keychain tauri-build.keychain`
Info [tauri_bundler::bundle::macos::sign] Signing app bundle...
Signing [tauri_bundler::bundle::macos::sign] /var/folders/dv/xxx/T/.tmpkZZROQ/AppName.zip
Running [tauri_bundler::bundle::common] Command `security delete-keychain tauri-build.keychain`
Notarizing [tauri_bundler::bundle::macos::sign] ~/appDir/target/release/bundle/macos/AppName.app
Running [tauri_bundler::bundle::common] Command `xcrun stapler staple -v AppName.app`
Processing: ~/appDir/target/release/bundle/macos/AppName.app
Domain is api.apple-cloudkit.com
Response is <NSHTTPURLResponse: 0x600002ddf380> { URL: https://api.apple-cloudkit.com/database/1/com.apple.gk.ticket-delivery/production/public/records/lookup } { Status Code: 200, Headers {
...
} }
Size of data is 2877
JSON Response is: {
...
}
Downloaded ticket has been stored at file:///var/folders/dv/xxx/T/xxx.ticket.
Processing: ~/appDir/target/release/bundle/macos/AppName.app
Properties are {
NSURLIsDirectoryKey = 1;
NSURLIsPackageKey = 1;
NSURLIsSymbolicLinkKey = 0;
NSURLLocalizedTypeDescriptionKey = Application;
NSURLTypeIdentifierKey = "com.apple.application-bundle";
"_NSURLIsApplicationKey" = 1;
}
Props are {
...
}
The staple and validate action worked!
Bundling [tauri_bundler::bundle::macos::dmg] AppName.app
Running [tauri_bundler::bundle::macos::dmg] bundle_dmg.sh
Running [tauri_bundler::bundle::common] Command `~/appDir/target/release/bundle/dmg/bundle_dmg.sh xxx`
+ WINX=10
+ WINY=60
+ WINW=500
+ WINH=350
+ ICON_SIZE=128
+ TEXT_SIZE=16
+ FORMAT=UDZO
+ ADD_FILE_SOURCES=()
+ ADD_FILE_TARGETS=()
+ IMAGEKEY=
+ HDIUTIL_VERBOSITY=
+ SANDBOX_SAFE=0
+ BLESS=0
+ SKIP_JENKINS=0
+ MAXIMUM_UNMOUNTING_ATTEMPTS=3
+ POSITION_CLAUSE=
+ HIDING_CLAUSE=
+ [[ - = \- ]]
+ case $1 in
thread '<unnamed>' panicked at /Users/dev/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tauri-bundler-1.4.5/src/bundle/common.rs:191:46:
byte index 18446744073709551615 is out of bounds of ``
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at /Users/dev/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/tauri-bundler-1.4.5/src/bundle/common.rs:200:56:
called `Result::unwrap()` on an `Err` value: PoisonError { .. }
child_process.js:866
throw err;
Thanks @yang4515, this is not related to signature but to product name.
I noticed that the error occured when normally the product name is printed, so I managed to reproduce the issue with productName emoji-🍎
:
Bundling [tauri_bundler::bundle::macos::dmg] emoji-🍎_0.0.0_x64.dmg (/Users/runner/work/demo-stable/demo-stable/src-tauri/target/release/bundle/dmg/emoji-🍎_0.0.0_x64.dmg)
Running [tauri_bundler::bundle::macos::dmg] bundle_dmg.sh
Running [tauri_bundler::bundle::common] Command `/Users/runner/work/demo-stable/demo-stable/src-tauri/target/release/bundle/dmg/bundle_dmg.sh --volname emoji-🍎 --icon emoji-🍎.app 180 170 --app-drop-link 480 170 --window-size 660 400 --hide-extension emoji-🍎.app --volicon /Users/runner/work/demo-stable/demo-stable/src-tauri/target/release/bundle/dmg/icon.icns --skip-jenkins emoji-🍎_0.0.0_x64.dmg emoji-🍎.app`
+ WINX=10
+ WINY=60
+ WINW=500
+ WINH=350
+ ICON_SIZE=128
+ TEXT_SIZE=16
+ FORMAT=UDZO
+ ADD_FILE_SOURCES=()
+ ADD_FILE_TARGETS=()
+ IMAGEKEY=
+ HDIUTIL_VERBOSITY=
+ SANDBOX_SAFE=0
+ BLESS=0
+ SKIP_JENKINS=0
+ MAXIMUM_UNMOUNTING_ATTEMPTS=3
+ POSITION_CLAUSE=
+ HIDING_CLAUSE=
+ [[ - = \- ]]
+ case $1 in
thread '<unnamed>' panicked at /Users/runner/work/tauri/tauri/tooling/bundler/src/bundle/common.rs:191:46:
byte index 18446744073709551615 is out of bounds of ``
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at /Users/runner/work/tauri/tauri/tooling/bundler/src/bundle/common.rs:200:56:
called `Result::unwrap()` on an `Err` value: PoisonError { .. }
Of course you removed the product name from the logs, but I guess it included a Chinese character or another 2-bytes character such as an emoji. Am I right?
I'll now be able to submit a PR to fix this issue.
@olivierlemasle Yes, the product name includes Chinese characters.
Describe the bug
When I add "--verbose" parameter, I got:
And everything returns to normal when I remove the --verbose parameter. I was unable to reproduce the issue using the official demo. The log provides the file and the line number where the error occurred. I am not familiar with Rust, can you provide some help?
Reproduction
No response
Expected behavior
No response
Platform and versions
Stack trace
No response
Additional context
No response