#307 Game crashes randomly due to avcodec? (2.7.0)

Closed
opened 1 year ago by giabao06 · 22 comments
giabao06 commented 1 year ago

Hello, I'm testing the 2.7.0 patch. Game runs fine, no bans yet. However it seems like in this version the game crashes randomly. Doing anything (fight, progressing story, etc.) can result in the game crashing, apart from being in the title screen. Game logs show that the crash is caused by... avcodec?

Some more information:

Hello, I'm testing the 2.7.0 patch. Game runs fine, no bans yet. However it seems like in this version the game crashes randomly. Doing anything (fight, progressing story, etc.) can result in the game crashing, apart from being in the title screen. Game logs show that the crash is caused by... avcodec? Some more information: - Wine: wine-ge-custom 7-15 (I did not download the game from lutris) - DXVK-Async 1.10.1 from https://github.com/Sporif/dxvk-async/releases/tag/1.10.1 - Crash portion of log: https://pastebin.com/HxzzN40k
Krock commented 1 year ago
Owner

libavcodec is not necessary for video/audio playback; the game will work without too.

I do not see how this function could possibly fail (AV_PIX_FMT_NONE == -1, proper "NULL" terminator). Furthermore, the backtrace is suspiciously short,

A few things you could try (check after each):

  1. Disable the FPS unlocker and/or try a standard DXVK build.
  2. If no other games in your WINEPREFIX depend on libavcodec, (re)move or rename the file - same for the syswow64 directory.
  3. If nothing else helped, try a new WINEPREFIX to avoid long paths or moving, you could add the game directory as a separate drive in winecfg.
libavcodec is not necessary for video/audio playback; the game will work without too. I do not see how this function could possibly fail (`AV_PIX_FMT_NONE == -1`, proper "NULL" terminator). Furthermore, the backtrace is suspiciously short, A few things you could try (check after each): 1. Disable the FPS unlocker and/or try a standard DXVK build. 2. If no other games in your WINEPREFIX depend on libavcodec, (re)move or rename the file - same for the syswow64 directory. 3. If nothing else helped, try a new WINEPREFIX to avoid long paths or moving, you could add the game directory as a separate drive in `winecfg`.
giabao06 commented 1 year ago
Poster

Interestingly enough, the issue seems to have fixed itself... as mysteriously as it appeared. There are no libavcodec in syswow64, the issue appeared only as recently as I just happen to patch the game to 2.7;

I tried dxvk-async with 2.6 already, no issues there. For now I will close this

Interestingly enough, the issue seems to have fixed itself... as mysteriously as it appeared. There are no libavcodec in syswow64, the issue appeared only as recently as I just happen to patch the game to 2.7; I tried dxvk-async with 2.6 already, no issues there. For now I will close this
giabao06 commented 1 year ago
Poster

Reopen because it appeared again, but this time the logging

  1. Shows that the game is trying to upload something to mihoyo servers
  2. Shows that it is still caused by avcodec, but this time with a different stacktrace (still very short tho).

Crash portion: https://pastebin.com/Msrb1t5w

Edit: was playing the 2.7 event when this happened. The chances of it crashing increases when in event, it seems. Will test with standard dxvk later

Reopen because it appeared again, but this time the logging 1. Shows that the game is trying to upload something to mihoyo servers 2. Shows that it is still caused by avcodec, but this time with a different stacktrace (still very short tho). Crash portion: https://pastebin.com/Msrb1t5w Edit: was playing the 2.7 event when this happened. The chances of it crashing increases when in event, it seems. Will test with standard dxvk later
infine commented 1 year ago

Do you run the game though lutris?

GloriousEggRoll said that his builds (wine-ge and proton-ge) are designed to run within lutris/steam environment respectively, and running them standalone may result in unforseen consequences`

Do you run the game though lutris? GloriousEggRoll said that his builds (wine-ge and proton-ge) are designed to run within lutris/steam environment respectively, and running them standalone may result in unforseen consequences`
giabao06 commented 1 year ago
Poster

@infine yes ofc. Also if it's a concern then the wineprefix is a separate one used only for genshin.

@infine yes ofc. Also if it's a concern then the wineprefix is a separate one used only for genshin.
infine commented 1 year ago

There are no libavcodec in syswow64

I think lutris drags its own runtime with it including ffmpeg, so the relevant libavcodec should be not in syswow64, but in lutris runtime (~/.local/share/lutris/runtime...).

I see there are toggles in wine settings in lutris. Maybe fiddle with lutris runtime and prefer system libraries switches and see what happens?

>There are no libavcodec in syswow64 I think lutris drags its own runtime with it including ffmpeg, so the relevant libavcodec should be not in syswow64, but in lutris runtime (~/.local/share/lutris/runtime...). I see there are toggles in wine settings in lutris. Maybe fiddle with lutris runtime and prefer system libraries switches and see what happens?
giabao06 commented 1 year ago
Poster

Tried disabling lutris runtime, everything was fine until I decided to create a few things in the teapot during which the game decided to crash again, concerning avcodec with stacktrace being 0x00000000564D5868 (avcodec-58) avpriv_h264_has_num_reorder_frames. Weird knowing that avcodec isn't needed for game functionality. Also, fighting, progressing world quests etc. did not lead to a crash this time.

This is the only time where the creation of items in the teapot crashed the game. Last night I created maybe quite a few items there, no issues or crashes. Still not tested with normal dxvk.

Edit: might it be the AMD FSR implemented in GloriousEggroll's wine? I had that enabled ever since I knew about it. Before that I used system wine and manual launch (and also normal dxvk), no crashes. FSR was working fine with 2.6; it only crashed in 2.7. The crashes were more frequent right after I patched the game.

Tried disabling lutris runtime, everything was fine until I decided to create a few things in the teapot during which the game decided to crash again, concerning avcodec with stacktrace being `0x00000000564D5868 (avcodec-58) avpriv_h264_has_num_reorder_frames`. Weird knowing that avcodec isn't needed for game functionality. Also, fighting, progressing world quests etc. did not lead to a crash this time. This is the only time where the creation of items in the teapot crashed the game. Last night I created maybe quite a few items there, no issues or crashes. Still not tested with normal dxvk. Edit: might it be the AMD FSR implemented in GloriousEggroll's wine? I had that enabled ever since I knew about it. Before that I used system wine and manual launch (and also normal dxvk), no crashes. FSR was working fine with 2.6; it only crashed in 2.7. The crashes were more frequent right after I patched the game.
giabao06 commented 1 year ago
Poster

Just had a game with standard dxvk, no crashes so far. If (edit: I can confirm that) the problem lies at dxvk async I will open a bug report there.

Just had a game with standard dxvk, no crashes so far. If (edit: I can confirm that) the problem lies at dxvk async I will open a bug report there.
giabao06 commented 1 year ago
Poster

Welp standard dxvk crashed today. Did not crash before Yelan and Ei bugfix update. This time the log does say something about shaders or something... but still avcodec.

Crash portion: https://pastebin.com/Av5eq8nt

Welp standard dxvk crashed today. Did not crash before Yelan and Ei bugfix update. This time the log does say something about shaders or something... but still avcodec. Crash portion: https://pastebin.com/Av5eq8nt
notahuman commented 1 year ago

For what it's worth I've never had this crash before, and I've played through all available 2.7 content (event/story, Abyss 12-3) with FSR enabled on Wine-GE-Proton 7-12 standalone. The ingame videos also play fine and teapot crafting works.

Arch, nvidia 515.43.04, dxvk-async 1.10.1, clean wineprefix.

Perhaps this change from 7-15 might be relevant (ffmpeg provides libavcodec):

  • ffmpeg and gstreamer libraries updated in lutris build to match proton
For what it's worth I've never had this crash before, and I've played through all available 2.7 content (event/story, Abyss 12-3) with FSR enabled on Wine-GE-Proton 7-12 standalone. The ingame videos also play fine and teapot crafting works. Arch, nvidia 515.43.04, dxvk-async 1.10.1, clean wineprefix. Perhaps this change from 7-15 might be relevant (ffmpeg provides libavcodec): * ffmpeg and gstreamer libraries updated in lutris build to match proton
giabao06 commented 1 year ago
Poster

Will test with the latest wine-ge-proton tomorrow (+07). Thanks for the suggestion

Will test with the latest wine-ge-proton tomorrow (+07). Thanks for the suggestion
notahuman commented 1 year ago

I would recommend trying version 7-12 first, you've already mentioned that you're running 7-15, so it could be a regression of some sort.

Anyway that's just a guess, good luck.

Version 7-16 does have a WMV video related fix but I'm not sure if the game uses WMV format. Worth a try regardless.

I would recommend trying version 7-12 first, you've already mentioned that you're running 7-15, so it could be a regression of some sort. Anyway that's just a guess, good luck. Version 7-16 does have a WMV video related fix but I'm not sure if the game uses WMV format. Worth a try regardless.
giabao06 commented 1 year ago
Poster

wine-ge-custom 7-12 + dxvk-async 1.10.1 crashed with avcodec again. Was completing Tsurumi Island quest. Also seems like dxvk-async crashes more often than normal dxvk.

Btw I forgot to tell this but I'm currently using Mint 20.3 and amdgpu (R5 3500, Vega 8). Had pipewire installed if that's of any use.

Crash portion: https://pastebin.com/T2CkzKNW

wine-ge-custom 7-12 + dxvk-async 1.10.1 crashed with avcodec again. Was completing Tsurumi Island quest. Also seems like dxvk-async crashes more often than normal dxvk. Btw I forgot to tell this but I'm currently using Mint 20.3 and amdgpu (R5 3500, Vega 8). Had pipewire installed if that's of any use. Crash portion: https://pastebin.com/T2CkzKNW
giabao06 commented 1 year ago
Poster

Interestingly enough, before the crashes, the logs seem to indicate something about AsyncUploadManager unloading bundles or something. For example (recent crash):

AsyncUploadManager: Failed to close file archive:/CAB-f329349e1920f93c00a19b1c3600bdba/CAB-f329349e1920f93c00a19b1c3600bdba.resS. Ensure all async operations are complete before unloading bundles.
MoleMole.LoadedBundle:BeforeRecycle()
MoleMole.ObjectPoolOfReusable`1:Deallocate(T)
MoleMole.LoadedResourcesCollection:UnloadBundle(Int32)
UnityEngine.DelegateCallback:Invoke(Int32)
MoleMole.MResLruList`1:RetireAll()
MoleMole.AssetBundleExternalResourceProvider:UnloadTick()
IGFMMIJIJKB:Invoke()

[ line 506] 
(Filename:  Line: 506)

AsyncUploadManager: Failed to close file archive:/CAB-a7e2b9069e4bd809de9d2a309917d5ac/CAB-a7e2b9069e4bd809de9d2a309917d5ac.resS. Ensure all async operations are complete before unloading bundles.
MoleMole.LoadedBundle:BeforeRecycle()
MoleMole.ObjectPoolOfReusable`1:Deallocate(T)
MoleMole.LoadedResourcesCollection:UnloadBundle(Int32)
UnityEngine.DelegateCallback:Invoke(Int32)
MoleMole.MResLruList`1:RetireAll()
MoleMole.AssetBundleExternalResourceProvider:UnloadTick()
IGFMMIJIJKB:Invoke()

[ line 506] 
(Filename:  Line: 506)

AsyncUploadManager: Failed to close file archive:/CAB-e82889204daed5edcab4ab7a78c1ae47/CAB-e82889204daed5edcab4ab7a78c1ae47.resS. Ensure all async operations are complete before unloading bundles.
MoleMole.LoadedBundle:BeforeRecycle()
MoleMole.ObjectPoolOfReusable`1:Deallocate(T)
MoleMole.LoadedResourcesCollection:UnloadBundle(Int32)
UnityEngine.DelegateCallback:Invoke(Int32)
MoleMole.MResLruList`1:RetireAll()
MoleMole.AssetBundleExternalResourceProvider:UnloadTick()
IGFMMIJIJKB:Invoke()

[ line 506] 
(Filename:  Line: 506)

AsyncUploadManager: Failed to close file archive:/CAB-d3a2b9fc7ac6af327bd9ca87b5bb3da7/CAB-d3a2b9fc7ac6af327bd9ca87b5bb3da7.resS. Ensure all async operations are complete before unloading bundles.
MoleMole.LoadedBundle:BeforeRecycle()
MoleMole.ObjectPoolOfReusable`1:Deallocate(T)
MoleMole.LoadedResourcesCollection:UnloadBundle(Int32)
UnityEngine.DelegateCallback:Invoke(Int32)
MoleMole.MResLruList`1:RetireAll()
MoleMole.AssetBundleExternalResourceProvider:UnloadTick()
IGFMMIJIJKB:Invoke()

[ line 506] 
(Filename:  Line: 506)

AsyncUploadManager: Failed to close file archive:/CAB-0f9bac33d782ac0abe4a6256aa1480e1/CAB-0f9bac33d782ac0abe4a6256aa1480e1.resS. Ensure all async operations are complete before unloading bundles.
MoleMole.LoadedBundle:BeforeRecycle()
MoleMole.ObjectPoolOfReusable`1:Deallocate(T)
MoleMole.LoadedResourcesCollection:UnloadBundle(Int32)
UnityEngine.DelegateCallback:Invoke(Int32)
MoleMole.MResLruList`1:RetireAll()
MoleMole.AssetBundleExternalResourceProvider:UnloadTick()
IGFMMIJIJKB:Invoke()

[ line 506] 
(Filename:  Line: 506)

AsyncUploadManager: Failed to close file archive:/CAB-029fbc5294fbbdc9ecc6a0ae5fd463de/CAB-029fbc5294fbbdc9ecc6a0ae5fd463de.resS. Ensure all async operations are complete before unloading bundles.
MoleMole.LoadedBundle:BeforeRecycle()
MoleMole.ObjectPoolOfReusable`1:Deallocate(T)
MoleMole.LoadedResourcesCollection:UnloadBundle(Int32)
UnityEngine.DelegateCallback:Invoke(Int32)
MoleMole.MResLruList`1:RetireAll()
MoleMole.AssetBundleExternalResourceProvider:UnloadTick()
IGFMMIJIJKB:Invoke()
Interestingly enough, before the crashes, the logs seem to indicate something about AsyncUploadManager unloading bundles or something. For example (recent crash): ``` AsyncUploadManager: Failed to close file archive:/CAB-f329349e1920f93c00a19b1c3600bdba/CAB-f329349e1920f93c00a19b1c3600bdba.resS. Ensure all async operations are complete before unloading bundles. MoleMole.LoadedBundle:BeforeRecycle() MoleMole.ObjectPoolOfReusable`1:Deallocate(T) MoleMole.LoadedResourcesCollection:UnloadBundle(Int32) UnityEngine.DelegateCallback:Invoke(Int32) MoleMole.MResLruList`1:RetireAll() MoleMole.AssetBundleExternalResourceProvider:UnloadTick() IGFMMIJIJKB:Invoke() [ line 506] (Filename: Line: 506) AsyncUploadManager: Failed to close file archive:/CAB-a7e2b9069e4bd809de9d2a309917d5ac/CAB-a7e2b9069e4bd809de9d2a309917d5ac.resS. Ensure all async operations are complete before unloading bundles. MoleMole.LoadedBundle:BeforeRecycle() MoleMole.ObjectPoolOfReusable`1:Deallocate(T) MoleMole.LoadedResourcesCollection:UnloadBundle(Int32) UnityEngine.DelegateCallback:Invoke(Int32) MoleMole.MResLruList`1:RetireAll() MoleMole.AssetBundleExternalResourceProvider:UnloadTick() IGFMMIJIJKB:Invoke() [ line 506] (Filename: Line: 506) AsyncUploadManager: Failed to close file archive:/CAB-e82889204daed5edcab4ab7a78c1ae47/CAB-e82889204daed5edcab4ab7a78c1ae47.resS. Ensure all async operations are complete before unloading bundles. MoleMole.LoadedBundle:BeforeRecycle() MoleMole.ObjectPoolOfReusable`1:Deallocate(T) MoleMole.LoadedResourcesCollection:UnloadBundle(Int32) UnityEngine.DelegateCallback:Invoke(Int32) MoleMole.MResLruList`1:RetireAll() MoleMole.AssetBundleExternalResourceProvider:UnloadTick() IGFMMIJIJKB:Invoke() [ line 506] (Filename: Line: 506) AsyncUploadManager: Failed to close file archive:/CAB-d3a2b9fc7ac6af327bd9ca87b5bb3da7/CAB-d3a2b9fc7ac6af327bd9ca87b5bb3da7.resS. Ensure all async operations are complete before unloading bundles. MoleMole.LoadedBundle:BeforeRecycle() MoleMole.ObjectPoolOfReusable`1:Deallocate(T) MoleMole.LoadedResourcesCollection:UnloadBundle(Int32) UnityEngine.DelegateCallback:Invoke(Int32) MoleMole.MResLruList`1:RetireAll() MoleMole.AssetBundleExternalResourceProvider:UnloadTick() IGFMMIJIJKB:Invoke() [ line 506] (Filename: Line: 506) AsyncUploadManager: Failed to close file archive:/CAB-0f9bac33d782ac0abe4a6256aa1480e1/CAB-0f9bac33d782ac0abe4a6256aa1480e1.resS. Ensure all async operations are complete before unloading bundles. MoleMole.LoadedBundle:BeforeRecycle() MoleMole.ObjectPoolOfReusable`1:Deallocate(T) MoleMole.LoadedResourcesCollection:UnloadBundle(Int32) UnityEngine.DelegateCallback:Invoke(Int32) MoleMole.MResLruList`1:RetireAll() MoleMole.AssetBundleExternalResourceProvider:UnloadTick() IGFMMIJIJKB:Invoke() [ line 506] (Filename: Line: 506) AsyncUploadManager: Failed to close file archive:/CAB-029fbc5294fbbdc9ecc6a0ae5fd463de/CAB-029fbc5294fbbdc9ecc6a0ae5fd463de.resS. Ensure all async operations are complete before unloading bundles. MoleMole.LoadedBundle:BeforeRecycle() MoleMole.ObjectPoolOfReusable`1:Deallocate(T) MoleMole.LoadedResourcesCollection:UnloadBundle(Int32) UnityEngine.DelegateCallback:Invoke(Int32) MoleMole.MResLruList`1:RetireAll() MoleMole.AssetBundleExternalResourceProvider:UnloadTick() IGFMMIJIJKB:Invoke() ```
Krock commented 1 year ago
Owner

Failed to close file archive also appears during normal gameplay, hence I believe this "by-catch" caused by handling the actual crash.

Nevertheless, you could run the repair feature (integrity check) a launcher that supports it to ensure there are no corrupted or missing files. If you are using the official launcher, you will have to re-apply the patch afterwards.

Such errors could have vastly different causes, even including driver updates or conflicts. For example, ensure that amdvlk (common Arch Linux + Steam issue) and nVIDIA graphics driver packages are not installed.

`Failed to close file archive` also appears during normal gameplay, hence I believe this "by-catch" caused by handling the actual crash. Nevertheless, you could run the repair feature (integrity check) a launcher that supports it to ensure there are no corrupted or missing files. If you are using the official launcher, you will have to re-apply the patch afterwards. Such errors could have vastly different causes, even including driver updates or conflicts. For example, ensure that amdvlk (common Arch Linux + Steam issue) and nVIDIA graphics driver packages are not installed.
giabao06 commented 1 year ago
Poster

The file verification on the game's login screen actually said that there are some missing files. After kicking me out to the start game screen again, the game tries to verify file integrity once more... And even that did not escape the crash. This is the first time where the game crashes at the title screen and it is still caused by avcodec.

Edit: the game did retry and complete verifying, had a session for ~30-45 mins, no crashes yet.

The file verification on the game's login screen actually said that there are some missing files. After kicking me out to the start game screen again, the game tries to verify file integrity once more... And even that did not escape the crash. This is the first time where *the game crashes at the title screen* and it is still caused by avcodec. Edit: the game did retry and complete verifying, had a session for ~30-45 mins, no crashes yet.
giabao06 commented 1 year ago
Poster

How weird... I switched back to wine-ge-custom 7-15 and the game crashed again. This time, no stacktrace is provided.

Edit: yes the log does say crash, but then ends there. I will continue to catch any interesting crashes till the end of 2.7

How weird... I switched back to wine-ge-custom 7-15 and the game crashed again. This time, no stacktrace is provided. Edit: yes the log does say crash, but then ends there. I will continue to catch any interesting crashes till the end of 2.7
giabao06 commented 1 year ago
Poster

Just switched back to 7-12, game crashed. This time I'm giving the full log.

Log: https://pastebin.com/WTjDfnBW

Just switched back to 7-12, game crashed. This time I'm giving the full log. Log: https://pastebin.com/WTjDfnBW
Krock commented 1 year ago
Owner

Interestingly the backtraces mention the very same virtual address as the crash reported in #309. It's unlikely to hit the same address with different loaded DLLs (and hence address space) - as if UnityPlayer would jumped to a fixed address where no such function is found. If that's true, neither zfproxyweb nor avcodec are the problem, but UnityPlayer itself.

To my latest knowledge, the other crash was reported on nVIDIA, hence eliminates the graphics driver itself as common factor.

Interestingly the backtraces mention the very same virtual address as the crash reported in #309. It's unlikely to hit the same address with different loaded DLLs (and hence address space) - as if UnityPlayer would jumped to a fixed address where no such function is found. If that's true, neither zfproxyweb nor avcodec are the problem, but UnityPlayer itself. To my latest knowledge, the other crash was reported on nVIDIA, hence eliminates the graphics driver itself as common factor.
giabao06 commented 1 year ago
Poster

Interesting information indeed. Anyways, knowing that avcodec is not needed for Genshin to work, is it okay to just remove the dll in system32 (or remove the library override in winecfg) to check? As said before, the prefix is only used for Genshin, and was transfered from system wine to wine-ge-custom.

The system wineprefix does not contain avcodec as a dll override. Image below is winecfg of the Genshin wineprefix

Interesting information indeed. Anyways, knowing that avcodec is *not needed* for Genshin to work, is it okay to just remove the dll in system32 (or remove the library override in `winecfg`) to check? As said before, the prefix is only used for Genshin, and was transfered from system wine to wine-ge-custom. The system wineprefix does not contain avcodec as a dll override. Image below is winecfg of the Genshin wineprefix
giabao06 commented 1 year ago
Poster

Closing issue, deleting avcodec-58.dll in the wineprefix's system32 solved it. I also noticed better game performance after deleting.

Closing issue, deleting avcodec-58.dll in the wineprefix's system32 solved it. I also noticed better game performance after deleting.
notahuman commented 1 year ago

Hmm, avcodec DLL is not installed by default for me, and it's not in any of my wineprefixes.

If it's not in a fully standalone wineprefix, then it must have been installed by something else (winetricks or lutris?).

I haven't used Lutris at any point and the only wineprefix modifications I have are DXVK, corefonts, and usetakefocus=n.

Hmm, avcodec DLL is not installed by default for me, and it's not in any of my wineprefixes. If it's not in a fully standalone wineprefix, then it must have been installed by something else (winetricks or lutris?). I haven't used Lutris at any point and the only wineprefix modifications I have are DXVK, `corefonts`, and `usetakefocus=n`.
Sign in to join this conversation.
Loading...
Cancel
Save
There is no content yet.