gdb debugging cgo segfault

80 views
Skip to first unread message

Drew Wells

unread,
Nov 27, 2015, 11:16:23 PM11/27/15
to golang-nuts
I have a particular long standing issue with segfaults in a C library. I'm unable to reproduce this with similar C code or a node binding to the same library. Go bindings work on OS X/linux, but I'm getting segfaults in C on Windows. I've created a sample program that reproduces the problem.


Here's output from gdb with `catch throw`: https://gist.github.com/drewwells/61b70731ee0c6aea0445

(gdb) run
Starting program: C:\code\src\github.com\wellington\go-libsass\blah\blah.exe
[New Thread 58628.0xe534]
[New Thread 58628.0xe530]
[New Thread 58628.0xe52c]
[New Thread 58628.0xe524]
[New Thread 58628.0xe520]
[New Thread 58628.0xe51c]
[New Thread 58628.0xe514]
[New Thread 58628.0xe510]
Catchpoint 2 (exception thrown), 0x000000000069f9f0 in __cxa_throw ()
(gdb) bt
#0 0x000000000069f9f0 in __cxa_throw ()
#1 0x000000000041022e in Sass::Parser::error (this=this@entry=0x24f9d0,
msg="Invalid CSS after \"p {\": expected \"}\", was \"\"", pos=...)
at C:/code/src/github.com/wellington/go-libsass/libs/../libsass-build/parser.cpp:2383
#2 0x0000000000422807 in Sass::Parser::css_error (this=this@entry=0x24f9d0,
msg="Invalid CSS", prefix=" after ", middle=": expected \"}\", was ")
at C:/code/src/github.com/wellington/go-libsass/libs/../libsass-build/parser.cpp:2433

This has been problematic for a long time. Any help would be greatly appreciated!

Reply all
Reply to author
Forward
0 new messages