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

v2.2.1 leads to segmentation fault (core dumped) #487

Closed
rverchere opened this issue Nov 21, 2022 · 3 comments · Fixed by #488
Closed

v2.2.1 leads to segmentation fault (core dumped) #487

rverchere opened this issue Nov 21, 2022 · 3 comments · Fixed by #488
Labels
bug Something isn't working

Comments

@rverchere
Copy link

Version of Marp Tool

Marp CLI v2.2.1

Operating System

Other (fill out in the environment field)

Environment

  • OS version: Docker 20.10.12
  • Marp CLI version : v2.2.1 (318ae4a9e066)

How to reproduce

  1. Run docker command to build html presentation

docker run --rm -v $PWD:/home/marp/app/ -e LANG=$LANG -e MARP_USER="$(id -u):$(id -g)" marpteam/marp-cli:v2.2.1 -I . -o build/

  1. Nothing is built
  2. Using shell, we get the error message Segmentation fault (core dumped)

Expected behavior

Slides should be build without core dumped.

Actual behavior

Slides are not built,

Additional information

Some info:

docker run -it --rm -v $PWD:/home/marp/app/ --entrypoint="" marpteam/marp-cli:v2.2.0 sh
/home/marp/app # docker-entrypoint -v
@marp-team/marp-cli v2.2.0 (w/ @marp-team/marp-core v3.3.3)
```

```
docker run -it --rm -v $PWD:/home/marp/app/ --entrypoint="" marpteam/marp-cli:v2.2.1 sh
/home/marp/app # docker-entrypoint -v
/home/marp/.cli/lib/marp-cli-03d89d3d.js:1
(function (exports, require, module, __filename, __dirname) { "use strict";var e=require("process"),t=require("os"),n=require("tty"),r=require("yargs/yargs"),i=require("yargs"),o=require("fs"),s=require("path"),a=require("cosmiconfig"),u=require("util"),c=require("child_process"),l=require("url"),p=require("import-from"),A=require("stream"),f=require("events"),D=require("tmp"),d=require("@marp-team/marpit"),g=require("puppeteer-core"),h=require("net"),m=require("is-wsl"),b=require("crypto"),v=require("chokidar"),y=require("ws"),w=require("querystring"),C=require("serve-index"),E=require("@marp-team/marp-core/package.json");function F(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var k=F(l);const _=(e=0)=>t=>`t+e}m`,B=(e=0)=>t=>`38+e};5;${t}m`,x=(e=0)=>(t,n,r)=>`38+e};2;${t};${n};${r}m`,P={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:
[...]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

TypeError: Invalid host defined options
    at Object.e (/home/marp/.cli/lib/marp-cli-03d89d3d.js:1:40363)
    at Function.resolveModule (/home/marp/.cli/lib/marp-cli-03d89d3d.js:1:40640)
    at Function.resolve (/home/marp/.cli/lib/marp-cli-03d89d3d.js:1:40121)
    at Function.resolveDefaultEngine (/home/marp/.cli/lib/marp-cli-03d89d3d.js:1:40280)
    at fromArguments (/home/marp/.cli/lib/marp-cli-03d89d3d.js:43:64753)
    at async wl (/home/marp/.cli/lib/marp-cli-03d89d3d.js:43:125264)
```
@rverchere rverchere added the bug Something isn't working label Nov 21, 2022
@cfcurtis
Copy link

I have the same issue, also with npx v2.2.1. Rolling back to v2.2.0 works no problem.

@yhatt yhatt changed the title Docker v2.2.1 leads to segmentation fault (core dumped) v2.2.1 leads to segmentation fault (core dumped) Nov 21, 2022
@yhatt yhatt pinned this issue Nov 21, 2022
@yhatt
Copy link
Member

yhatt commented Nov 21, 2022

Thanks for reports. I'm looking into the cause of this segment fault.

We have rollbacked the latest version of Marp CLI at GitHub and npm to v2.2.0 until fixed in the next patch release.

Logs

The error seems to bring at the time of engine resolution. Node.js 18 just throws TypeError by Node.js, and Node.js 16 is giving up running by segment fault.

Node.js 18

/Users/yhatt/Programs/marp/marp-cli/lib/marp-cli-13b5573e.js:2191
                delayedEngineResolver(async () => (await import('@marp-team/marp-core')).Marp),
                                                                                         ^

TypeError: Invalid host defined options
    at Object.<anonymous> (/Users/yhatt/Programs/marp/marp-cli/lib/marp-cli-13b5573e.js:2191:90)
    at ResolvedEngine.resolveModule (/Users/yhatt/Programs/marp/marp-cli/lib/marp-cli-13b5573e.js:2207:66)
    at ResolvedEngine.resolve (/Users/yhatt/Programs/marp/marp-cli/lib/marp-cli-13b5573e.js:2182:72)
    at ResolvedEngine.resolveDefaultEngine (/Users/yhatt/Programs/marp/marp-cli/lib/marp-cli-13b5573e.js:2189:66)
    at /Users/yhatt/Programs/marp/marp-cli/lib/marp-cli-13b5573e.js:21390:35
    at fromArguments (/Users/yhatt/Programs/marp/marp-cli/lib/marp-cli-13b5573e.js:21391:11)
    at async marpCli (/Users/yhatt/Programs/marp/marp-cli/lib/marp-cli-13b5573e.js:22371:24)

Node.js v18.12.1

Node.js 16

PID 71887 received SIGSEGV for address: 0x0
0   segfault-handler.node               0x000000010994934c _ZL16segfault_handleriP9__siginfoPv + 288
1   libsystem_platform.dylib            0x000000019351f4a4 _sigtramp + 56
2   node                                0x0000000104d90208 _ZN4node6loaderL23ImportModuleDynamicallyEN2v85LocalINS1_7ContextEEENS2_INS1_14ScriptOrModuleEEENS2_INS1_6StringEEENS2_INS1_10FixedArrayEEE + 236
3   node                                0x000000010502ac2c _ZN2v88internal7Isolate38RunHostImportModuleDynamicallyCallbackENS0_6HandleINS0_6ScriptEEENS2_INS0_6ObjectEEENS0_11MaybeHandleIS5_EE + 248
4   node                                0x00000001053a03e4 _ZN2v88internal25Runtime_DynamicImportCallEiPmPNS0_7IsolateE + 396
5   node                                0x00000001056aee04 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvInRegister_NoBuiltinExit + 100
6   node                                0x000000010573d198 Builtins_CallRuntimeHandler + 88
7   node                                0x0000000105642818 Builtins_InterpreterEntryTrampoline + 248
8   node                                0x0000000105642818 Builtins_InterpreterEntryTrampoline + 248
9   node                                0x0000000105642818 Builtins_InterpreterEntryTrampoline + 248
10  node                                0x0000000105642818 Builtins_InterpreterEntryTrampoline + 248
11  node                                0x0000000105642818 Builtins_InterpreterEntryTrampoline + 248
12  node                                0x0000000105642818 Builtins_InterpreterEntryTrampoline + 248
13  node                                0x0000000105671e14 Builtins_AsyncFunctionAwaitResolveClosure + 84
14  node                                0x00000001056f6c78 Builtins_PromiseFulfillReactionJob + 56
15  node                                0x00000001056641f4 Builtins_RunMicrotasks + 596
16  node                                0x00000001056404e4 Builtins_JSRunMicrotasksEntry + 164
17  node                                0x0000000105012fcc _ZN2v88internal12_GLOBAL__N_16InvokeEPNS0_7IsolateERKNS1_12InvokeParamsE + 2332
18  node                                0x0000000105013400 _ZN2v88internal12_GLOBAL__N_118InvokeWithTryCatchEPNS0_7IsolateERKNS1_12InvokeParamsE + 88
19  node                                0x00000001050134ec _ZN2v88internal9Execution16TryRunMicrotasksEPNS0_7IsolateEPNS0_14MicrotaskQueueEPNS0_11MaybeHandleINS0_6ObjectEEE + 64
20  node                                0x0000000105036128 _ZN2v88internal14MicrotaskQueue13RunMicrotasksEPNS0_7IsolateE + 336
21  node                                0x00000001050369bc _ZN2v88internal14MicrotaskQueue17PerformCheckpointEPNS_7IsolateE + 124
22  node                                0x0000000104d11c4c _ZN4node21InternalCallbackScope5CloseEv + 248
23  node                                0x0000000104d11fc8 _ZN4node20InternalMakeCallbackEPNS_11EnvironmentEN2v85LocalINS2_6ObjectEEES5_NS3_INS2_8FunctionEEEiPNS3_INS2_5ValueEEENS_13async_contextE + 548
24  node                                0x0000000104d268f0 _ZN4node9AsyncWrap12MakeCallbackEN2v85LocalINS1_8FunctionEEEiPNS2_INS1_5ValueEEE + 204
25  node                                0x0000000104dc5c2c _ZN4node2fs13FSReqCallback6RejectEN2v85LocalINS2_5ValueEEE + 128
26  node                                0x0000000104dc634c _ZN4node2fs15FSReqAfterScope6RejectEP7uv_fs_s + 192
27  node                                0x0000000104dc6598 _ZN4node2fs12AfterIntegerEP7uv_fs_s + 160
28  node                                0x0000000105620bc0 uv__work_done + 192
29  node                                0x000000010562435c uv__async_io + 320
30  node                                0x00000001056360a8 uv__io_poll + 1036
31  node                                0x00000001056247ec uv_run + 380

@yhatt
Copy link
Member

yhatt commented Nov 21, 2022

Fixed in #488, and released new patch version v2.2.2.

Perhaps this segmentation fault had brought by nodejs/node#35889. So I've just replaced import statment for loading Marp Core to require.

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

Successfully merging a pull request may close this issue.

3 participants