oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.79k stars 2.73k forks source link

WebRTC, FFmpeg setup crashing on bun, working fine on ts-node #14558

Open Moe03 opened 2 days ago

Moe03 commented 2 days ago

How can we reproduce the crash?

Setup a webrtc nodejs example to stream audio to nodejs and then back from nodejs to client and the process will crash instantly.

Relevant log output

FFmpeg stderr: ffmpeg version 6.0-essentials_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers built with gcc 12.2.0 (Rev10, Built by MSYS2 project) configurat FFmpeg stderr: ion: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband libavutil 58. 2.100 / 58. 2.100 libavcodec 60. 3.100 / 60. 3.100 libavformat 60. 3.100 / 60. 3.100 libavdevice 60. 1.100 / 60. 1.100 libavfilter 9. 3.100 / 9. 3.100 libswscale 7. 1.100 / 7. 1.100 libswresample 4. 10.100 / 4. 10.100 libpostproc 57. 1.100 / 57. 1.100

FFmpeg stderr: [mp3 @ 000001be37ceab00] invalid concatenated file detected - using bitrate for duration

FFmpeg stderr: Input #0, mp3, from 'pipe:3': Metadata: major_brand : mp42 minor_version : 0 comp FFmpeg stderr: atible_brands: isommp42 encoder : Lavf58.29.100 Duration: N/A, start: 0.025057, bitrate: 128 kb/s Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s Metadata: encoder : Lavc58.54

handleOffer { type: "offer", sdp: "v=0\r\no=- 4942545555750895921 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS e49032fe-9c2f-4b17-bd72-63192e6c5158\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 0 8 13 110 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:K4ae\r\na=ice-pwd:W8mmCjG+Gq32Dq3k1Kg/DPcT\r\na=ice-options:trickle\r\na=fingerprint:sha-256 EF:54:95:3E:CC:48:5B:8A:B6:A5:CD:2C:15:9D:82:37:85:9D:C9:38:44:7B:29:7E:B0:1F:81:C3:AA:2D:F1:73\r\na=setup:actpass\r\na=mid:0\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=sendrecv\r\na=msid:e49032fe-9c2f-4b17-bd72-63192e6c5158 a384742c-7cdd-43ce-8d78-57a78a56d79e\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:111 opus/48000/2\r\na=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\na=rtpmap:63 red/48000/2\r\na=fmtp:63 111/111\r\na=rtpmap:9 G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:110 telephone-event/48000\r\na=rtpmap:126 telephone-event/8000\r\na=ssrc:321418809 cname:zEXX0Wnkn/gyek3B\r\na=ssrc:321418809 msid:e49032fe-9c2f-4b17-bd72-63192e6c5158 a384742c-7cdd-43ce-8d78-57a78a56d79e\r\n", }

Bun v1.1.29 (6d43b366) Windows x64 Windows v.win10_fe CPU: sse42 avx avx2 avx512 Args: "C:\Users\Mohamed.bun\bin\bun.exe" "run" "src/call-service/src/server.ts" Features: jsc Bun.stdin dotenv fetch http_server(2) spawn(2) transpiler_cache(14) tsconfig_paths(3) tsconfig(29) WebSocket(4) Builtins: "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:constants" "node:crypto" "node:dns" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:net" "node:os" "node:path" "node:querystring" "node:readline" "node:stream" "node:string_decoder" "node:tls" "node:tty" "node:url" "node:util" "node:util/types" "node:zlib" "node:punycode" "ws" "node-fetch" Elapsed: 201624ms | User: 953ms | Sys: 500ms RSS: 0.44GB | Peak: 0.44GB | Commit: 0.62GB | Faults: 158255

Stack Trace (bun.report)

Bun v1.1.29 (6d43b36) on windows x86_64 [RunCommand]

panic: napi: napi_create_error Error::New

Features: jsc, dotenv, http_server, transpiler_cache, tsconfig_paths, tsconfig, WebSocket

github-actions[bot] commented 2 days ago

@Moe03, the latest version of Bun is v1.1.30, but this crash was reported on Bun v1.1.29.

Are you able to reproduce this crash on the latest version of Bun?

bun upgrade