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

Turbo crashes #9016

Closed
1 task done
ahkhanjani opened this issue Aug 15, 2024 · 7 comments · Fixed by #9032
Closed
1 task done

Turbo crashes #9016

ahkhanjani opened this issue Aug 15, 2024 · 7 comments · Fixed by #9032
Assignees
Labels
kind: bug Something isn't working

Comments

@ahkhanjani
Copy link

ahkhanjani commented Aug 15, 2024

Verify canary release

  • I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

cannot provide as I don't know what causes the problem

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Windows

Which canary version will you have in your reproduction?

2.0.13-canary.1

Describe the Bug

It once crashed saying "could not connect to UI thread" logging this file:

"name" = "turbo"
"operating_system" = "Windows 10.0.22631 (Windows 11 Enterprise) [64-bit]"
"crate_version" = "2.0.13"
"explanation" = '''
file 'crates\turborepo-ui\src\tui\task.rs' at line 137
'''
"cause" = "called `Option::unwrap()` on a `None` value"
"method" = "Panic"
"backtrace" = """

   0: 0x7ff7fc4572ce - git_oidarray_dispose
   1: 0x7ff7fc258de2 - <unresolved>
   2: 0x7ff7fc26633f - <unresolved>
   3: 0x7ff7fbb5c992 - <unresolved>
   4: 0x7ff7fb6122e7 - <unresolved>
   5: 0x7ff7fb620048 - <unresolved>
   6: 0x7ff7fb5b59bd - <unresolved>
   7: 0x7ffbe9e4257d - BaseThreadInitThunk
   8: 0x7ffbeabaaf28 - RtlUserThreadStart"""

And crashed again another time saying something else I can't remember and logged this file:

"name" = "turbo"
"operating_system" = "Windows 10.0.22631 (Windows 11 Enterprise) [64-bit]"
"crate_version" = "2.0.13"
"explanation" = '''
file 'crates\turborepo-ui\src\tui\app.rs' at line 411
'''
"cause" = "called `Option::unwrap()` on a `None` value"
"method" = "Panic"
"backtrace" = """

   0: 0x7ff7fc4572ce - git_oidarray_dispose
   1: 0x7ff7fc2515dd - <unresolved>
   2: 0x7ff7fbb5c8c2 - <unresolved>
   3: 0x7ff7fb6122e7 - <unresolved>
   4: 0x7ff7fb620048 - <unresolved>
   5: 0x7ff7fb5b59bd - <unresolved>
   6: 0x7ffbe9e4257d - BaseThreadInitThunk
   7: 0x7ffbeabaaf28 - RtlUserThreadStart"""

It does run the project without change sometimes and randomly crashes again. So I assume it's not the code's fault.

UPDATE: The second error message is internal errors encountered: receiver dropped and occurs when saving with the watcher on. Sorry for the vague explanation and not providing an example but I thought it's better I at least report this. I suspect this is a bug in the watcher. I use turbo watch (and not tsc watch).

Expected Behavior

To Reproduce

Additional context

I use these experimental Next config options:

experimental: {
    turbo: { rules: { "*.svg": { loaders: ["@svgr/webpack"], as: "*.js" } } },
    reactCompiler: true,
}
@ahkhanjani ahkhanjani added kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage labels Aug 15, 2024
@kyeshmz
Copy link

kyeshmz commented Aug 16, 2024

Same but in different OS

"name" = "turbo"
"operating_system" = "Mac OS 14.5.0 [64-bit]"
"crate_version" = "2.0.14"
"explanation" = """
file 'crates/turborepo-ui/src/tui/task.rs' at line 137
"""
"cause" = "called `Option::unwrap()` on a `None` value"
"method" = "Panic"
"backtrace" = """

   0: 0x104257178 - __mh_execute_header
   1: 0x10425cec4 - __mh_execute_header
   2: 0x104df98dc - __mh_execute_header
   3: 0x104a9c890 - __mh_execute_header
   4: 0x1046142fc - __mh_execute_header
   5: 0x104620210 - __mh_execute_header
   6: 0x1045d821c - __mh_execute_header
   7: 0x19017af94 - __pthread_joiner_wake"""

@tomnoir
Copy link

tomnoir commented Aug 16, 2024

Same issue here with turbo 2.0.14 and no experimental rules. Happens on Dev server after saving a modified file, yet just sometimes (always the same file). Could not find a pattern which kind of change causes this to happen.

@KimpShreyan
Copy link

KimpShreyan commented Aug 16, 2024

Same here

"name" = "turbo"
"operating_system" = "Windows 10.0.22631 (Windows 11 CoreSingleLanguage) [64-bit]"
"crate_version" = "2.0.14"
"explanation" = '''
file 'crates\turborepo-ui\src\tui\task.rs' at line 137
'''
"cause" = "called `Option::unwrap()` on a `None` value"
"method" = "Panic"
"backtrace" = """

   0: 0x7ff6b75a868e - git_oidarray_dispose
   1: 0x7ff6b73a9da2 - <unresolved>
   2: 0x7ff6b73b849f - <unresolved>
   3: 0x7ff6b713d42c - <unresolved>
   4: 0x7ff6b67622e7 - <unresolved>
   5: 0x7ff6b6770048 - <unresolved>
   6: 0x7ff6b67059bd - <unresolved>
   7: 0x7ffd3bb5257d - BaseThreadInitThunk
   8: 0x7ffd3d58af28 - RtlUserThreadStart"""

@ahkhanjani
Copy link
Author

Disabling tui seems to stop the crashing

@PatrykKuniczak
Copy link

Also on Windows 11

@chris-olszewski chris-olszewski self-assigned this Aug 19, 2024
@chris-olszewski chris-olszewski removed the needs: triage New issues get this label. Remove it after triage label Aug 19, 2024
@njbair
Copy link

njbair commented Aug 19, 2024

I'm getting this too:

"name" = "turbo"
"operating_system" = "Mac OS 14.5.0 [64-bit]"
"crate_version" = "2.0.14"
"explanation" = """
file 'crates/turborepo-ui/src/tui/task.rs' at line 137
"""
"cause" = "called `Option::unwrap()` on a `None` value"
"method" = "Panic"
"backtrace" = """

   0: 0x10450b178 - __mh_execute_header
   1: 0x104510ec4 - __mh_execute_header
   2: 0x1050ad8dc - __mh_execute_header
   3: 0x104d50890 - __mh_execute_header
   4: 0x1048c82fc - __mh_execute_header
   5: 0x1048d4210 - __mh_execute_header
   6: 0x10488c21c - __mh_execute_header
   7: 0x181feaf94 - __pthread_joiner_wake"""

@chris-olszewski
Copy link
Member

This should be fixed in 2.0.15-canary.0. Please open a new issue if you continue to see the issue in 2.0.15 or later.

chris-olszewski added a commit that referenced this issue Aug 20, 2024
### Description

As #9016 displayed, panicking
in the render thread leads to a very poor user experience. We should do
our best effort to avoid this by using errors so we can make sure the
`cleanup` code gets run.

This PR removes (almost) all `unwrap`s/`expect`s in favor of returning
an `Err` which will cause us to exit `run_app_inner`.

### Testing Instructions

Existing unit tests. 👀
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants