# Chrome Crashes with DOpus and Chinese Input Methods on Windows 11

**URL:** https://resource.dopus.com/t/chrome-crashes-with-dopus-and-chinese-input-methods-on-windows-11/50811
**Category:** Help & Support
**Tags:** bug-report
**Created:** [May 16, 2024, 8:33am UTC](https://resource.dopus.com/t/chrome-crashes-with-dopus-and-chinese-input-methods-on-windows-11/50811 "2024-05-16T08:33:46Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Cesaryuan](https://resource.dopus.com/letter_avatar_proxy/v4/letter/c/c67d28/32.png) [@Cesaryuan](https://resource.dopus.com/u/Cesaryuan)
#### Post date: [May 16, 2024, 8:33am UTC](https://resource.dopus.com/t/chrome-crashes-with-dopus-and-chinese-input-methods-on-windows-11/50811/1 "2024-05-16T08:33:47Z")

</div>

## Background

I apologize for the interruption, but here's the situation:

Since the release of Windows 11, Chinese users of Directory Opus (DOpus) have encountered a problem: using DOpus in conjunction with Sogou/WeChat input methods causes Chrome to crash. Here are a few posts from the Chinese internet that document this issue:

- [Does your Chrome crash frequently recently? - V2EX](https://www.v2ex.com/t/1022485)
- [A case study of Chrome crashes on Windows 11 – HafuHafu](https://hafuhafu.com/archives/win11-chrome-directory-opus-crash-by-sogou/)
- [Chrome crashes frequently on Windows 11, does this happen to you too? - V2EX](https://machbbs.com/v2ex/471030)

Upon investigation, the issue seems to stem from the ShellExecuteHooks registered by DOpus. Deleting this registry key prevents Chrome from crashing. Besides this method, there are a few other ways to prevent Chrome from crashing:

1. Delete the ShellExecuteHooks key from DOpus
2. Uninstall WeChat Input Method or Sogou Input Method
3. Revert to Windows 10

> Additionally, it's worth noting that these Chrome crashes occur in the following specific situations:
> 
> 1. Clicking "Open in Folder" in the download page
> 2. Any scenario that launches an external application (e.g., clicking "view in telegram" in Telegram)
> 
> In summary, the crashes happen when Chrome needs to call shell32.dll.

## Additional Information

I also attempted to use x64dbg to attach to chrome.exe and discovered the likely cause of the problem: `shell32.dll` accesses memory pointed to by a null pointer. The issue arises because a function in `dopuslib.dll` calls `TlsSetValue`, causing the TLS value read by shell32.dll to be incorrect. However, switching back to the built-in Windows input method results in an additional `TlsFree` step in `dopuslib.dll`, allowing it to work correctly.

## Steps to Reproduce

1. Install Windows 11
2. Install the official version of Chrome
3. Install DOpus
4. Install Sogou Input Method and switch to it
5. Open [https://t.me/IbDirectoryOpusGroup](https://t.me/IbDirectoryOpusGroup) in Chrome and repeatedly click the "View in telegram" button on the page

## Summary

Therefore, I would like to know if DOpus can try to resolve this issue, or at least provide information about the role of the ShellExecuteHooks registered by DOpus. If its role is not critical, I would recommend that Chinese users delete this registry key themselves. 😊

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [May 16, 2024, 8:39am UTC](https://resource.dopus.com/t/chrome-crashes-with-dopus-and-chinese-input-methods-on-windows-11/50811/2 "2024-05-16T08:39:04Z")

</div>

Chrome blocks third-party DLLs, including ours, from being loaded into its process, so I'm surprised the DLL is even being loaded in this situation.

What's the TLS index that's being set? Knowing that may make it easier to track down the code that's involved.

Not sure why it would act differently for different input methods, since we don't look for them or do anything different with them, as far as I know. Any idea why that would cause a change? Could the issue be in the input method's code instead?

---

<div class="post-metadata">

### Author: ![Cesaryuan](https://resource.dopus.com/letter_avatar_proxy/v4/letter/c/c67d28/32.png) [@Cesaryuan](https://resource.dopus.com/u/Cesaryuan)
#### Post date: [May 16, 2024, 8:45am UTC](https://resource.dopus.com/t/chrome-crashes-with-dopus-and-chinese-input-methods-on-windows-11/50811/3 "2024-05-16T08:45:26Z")

</div>

> [@Leo](#):
>
> Chrome blocks third-party DLLs, including ours, from being loaded into its process, so I'm surprised the DLL is even being loaded in this situation.

Regarding this point, it should be because chrome calls shell32.dll when executing the shell open operation, and then shell32 calls dopuslib.dll because of ShellExecuteHooks.

> [@Leo](#):
>
> What's the TLS index that's being set?

zero 0

> [@Leo](#):
>
> Not sure why it would act differently for different input methods, since we don't look for them or do anything different with them, as far as I know. Any idea why that would cause a change? Could the issue be in the input method's code instead?

I don’t know much about this. China’s major Internet companies don’t pay much attention to user feedback, so it’s hard to get help from them. That’s why I came to ask for your help. 😊

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [May 16, 2024, 4:17pm UTC](https://resource.dopus.com/t/chrome-crashes-with-dopus-and-chinese-input-methods-on-windows-11/50811/4 "2024-05-16T16:17:36Z")

</div>

We’ve had a look at our TLS code and can’t see anything wrong in it, unless we’ve missed something.

Is it possible the Input Method component is assuming TLS slot zero is free for it to use and not properly allocating a slot?

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [May 17, 2024, 1:16pm UTC](https://resource.dopus.com/t/chrome-crashes-with-dopus-and-chinese-input-methods-on-windows-11/50811/5 "2024-05-17T13:16:39Z")

</div>

In case it's that, we have a change coming in the next beta which makes our code skip over slot zero and always use another slot.

---

<div class="post-metadata">

### Author: ![Cesaryuan](https://resource.dopus.com/letter_avatar_proxy/v4/letter/c/c67d28/32.png) [@Cesaryuan](https://resource.dopus.com/u/Cesaryuan)
#### Post date: [May 17, 2024, 1:45pm UTC](https://resource.dopus.com/t/chrome-crashes-with-dopus-and-chinese-input-methods-on-windows-11/50811/6 "2024-05-17T13:45:30Z")

</div>

> [@Leo](#):
>
> Is it possible the Input Method component is assuming TLS slot zero is free for it to use and not properly allocating a slot?

For that, in x64dbg, I add a breakpoint on TlsSetValue. And I found the dopuslib is the only one dll calling TlsSetValue when Chrome crashes. So maybe the input method did something that makes the slot not freed correctly.

> [@Leo](#):
>
> In case it's that, we have a change coming in the next beta which makes our code skip over slot zero and always use another slot.

Thanks for your effort in solving this. Appreciate it. I will try the next beta release and report here.

---

<div class="post-metadata">

### Author: ![Cesaryuan](https://resource.dopus.com/letter_avatar_proxy/v4/letter/c/c67d28/32.png) [@Cesaryuan](https://resource.dopus.com/u/Cesaryuan)
#### Post date: [May 20, 2024, 9:10am UTC](https://resource.dopus.com/t/chrome-crashes-with-dopus-and-chinese-input-methods-on-windows-11/50811/7 "2024-05-20T09:10:47Z")

</div>

> [@Leo](#):
>
> In case it's that, we have a change coming in the next beta which makes our code skip over slot zero and always use another slot.

Hi, I have tried the latest version 13.6.2 and it still doesn't work.

However, I think I finally found the root cause of the problem. (Forgive me for researching dopuslib using disassembly tools)

The problem is that, for chrome.exe, the DllMain will return early. So the TlsAlloc will not be called.This makes the tlsindex ( global variable dword\_1801C0240) being the initial value which is 0.That is to say, DOpus uses a tlsindex allocated by chrome instead of the one allocated by itself.

After I change the string "chrome.exe" in x64dbg to something else. The bug disappears.

So, why is the initialization of chrome skipped when fdwReason==1?

 ![image](https://resource.dopus.com/uploads/default/original/3X/4/8/48ab0445e5d0f9d30d1dc0777659e8a5b1c44179.png)

---

<div class="post-metadata">

### Author: ![Cesaryuan](https://resource.dopus.com/letter_avatar_proxy/v4/letter/c/c67d28/32.png) [@Cesaryuan](https://resource.dopus.com/u/Cesaryuan)
#### Post date: [May 20, 2024, 10:16am UTC](https://resource.dopus.com/t/chrome-crashes-with-dopus-and-chinese-input-methods-on-windows-11/50811/8 "2024-05-20T10:16:04Z")

</div>

Maybe we should move the "chrome if" to outside.

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [May 20, 2024, 7:30pm UTC](https://resource.dopus.com/t/chrome-crashes-with-dopus-and-chinese-input-methods-on-windows-11/50811/9 "2024-05-20T19:30:19Z")

</div>

Thank you! Yes, that is definitely a bug. We'll get that fixed.

---

<div class="post-metadata">

### Author: ![HarveyChu](https://resource.dopus.com/letter_avatar_proxy/v4/letter/h/ea5d25/32.png) [@HarveyChu](https://resource.dopus.com/u/HarveyChu)
#### Post date: [June 9, 2024, 1:19pm UTC](https://resource.dopus.com/t/chrome-crashes-with-dopus-and-chinese-input-methods-on-windows-11/50811/10 "2024-06-09T13:19:28Z")

</div>

It seems that version 13.6.3 (Beta) has fixed this issue. Will the features of version 13.6. x beta be merged into version 13.7?

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [June 9, 2024, 1:24pm UTC](https://resource.dopus.com/t/chrome-crashes-with-dopus-and-chinese-input-methods-on-windows-11/50811/11 "2024-06-09T13:24:17Z")

</div>

> [@HarveyChu](#):
>
> Will the features of version 13.6. x beta be merged into version 13.7?

Yes, of course.
