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

bun run build fails to complete #11331

Open
azliu0 opened this issue Dec 31, 2024 · 8 comments
Open

bun run build fails to complete #11331

azliu0 opened this issue Dec 31, 2024 · 8 comments
Labels
type: bug Something isn't working

Comments

@azliu0
Copy link

azliu0 commented Dec 31, 2024

Description

bun run build fails to complete in gVisor with Next.js version 14.2.20.

There are already some known incompatibilities with Bun and gVisor. For example, Bun implements a workaround for the missing pidfd API in gVisor (#5839). To try to address this incompatibility, I've partially implemented the api here: master...azliu0:gvisor:azliu/pidfd_open. This patch implements pidfd_open, which is the only syscall in the pidfd api used by bun; see here.

Unfortunately, even with this patch, the reproduction script below still fails, which leads me to believe that something else may be going on. I can't be sure that this is only a gVisor issue, so I've also opened oven-sh/bun#16063. The reproduction script works with runc so it seems likely there's still something wrong with gVisor.

cc @pawalt

Steps to reproduce

Dockerfile:

FROM oven/bun:latest

RUN apt-get update -yqq && \
    apt-get install -yqq git && \
    bun install -g turbo

WORKDIR /march
RUN git clone --depth 1 https://github.com/marchhq/march.git . && \
    git fetch --depth 1 origin c0f0d196c4f7f94e10a66747be9bf96ce0135967 && \
    git checkout -f FETCH_HEAD
RUN bun install
CMD ["bun", "run", "build"]

Then build the image and run with runsc.

Expected behavior: bun run build finishes relatively quickly.
Observed behavior: bun run build hangs at the step Generating static pages (21/21).

On the patched version that implements pidfd_open, I also observe bun run build hanging after a certain point, but the output looks different. A caveat is that the implementation in this patch may be incorrect, but it at least passes the tests in test/syscalls/linux/pidfd.cc.

I observe the expected behavior with runc.

runsc version

runsc version release-20241217.0
spec: 1.1.0-rc.1

docker version (if using docker)

Docker version 27.4.1, build b9d17ea

uname

Linux ip-172-31-75-24 6.8.0-1018-aws #20-Ubuntu SMP Thu Oct 10 18:14:42 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

kubectl (if using Kubernetes)

N/A

repo state (if built from source)

N/A

runsc debug logs (if available)

https://modal-public-assets.s3.us-east-1.amazonaws.com/vendor/bun-debug-logs.zip
@azliu0 azliu0 added the type: bug Something isn't working label Dec 31, 2024
@milantracy
Copy link
Contributor

milantracy commented Dec 31, 2024

i pulled the pidfd patch and i reproduced the issue. It hangs before it started the build steps to Generating static pages

~/workspace/experiment/bun$ docker run --runtime=bunbun-d --rm buntest
$ turbo run build

Attention:
Turborepo now collects completely anonymous telemetry regarding usage.
This information is used to shape the Turborepo roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://turbo.build/repo/docs/telemetry

turbo 2.3.3

• Packages in scope: @march/backend, @march/frontend
• Running build in 2 packages
• Remote caching disabled
@march/frontend:build: cache miss, executing b23a753ac38e1c84
@march/frontend:build: $ next build
@march/frontend:build: Attention: Next.js now collects completely anonymous telemetry regarding usage.
@march/frontend:build: This information is used to shape Next.js' roadmap and prioritize features.
@march/frontend:build: You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
@march/frontend:build: https://nextjs.org/telemetry
@march/frontend:build: 
@march/frontend:build:   ▲ Next.js 14.2.20
@march/frontend:build: 
@march/frontend:build:    Creating an optimized production build ...

 Tasks:    1 successful, 1 total
Cached:    0 cached, 1 total
  Time:    1m34.398s 

// the container hangs here

From the debug logs, the runsc seems to be stuck at

D1231 21:50:27.199566       1 task_exit.go:215] [  13:  35] Transitioning from exit state TaskExitInitiated to TaskExitZombie
D1231 21:50:27.199572       1 task_exit.go:215] [  13:  35] Transitioning from exit state TaskExitZombie to TaskExitDead
D1231 21:50:27.199580       1 task_exit.go:215] [  13:  36] Transitioning from exit state TaskExitNone to TaskExitInitiated
D1231 21:50:27.199589       1 task_exit.go:215] [  13:  36] Transitioning from exit state TaskExitInitiated to TaskExitZombie
D1231 21:50:27.199594       1 task_exit.go:215] [  13:  36] Transitioning from exit state TaskExitZombie to TaskExitDead
D1231 21:50:27.199605       1 task_exit.go:215] [  13:  34] Transitioning from exit state TaskExitNone to TaskExitInitiated
D1231 21:50:27.199614       1 task_exit.go:215] [  13:  34] Transitioning from exit state TaskExitInitiated to TaskExitZombie
D1231 21:50:27.199620       1 task_exit.go:215] [  13:  34] Transitioning from exit state TaskExitZombie to TaskExitDead
D1231 21:50:27.199628       1 task_exit.go:215] [  13:  44] Transitioning from exit state TaskExitNone to TaskExitInitiated
.....

W1231 21:50:57.206806       1 shared_context.go:249] Systrap task goroutine has been waiting on ThreadContext.State futex too long. ThreadContext: 0
W1231 21:50:57.217060       1 shared_context.go:249] Systrap task goroutine has been waiting on ThreadContext.State futex too long. ThreadContext: 0
W1231 21:50:57.227189       1 shared_context.go:249] Systrap task goroutine has been waiting on ThreadContext.State futex too long. ThreadContext: 0
W1231 21:50:57.237410       1 shared_context.go:249] Systrap task goroutine has been waiting on ThreadContext.State futex too long. ThreadContext: 0
W1231 21:50:57.247625       1 shared_context.go:249] Systrap task goroutine has been waiting on ThreadContext.State futex too long. ThreadContext: 0
W1231 21:50:57.257723       1 shared_context.go:249] Systrap task goroutine has been waiting on ThreadContext.State futex too long. ThreadContext: 0
W1231 21:50:57.267819       1 shared_context.go:249] Systrap task goroutine has been waiting on ThreadContext.State futex too long. ThreadContext: 0
W1231 21:50:57.277915       1 shared_context.go:249] Systrap task goroutine has been waiting on ThreadContext.State futex too long. ThreadContext: 0
W1231 21:50:57.288030       1 shared_context.go:249] Systrap task goroutine has been waiting on ThreadContext.State futex too long. ThreadContext: 0
W1231 21:50:57.298096       1 shared_context.go:249] Systrap task goroutine has been waiting on ThreadContext.State futex too long. ThreadContext: 0
W1231 21:50:57.308214       1 shared_context.go:249] Systrap task goroutine has been waiting on ThreadContext.State futex too long. ThreadContext: 0
W1231 21:50:57.318339       1 shared_context.go:249] Systrap task goroutine has been waiting on ThreadContext.State futex too long. ThreadContext: 0
W1231 21:50:57.328440       1 shared_context.go:249] Systrap task goroutine has been waiting on ThreadContext.State futex too long. ThreadContext: 0
W1231 21:50:57.338544       1 shared_context.go:249] Systrap task goroutine has been waiting on ThreadContext.State futex too long. ThreadContext: 0

The same behavior can also be seen at KVM platform. it is less likely a platform issue

@milantracy
Copy link
Contributor

milantracy commented Dec 31, 2024

wow, I can actually finish the build w/o the pidfd patch

$ docker run --runtime=runsc --rm buntest
$ turbo run build

Attention:
Turborepo now collects completely anonymous telemetry regarding usage.
This information is used to shape the Turborepo roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://turbo.build/repo/docs/telemetry

turbo 2.3.3

• Packages in scope: @march/backend, @march/frontend
• Running build in 2 packages
• Remote caching disabled
@march/frontend:build: cache miss, executing b23a753ac38e1c84
@march/frontend:build: $ next build
@march/frontend:build: Attention: Next.js now collects completely anonymous telemetry regarding usage.
@march/frontend:build: This information is used to shape Next.js' roadmap and prioritize features.
@march/frontend:build: You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
@march/frontend:build: https://nextjs.org/telemetry
@march/frontend:build: 
@march/frontend:build:   ▲ Next.js 14.2.20
@march/frontend:build: 
@march/frontend:build:    Creating an optimized production build ...
@march/frontend:build:  ✓ Compiled successfully
@march/frontend:build:    Linting and checking validity of types ...
@march/frontend:build: 
@march/frontend:build: ./src/hooks/useMeetings.ts
@march/frontend:build: 46:6  Warning: React Hook useEffect has a missing dependency: 'fetchMeetings'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/hooks/useTrackUserInsights.tsx
@march/frontend:build: 111:6  Warning: React Hook useEffect has a missing dependency: 'identify'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/components/AddToSpace.tsx
@march/frontend:build: 30:6  Warning: React Hook React.useEffect has a missing dependency: 'fetchSpaces'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/components/FeedbackModal/FeedbackModal.tsx
@march/frontend:build: 140:6  Warning: React Hook useEffect has missing dependencies: 'setValue' and 'user?.accounts.google?.email'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/components/CreateItem.tsx
@march/frontend:build: 99:6  Warning: React Hook useCallback has a missing dependency: 'resetEditor'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/components/meetings/InitialMeet.tsx
@march/frontend:build: 75:6  Warning: React Hook useEffect has missing dependencies: 'blockId' and 'spaceId'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/components/meetings/useMeetEffects.ts
@march/frontend:build: 35:6  Warning: React Hook useEffect has missing dependencies: 'dispatch' and 'meetData'. Either include them or remove the dependency array. If 'dispatch' changes too often, find the parent component that defines it and wrap that definition in useCallback.  react-hooks/exhaustive-deps
@march/frontend:build: 55:6  Warning: React Hook useEffect has missing dependencies: 'dispatch', 'meet?.id', and 'meetData'. Either include them or remove the dependency array. If 'dispatch' changes too often, find the parent component that defines it and wrap that definition in useCallback.  react-hooks/exhaustive-deps
@march/frontend:build: 73:6  Warning: React Hook useEffect has missing dependencies: 'dispatch' and 'textareaRef'. Either include them or remove the dependency array. If 'dispatch' changes too often, find the parent component that defines it and wrap that definition in useCallback.  react-hooks/exhaustive-deps
@march/frontend:build: 106:6  Warning: React Hook useEffect has a missing dependency: 'textareaRef'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/components/meetings/MeetingsPage.tsx
@march/frontend:build: 60:6  Warning: React Hook useEffect has missing dependencies: 'fetchMeetByid', 'fetchMeets', 'meets.length', 'setIsInitialLoad', and 'setLoading'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/components/meetings/MeetNotes.tsx
@march/frontend:build: 26:6  Warning: React Hook useEffect has missing dependencies: 'meetData', 'setContent', 'setMeet', and 'setTitle'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/components/Notes/hooks/useNoteEffects.ts
@march/frontend:build: 37:5  Warning: React Hook useMemo has a missing dependency: 'dispatch'. Either include it or remove the dependency array. If 'dispatch' changes too often, find the parent component that defines it and wrap that definition in useCallback.  react-hooks/exhaustive-deps
@march/frontend:build: 46:5  Warning: React Hook useMemo has a missing dependency: 'dispatch'. Either include it or remove the dependency array. If 'dispatch' changes too often, find the parent component that defines it and wrap that definition in useCallback.  react-hooks/exhaustive-deps
@march/frontend:build: 74:6  Warning: React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array. If 'dispatch' changes too often, find the parent component that defines it and wrap that definition in useCallback.  react-hooks/exhaustive-deps
@march/frontend:build: 86:6  Warning: React Hook useEffect has missing dependencies: 'dispatch' and 'textareaRef'. Either include them or remove the dependency array. If 'dispatch' changes too often, find the parent component that defines it and wrap that definition in useCallback.  react-hooks/exhaustive-deps
@march/frontend:build: 114:6  Warning: React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array. If 'dispatch' changes too often, find the parent component that defines it and wrap that definition in useCallback.  react-hooks/exhaustive-deps
@march/frontend:build: 122:6  Warning: React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array. If 'dispatch' changes too often, find the parent component that defines it and wrap that definition in useCallback.  react-hooks/exhaustive-deps
@march/frontend:build: 139:6  Warning: React Hook useEffect has a missing dependency: 'textareaRef'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/components/topbar/topbar.tsx
@march/frontend:build: 39:6  Warning: React Hook useEffect has missing dependencies: 'blockId', 'fetchMeets', 'fetchNotes', 'fetchUser', and 'spaceId'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/components/ui/button.tsx
@march/frontend:build: 8:24  Warning: Classname 'focus-visible:ring-ring' is not a Tailwind CSS class!  tailwindcss/no-custom-classname
@march/frontend:build: 8:24  Warning: Classname 'bg-destructive' is not a Tailwind CSS class!  tailwindcss/no-custom-classname
@march/frontend:build: 8:24  Warning: Classname 'text-destructive-foreground' is not a Tailwind CSS class!  tailwindcss/no-custom-classname
@march/frontend:build: 8:24  Warning: Classname 'hover:bg-destructive/90' is not a Tailwind CSS class!  tailwindcss/no-custom-classname
@march/frontend:build: 8:24  Warning: Classname 'border-input' is not a Tailwind CSS class!  tailwindcss/no-custom-classname
@march/frontend:build: 8:24  Warning: Classname 'hover:bg-accent' is not a Tailwind CSS class!  tailwindcss/no-custom-classname
@march/frontend:build: 8:24  Warning: Classname 'hover:text-accent-foreground' is not a Tailwind CSS class!  tailwindcss/no-custom-classname
@march/frontend:build: 8:24  Warning: Classname 'hover:bg-accent' is not a Tailwind CSS class!  tailwindcss/no-custom-classname
@march/frontend:build: 8:24  Warning: Classname 'hover:text-accent-foreground' is not a Tailwind CSS class!  tailwindcss/no-custom-classname
@march/frontend:build: 
@march/frontend:build: ./src/components/ui/command.tsx
@march/frontend:build: 31:18  Warning: Invalid Tailwind CSS classnames order  tailwindcss/classnames-order
@march/frontend:build: 31:18  Warning: Classnames '[&_[cmdk-input-wrapper]_svg]:h-5, [&_[cmdk-input-wrapper]_svg]:w-5' could be replaced by the '[&_[cmdk-input-wrapper]_svg]:size-5' shorthand!  tailwindcss/enforces-shorthand
@march/frontend:build: 31:18  Warning: Classnames '[&_[cmdk-item]_svg]:h-5, [&_[cmdk-item]_svg]:w-5' could be replaced by the '[&_[cmdk-item]_svg]:size-5' shorthand!  tailwindcss/enforces-shorthand
@march/frontend:build: 44:13  Warning: Classnames 'h-4, w-4' could be replaced by the 'size-4' shorthand!  tailwindcss/enforces-shorthand
@march/frontend:build: 
@march/frontend:build: ./src/components/ui/toast.tsx
@march/frontend:build: 28:23  Warning: Classname 'destructive' is not a Tailwind CSS class!  tailwindcss/no-custom-classname
@march/frontend:build: 
@march/frontend:build: ./src/components/ui/spinner.tsx
@march/frontend:build: 12:19  Warning: Classname '3s' is not a Tailwind CSS class!  tailwindcss/no-custom-classname
@march/frontend:build: 12:19  Warning: Classname 'size-' is not a Tailwind CSS class!  tailwindcss/no-custom-classname
@march/frontend:build: 
@march/frontend:build: ./src/components/ui/dialog.tsx
@march/frontend:build: 48:30  Warning: Classname 'focus:ring-ring' is not a Tailwind CSS class!  tailwindcss/no-custom-classname
@march/frontend:build: 48:30  Warning: Classname 'data-[state=open]:bg-accent' is not a Tailwind CSS class!  tailwindcss/no-custom-classname
@march/frontend:build: 48:30  Warning: Classname 'data-[state=open]:text-muted-foreground' is not a Tailwind CSS class!  tailwindcss/no-custom-classname
@march/frontend:build: 
@march/frontend:build: ./src/components/atoms/ItemExpandModal.tsx
@march/frontend:build: 120:34  Warning: The ref value 'timeoutRefs.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy 'timeoutRefs.current' to a variable inside the effect, and use that variable in the cleanup function.  react-hooks/exhaustive-deps
@march/frontend:build: 161:34  Warning: The ref value 'timeoutRefs.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy 'timeoutRefs.current' to a variable inside the effect, and use that variable in the cleanup function.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/components/Reading/ReadingExpandModal.tsx
@march/frontend:build: 78:5  Warning: React Hook useCallback has missing dependencies: 'blockId' and 'spaceId'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 93:5  Warning: React Hook useCallback has missing dependencies: 'blockId' and 'spaceId'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 113:6  Warning: React Hook useCallback has missing dependencies: 'blockId' and 'spaceId'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 127:34  Warning: The ref value 'timeoutRefs.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy 'timeoutRefs.current' to a variable inside the effect, and use that variable in the cleanup function.  react-hooks/exhaustive-deps
@march/frontend:build: 165:34  Warning: The ref value 'timeoutRefs.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy 'timeoutRefs.current' to a variable inside the effect, and use that variable in the cleanup function.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/components/Reading/ItemsList.tsx
@march/frontend:build: 59:6  Warning: React Hook useEffect has a missing dependency: 'spaceId'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/components/Reading/AddItemForm.tsx
@march/frontend:build: 40:9  Warning: The 'handleSubmit' function makes the dependencies of useCallback Hook (at line 95) change on every render. To fix this, wrap the definition of 'handleSubmit' in its own useCallback() Hook.  react-hooks/exhaustive-deps
@march/frontend:build: 40:9  Warning: The 'handleSubmit' function makes the dependencies of useCallback Hook (at line 108) change on every render. To fix this, wrap the definition of 'handleSubmit' in its own useCallback() Hook.  react-hooks/exhaustive-deps
@march/frontend:build: 40:9  Warning: The 'handleSubmit' function makes the dependencies of useCallback Hook (at line 118) change on every render. To fix this, wrap the definition of 'handleSubmit' in its own useCallback() Hook.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/components/Today/TodayTextArea.tsx
@march/frontend:build: 99:6  Warning: React Hook useEffect has a missing dependency: 'saveJournal'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/components/Today/TodayExpandedAgenda.tsx
@march/frontend:build: 79:6  Warning: React Hook useCallback has a missing dependency: 'setIsFetched'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 129:34  Warning: The ref value 'timeoutRefs.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy 'timeoutRefs.current' to a variable inside the effect, and use that variable in the cleanup function.  react-hooks/exhaustive-deps
@march/frontend:build: 185:6  Warning: React Hook useEffect has missing dependencies: 'blockId' and 'spaceId'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 212:34  Warning: The ref value 'timeoutRefs.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy 'timeoutRefs.current' to a variable inside the effect, and use that variable in the cleanup function.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/components/Today/TodayExpandedItem.tsx
@march/frontend:build: 120:34  Warning: The ref value 'timeoutRefs.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy 'timeoutRefs.current' to a variable inside the effect, and use that variable in the cleanup function.  react-hooks/exhaustive-deps
@march/frontend:build: 158:34  Warning: The ref value 'timeoutRefs.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy 'timeoutRefs.current' to a variable inside the effect, and use that variable in the cleanup function.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/components/Today/TodayMeetings.tsx
@march/frontend:build: 23:6  Warning: React Hook useEffect has a missing dependency: 'session'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/queries/useSearch.ts
@march/frontend:build: 18:5  Warning: React Hook useMemo has a missing dependency: 'session'. Either include it or remove the dependency array. Outer scope values like 'queryClient' aren't valid dependencies because mutating them doesn't re-render the component.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: ./src/app/(profile)/profile/layout.tsx
@march/frontend:build: 16:13  Warning: Classname 'theme-bg' is not a Tailwind CSS class!  tailwindcss/no-custom-classname
@march/frontend:build: 
@march/frontend:build: ./src/contexts/ModalProvider.tsx
@march/frontend:build: 51:6  Warning: React Hook useEffect has a missing dependency: 'handleKeyPress'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
@march/frontend:build: 
@march/frontend:build: info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
@march/frontend:build:    Collecting page data ...
@march/frontend:build:    Generating static pages (0/21) ...
@march/frontend:build: hi from api
@march/frontend:build:    Generating static pages (5/21) 
@march/frontend:build:    Generating static pages (10/21) 
@march/frontend:build:    Generating static pages (15/21) 
@march/frontend:build:  ✓ Generating static pages (21/21)
@march/frontend:build:    Finalizing page optimization ...
@march/frontend:build:    Collecting build traces ...
@march/frontend:build: 
@march/frontend:build: Route (app)                                            Size     First Load JS
@march/frontend:build: ┌ ○ /                                                  1.97 kB         125 kB
@march/frontend:build: ├ ○ /_not-found                                        876 B          88.2 kB
@march/frontend:build: ├ ƒ /api/auth/github/url                               0 B                0 B
@march/frontend:build: ├ ƒ /api/auth/google-calendar/url                      0 B                0 B
@march/frontend:build: ├ ƒ /api/auth/linear/url                               0 B                0 B
@march/frontend:build: ├ ƒ /auth/github                                       0 B                0 B
@march/frontend:build: ├ ƒ /auth/github/callback                              0 B                0 B
@march/frontend:build: ├ ƒ /auth/google                                       0 B                0 B
@march/frontend:build: ├ ƒ /auth/google-calendar                              0 B                0 B
@march/frontend:build: ├ ƒ /auth/linear                                       0 B                0 B
@march/frontend:build: ├ ○ /calendar                                          1.75 kB         125 kB
@march/frontend:build: ├ ○ /icon.svg                                          0 B                0 B
@march/frontend:build: ├ ƒ /inbox                                             2.27 kB         392 kB
@march/frontend:build: ├ ○ /profile                                           11.9 kB         286 kB
@march/frontend:build: ├ ƒ /spaces                                            147 B          87.5 kB
@march/frontend:build: ├ ƒ /spaces/[spaceId]                                  147 B          87.5 kB
@march/frontend:build: ├ ƒ /spaces/[spaceId]/blocks/[blockId]/items           7.2 kB          379 kB
@march/frontend:build: ├ ƒ /spaces/[spaceId]/blocks/[blockId]/items/[itemId]  6.99 kB         369 kB
@march/frontend:build: ├ ○ /stack                                             4.66 kB         127 kB
@march/frontend:build: ├ ƒ /this-week                                         3.8 kB          393 kB
@march/frontend:build: ├ ƒ /today                                             8.75 kB         398 kB
@march/frontend:build: └ ○ /waitlist                                          147 B          87.5 kB
@march/frontend:build: + First Load JS shared by all                          87.3 kB
@march/frontend:build:   ├ chunks/1dd3208c-a40cd5fb32174db5.js                53.6 kB
@march/frontend:build:   ├ chunks/528-fc0df1d7ce2fa774.js                     31.7 kB
@march/frontend:build:   └ other shared chunks (total)                        1.97 kB
@march/frontend:build: 
@march/frontend:build: 
@march/frontend:build: ƒ Middleware                                           25.9 kB
@march/frontend:build: 
@march/frontend:build: ○  (Static)   prerendered as static content
@march/frontend:build: ƒ  (Dynamic)  server-rendered on demand
@march/frontend:build: 

 Tasks:    1 successful, 1 total
Cached:    0 cached, 1 total
  Time:    2m59.865s 

The pidfd syscall is not a blocker as it can tell from the debug logs

I1231 22:14:16.607183       1 compat.go:120] Unsupported syscall prctl(0x2a,0x7edb1765bbe0,0x0,0x0,0x0,0x0). It is likely that you can safely ignore this message and that this is not the cause of any error. Please, refer to https://gvi\
sor.dev/c/linux/amd64/prctl for more information.
I1231 22:14:16.607315       1 compat.go:120] Unsupported syscall prctl(0x29,0x7edb1765bbe0,0x0,0x0,0x0,0x0). It is likely that you can safely ignore this message and that this is not the cause of any error. Please, refer to https://gvi\
sor.dev/c/linux/amd64/prctl for more information.
I1231 22:14:16.619658       1 compat.go:120] Unsupported syscall pidfd_open(0x3,0x0,0x4,0x100000004,0x0,0x100000004). It is likely that you can safely ignore this message and that this is not the cause of any error. Please, refer to ht\
tps://gvisor.dev/c/linux/amd64/pidfd_open for more information.

Unsupported syscall pidfd_open It is likely that you can safely ignore this message and that this is not the cause of any error.

@milantracy
Copy link
Contributor

i would recommend to use a newer version of runsc and give it try again.

what i have done differently is that i used the runsc i built from HEAD

@azliu0
Copy link
Author

azliu0 commented Dec 31, 2024

@milantracy thanks for looking into this! Are you able to finish the build consistently? I'm running the latest version of master locally and still seeing the build hang, although this is non-deterministic.

@milantracy
Copy link
Contributor

I have not seen any inconsistent behavior, I run the bun build 10 times in a row, it works for me,

jing@dev ~/workspace/gvisor (runsc) $ for i in {1..10}; do
  time docker run --runtime=runsc --rm buntest  &> /tmp/buntest.log
done

docker run --runtime=runsc --rm buntest &> /tmp/buntest.log  0.01s user 0.02s system 0% cpu 2:20.35 total
docker run --runtime=runsc --rm buntest &> /tmp/buntest.log  0.01s user 0.02s system 0% cpu 2:20.89 total
docker run --runtime=runsc --rm buntest &> /tmp/buntest.log  0.01s user 0.02s system 0% cpu 2:21.04 total
docker run --runtime=runsc --rm buntest &> /tmp/buntest.log  0.01s user 0.02s system 0% cpu 2:20.99 total
docker run --runtime=runsc --rm buntest &> /tmp/buntest.log  0.01s user 0.02s system 0% cpu 2:21.51 total
docker run --runtime=runsc --rm buntest &> /tmp/buntest.log  0.01s user 0.01s system 0% cpu 2:18.76 total
docker run --runtime=runsc --rm buntest &> /tmp/buntest.log  0.01s user 0.01s system 0% cpu 2:20.48 total
docker run --runtime=runsc --rm buntest &> /tmp/buntest.log  0.01s user 0.02s system 0% cpu 2:20.92 total
docker run --runtime=runsc --rm buntest &> /tmp/buntest.log  0.01s user 0.02s system 0% cpu 2:20.57 total
docker run --runtime=runsc --rm buntest &> /tmp/buntest.log  0.01s user 0.01s system 0% cpu 2:20.57 total

and my kernel version is

jing@dev ~/workspace/gvisor (runsc) $ uname -a            
Linux dev 6.8.0-49-generic #49-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov  4 02:06:24 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

and runsc version is

jing@dev ~/workspace/gvisor (runsc) $ git --no-pager log -1
commit 4dbba85b072bbb9a40fcc81f1000c67082ca6961 (HEAD -> runsc, origin/master, origin/HEAD)
Author: Etienne Perot <[email protected]>
Date:   Mon Dec 30 13:43:35 2024 -0800

    Kubernetes benchmarks: Refactor kubectl context to allow sets of clusters.
    
    Also add sanity check to make sure each cluster works as part of
    initialization, by running a sample pod within.

my runtime config at /etc/docker/daemon.json is

        "runsc": {
            "path": "/tmp/runsc/runsc",
            "runtimeArgs": [
                "--debug-log",
                "/tmp/runsc/logs/runsc.log.%TEST%.%TIMESTAMP%.%COMMAND%",
                "--net-raw"
            ]
        },
        "runsc-d": {
            "path": "/tmp/runsc/runsc",
            "runtimeArgs": [
                "--debug-log",
                "/tmp/runsc/logs/runsc.log.%TEST%.%TIMESTAMP%.%COMMAND%",
                "--net-raw",
                "--debug",
                "--strace",
                "--log-packets"
            ]
        },

@azliu0
Copy link
Author

azliu0 commented Jan 1, 2025

Hm, this is tricky. My local setup looks the same. I've reran these steps from scratch, and unfortunately am still seeing the hang:

  • create fresh instance with type m6id on AWS
  • install make, docker, and other deps to build and run gvisor
  • git clone https://github.com/google/gvisor
  • cd gvisor && make dev

My runtime config at /etc/docker/daemon.json after running these steps looks like this:

        "master": {
            "path": "/tmp/master/runsc",
            "runtimeArgs": [
                "--debug-log",
                "/tmp/master/logs/runsc.log.%TEST%.%TIMESTAMP%.%COMMAND%",
                "--net-raw"
            ]
        },
        "master-d": {
            "path": "/tmp/master/runsc",
            "runtimeArgs": [
                "--debug-log",
                "/tmp/master/logs/runsc.log.%TEST%.%TIMESTAMP%.%COMMAND%",
                "--net-raw",
                "--debug",
                "--strace",
                "--log-packets"
            ]
        }

I've rerun these steps from scratch on a fresh instance, and I still reliably observe a hang at the step @march/frontend:build: ✓ Generating static pages (21/21) after re-running docker run --runtime=master --rm buntest a few times.

@ayushr2
Copy link
Collaborator

ayushr2 commented Jan 1, 2025

Could you upload the debug log files generated in /tmp/master/logs/ after one of these runs which hang? Please note that it will continue to accumulate log files from previous runs. So please clear /tmp/master/logs/ before each run and upload all the files generated by the failing run.

Please use the runtime master-d, as it includes more debug output.

@azliu0
Copy link
Author

azliu0 commented Jan 1, 2025

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

No branches or pull requests

3 participants