Skip to content

Instantly share code, notes, and snippets.

@saper
Created November 20, 2019 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saper/7c77ad6407cb24dde66dad2c39553de8 to your computer and use it in GitHub Desktop.
Save saper/7c77ad6407cb24dde66dad2c39553de8 to your computer and use it in GitHub Desktop.
m.saper.info> gdb831 --args node build.js
GNU gdb (GDB) 8.3.1 [GDB v8.3.1 for FreeBSD]
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd12.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from node...
(No debugging symbols found in node)
(gdb) break compile_data
Function "compile_data" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (compile_data) pending.
(gdb) break sass_importer
Function "sass_importer" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 2 (sass_importer) pending.
(gdb) run
Starting program: /usr/local/bin/node build.js
[New LWP 101988 of process 76889]
[New LWP 102002 of process 76889]
[New LWP 102024 of process 76889]
[New LWP 102042 of process 76889]
[New LWP 102049 of process 76889]
[New LWP 102050 of process 76889]
Starting 2 build(s)
Attempting to build. This will regularly trigger a SIGSEGV (segmentation fault) error. You may need to run this command multiple times to trigger it.
Attempting to build. This will regularly trigger a SIGSEGV (segmentation fault) error. You may need to run this command multiple times to trigger it.
[New LWP 102054 of process 76889]
[New LWP 102057 of process 76889]
[New LWP 102059 of process 76889]
[New LWP 102063 of process 76889]
[Switching to LWP 102063 of process 76889]
Thread 11 hit Breakpoint 1, compile_data (dctx=0x803192b00) at ../src/sass_context_wrapper.cpp:18
18 sass_compile_data_context(dctx);
(gdb) print *dctx
$1 = {<Sass_Context> = {<Sass_Options> = {<Sass_Output_Options> = {<Sass_Inspect_Options> = {
output_style = SASS_STYLE_NESTED, precision = 5, in_selector = false}, indent = 0x8056bc0c8 " ",
linefeed = 0x8020cbef8 "\n", source_comments = false}, source_map_embed = false, source_map_contents = false,
source_map_file_urls = false, omit_source_map_url = false, is_indented_syntax_src = false,
input_path = 0x805343300 "/home/saper/sw/node-sass-segfault-repro/src/complex.scss", output_path = 0x0,
include_path = 0x8057773f0 "/home/saper/sw/node-sass-segfault-repro", plugin_path = 0x0, include_paths = 0x0,
plugin_paths = 0x0, source_map_file = 0x0, source_map_root = 0x0, c_functions = 0x0, c_importers = 0x8031a9e30,
c_headers = 0x0}, type = SASS_CONTEXT_DATA, output_string = 0x0, source_map_string = 0x0, error_status = 0,
error_json = 0x0, error_text = 0x0, error_message = 0x0, error_file = 0x0, error_line = 0, error_column = 0,
error_src = 0x0, included_files = 0x0},
source_string = 0x8031d5620 "$base-color: #036;\n\n// this needs to run longer than the FaultyComponent.scss compiler\n@for $i from 1 through 10000 {\n ul:nth-child(3n + #{$i}) {\n background-color: lighten($base-color, $i % 20 * "...,
srcmap_string = 0x0}
(gdb) print *dctx->c_importers[0]
$2 = {importer = 0x8066f8090 <sass_importer(char const*, Sass_Importer*, Sass_Compiler*)>, priority = 0,
cookie = 0x803193d90}
(gdb) cont
Continuing.
[Switching to LWP 102057 of process 76889]
Thread 9 hit Breakpoint 1, compile_data (dctx=0x803192900) at ../src/sass_context_wrapper.cpp:18
18 sass_compile_data_context(dctx);
(gdb) print *dctx
$3 = {<Sass_Context> = {<Sass_Options> = {<Sass_Output_Options> = {<Sass_Inspect_Options> = {
output_style = SASS_STYLE_NESTED, precision = 5, in_selector = false}, indent = 0x8056bc0f8 " ",
linefeed = 0x8056bc100 "\n", source_comments = false}, source_map_embed = false, source_map_contents = false,
source_map_file_urls = false, omit_source_map_url = false, is_indented_syntax_src = false,
input_path = 0x805343180 "/home/saper/sw/node-sass-segfault-repro/src/faulty.scss", output_path = 0x0,
include_path = 0x80575c0d0 "/home/saper/sw/node-sass-segfault-repro", plugin_path = 0x0, include_paths = 0x0,
plugin_paths = 0x0, source_map_file = 0x0, source_map_root = 0x0, c_functions = 0x0, c_importers = 0x8031a9c30,
c_headers = 0x0}, type = SASS_CONTEXT_DATA, output_string = 0x0, source_map_string = 0x0, error_status = 0,
error_json = 0x0, error_text = 0x0, error_message = 0x0, error_file = 0x0, error_line = 0, error_column = 0,
error_src = 0x0, included_files = 0x0}, source_string = 0x8057e3280 "@import './breakpoints.scss';\n",
srcmap_string = 0x0}
(gdb) print *dctx->c_importers[0]
$4 = {importer = 0x8066f8090 <sass_importer(char const*, Sass_Importer*, Sass_Compiler*)>, priority = 0,
cookie = 0x803193d20}
(gdb) cont
Continuing.
[Switching to LWP 102059 of process 76889]
Thread 10 hit Breakpoint 1, compile_data (dctx=0x803192a00) at ../src/sass_context_wrapper.cpp:18
18 sass_compile_data_context(dctx);
(gdb) print *dctx
$5 = {<Sass_Context> = {<Sass_Options> = {<Sass_Output_Options> = {<Sass_Inspect_Options> = {
output_style = SASS_STYLE_NESTED, precision = 5, in_selector = false}, indent = 0x8056bc128 " ",
linefeed = 0x8056bc130 "\n", source_comments = false}, source_map_embed = false, source_map_contents = false,
source_map_file_urls = false, omit_source_map_url = false, is_indented_syntax_src = false,
input_path = 0x805c31f00 "/home/saper/sw/node-sass-segfault-repro/src/complex.scss", output_path = 0x0,
include_path = 0x805777270 "/home/saper/sw/node-sass-segfault-repro", plugin_path = 0x0, include_paths = 0x0,
plugin_paths = 0x0, source_map_file = 0x0, source_map_root = 0x0, c_functions = 0x0, c_importers = 0x8031a9c50,
c_headers = 0x0}, type = SASS_CONTEXT_DATA, output_string = 0x0, source_map_string = 0x0, error_status = 0,
error_json = 0x0, error_text = 0x0, error_message = 0x0, error_file = 0x0, error_line = 0, error_column = 0,
error_src = 0x0, included_files = 0x0},
source_string = 0x8031d5700 "$base-color: #036;\n\n// this needs to run longer than the FaultyComponent.scss compiler\n@for $i from 1 through 10000 {\n ul:nth-child(3n + #{$i}) {\n background-color: lighten($base-color, $i % 20 * "...,
srcmap_string = 0x0}
(gdb) print *dctx->c_importers[0]
$6 = {importer = 0x8066f8090 <sass_importer(char const*, Sass_Importer*, Sass_Compiler*)>, priority = 0,
cookie = 0x803193a10}
(gdb) cont
Continuing.
[Switching to LWP 102057 of process 76889]
Thread 9 hit Breakpoint 2, sass_importer (cur_path=0x7fffdf1f5ff1 "./breakpoints.scss", cb=0x8057e3020, comp=0x805777210)
at ../src/binding.cpp:10
10 void* cookie = sass_importer_get_cookie(cb);
(gdb) next
11 struct Sass_Import* previous = sass_compiler_get_last_import(comp);
(gdb) print *cookie
Attempt to dereference a generic pointer.
(gdb) print cookie
$7 = (void *) 0x803193d20
(gdb) cont
Continuing.
The expected error occurred. Exiting now which may trigger the segmentation fault error in the still running process(es).
[LWP 102042 of process 76889 exited]
[Switching to LWP 102054 of process 76889]
Thread 8 hit Breakpoint 1, compile_data (dctx=0x803192d00) at ../src/sass_context_wrapper.cpp:18
18 sass_compile_data_context(dctx);
(gdb) print *dctx
$8 = {<Sass_Context> = {<Sass_Options> = {<Sass_Output_Options> = {<Sass_Inspect_Options> = {
output_style = SASS_STYLE_NESTED, precision = 5, in_selector = false}, indent = 0x8056bc170 " ",
linefeed = 0x8056bc570 "\n", source_comments = false}, source_map_embed = false, source_map_contents = false,
source_map_file_urls = false, omit_source_map_url = false, is_indented_syntax_src = false,
input_path = 0x8053430c0 "/home/saper/sw/node-sass-segfault-repro/src/faulty.scss", output_path = 0x0,
include_path = 0x8053d5ab0 "/home/saper/sw/node-sass-segfault-repro", plugin_path = 0x0, include_paths = 0x0,
plugin_paths = 0x0, source_map_file = 0x0, source_map_root = 0x0, c_functions = 0x0, c_importers = 0x8031a9d00,
c_headers = 0x0}, type = SASS_CONTEXT_DATA, output_string = 0x0, source_map_string = 0x0, error_status = 0,
error_json = 0x0, error_text = 0x0, error_message = 0x0, error_file = 0x0, error_line = 0, error_column = 0,
error_src = 0x0, included_files = 0x0}, source_string = 0x80570b900 "@import './breakpoints.scss';\n",
srcmap_string = 0x0}
(gdb) print *dctx->c_importers[0]
$9 = {importer = 0x8066f8090 <sass_importer(char const*, Sass_Importer*, Sass_Compiler*)>, priority = 0,
cookie = 0x8031939a0}
(gdb) cont
Continuing.
Thread 8 hit Breakpoint 2, sass_importer (cur_path=0x7fffdf3f6ff1 "./breakpoints.scss", cb=0x805c43600, comp=0x805dc90c0)
at ../src/binding.cpp:10
10 void* cookie = sass_importer_get_cookie(cb);
(gdb) next
11 struct Sass_Import* previous = sass_compiler_get_last_import(comp);
(gdb) print cookie
$10 = (void *) 0x8031939a0
(gdb) cont
Continuing.
[LWP 101988 of process 76889 exited]
[LWP 102002 of process 76889 exited]
[LWP 102049 of process 76889 exited]
[LWP 102024 of process 76889 exited]
[LWP 102057 of process 76889 exited]
[LWP 102059 of process 76889 exited]
[LWP 102063 of process 76889 exited]
^C
Thread 1 received signal SIGINT, Interrupt.
[Switching to LWP 101132 of process 76889]
_umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37
37 RSYSCALL_ERR(_umtx_op)
(gdb) info thread
Id Target Id Frame
* 1 LWP 101132 of process 76889 _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37
7 LWP 102050 of process 76889 _umtx_op () at _umtx_op.S:3
8 LWP 102054 of process 76889 _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37
(gdb) thread 8
[Switching to thread 8 (LWP 102054 of process 76889)]
#0 _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37
37 RSYSCALL_ERR(_umtx_op)
(gdb) bt
#0 _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37
#1 0x0000000802b91740 in _thr_umtx_timedwait_uint (mtx=0x8031e3098, id=<optimized out>, clockid=<optimized out>,
abstime=<optimized out>, shared=<optimized out>) at /usr/src/lib/libthr/thread/thr_umtx.c:236
#2 0x0000000802b9b348 in cond_wait_user (cvp=<optimized out>, mp=0x803168300, abstime=0x0, cancel=1)
at /usr/src/lib/libthr/thread/thr_cond.c:307
#3 cond_wait_common (cond=<optimized out>, mutex=<optimized out>, abstime=0x0, cancel=1)
at /usr/src/lib/libthr/thread/thr_cond.c:367
#4 0x0000000802113ad9 in uv_cond_wait () from /usr/local/lib/libuv.so.1
#5 0x00000008066faf3b in CallbackBridge<Sass_Import**, void*>::operator() (this=0x8031939a0, argv=...)
at ../src/callback_bridge.h:136
#6 0x00000008066f815f in sass_importer (cur_path=<optimized out>, cb=<optimized out>, comp=<optimized out>)
at ../src/binding.cpp:19
#7 0x0000000806724090 in Sass::Context::call_loader (this=0x805c38000, load_path="./breakpoints.scss",
ctx_path=0x805c3c480 "/home/saper/sw/node-sass-segfault-repro/src/faulty.scss", pstate=..., imp=0x805c40480,
importers=..., only_one=<optimized out>) at ../src/libsass/src/context.cpp:436
#8 0x00000008068165fe in Sass::Context::call_importers (this=0x805c38000,
load_path=<error reading variable: Cannot access memory at address 0x6b616572622f2e24>,
ctx_path=0x805c3c480 "/home/saper/sw/node-sass-segfault-repro/src/faulty.scss", pstate=..., imp=0x805c40480)
at ../src/libsass/src/context.hpp:34
#9 Sass::Parser::parse_import (this=0x7fffdf3f7950) at ../src/libsass/src/parser.cpp:376
#10 0x000000080680fc40 in Sass::Parser::parse_block_node (this=0x7fffdf3f7950, is_root=true)
at ../src/libsass/src/parser.cpp:249
#11 0x000000080680df01 in Sass::Parser::parse_block_nodes (this=0x7fffdf3f7950, is_root=<optimized out>)
at ../src/libsass/src/parser.cpp:197
#12 0x000000080680d23d in Sass::Parser::parse (this=0x7fffdf3f7950) at ../src/libsass/src/parser.cpp:123
#13 0x0000000806721e7c in Sass::Context::register_resource (this=0x805c38000, inc=..., res=...)
at ../src/libsass/src/context.cpp:324
#14 0x0000000806726add in Sass::Data_Context::parse (this=<optimized out>) at ../src/libsass/src/context.cpp:636
#15 0x0000000806716efd in Sass::sass_parse_block (compiler=<optimized out>) at ../src/libsass/src/sass_context.cpp:234
#16 sass_compiler_parse (compiler=<optimized out>) at ../src/libsass/src/sass_context.cpp:483
#17 0x0000000806716b5a in sass_compile_context (c_ctx=0x803192d00, cpp_ctx=<optimized out>)
at ../src/libsass/src/sass_context.cpp:371
#18 0x0000000802103965 in ?? () from /usr/local/lib/libuv.so.1
#19 0x0000000802b8f786 in thread_start (curthread=0x8053f4a00) at /usr/src/lib/libthr/thread/thr_create.c:292
#20 0x0000000000000000 in ?? ()
Backtrace stopped: Cannot access memory at address 0x7fffdf3f8000
(gdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment