[Geany-Users] Create custom lexer: segmentation fault

Fardet Tanguy fardet.tanguy at xxxxx
Sat Dec 17 21:14:40 UTC 2016


Dear all,

I am currently trying to create a custom lexer for a language called 
NESTML <https://github.com/nest/nestml>.
I followed the instructions on the hacking section of the manual 
<http://geany.org/manual/dev/hacking.html#syntax-highlighting> and 
managed to compile a local geany with the new lexer.

However, I am encountering a Segfault problem when using this local 
geany: when I directly open a file, geany crashes immediately with a 
segmentation fault message.
However, if I use Document > define filetype > NESTML on an empty page, 
I am able to write a file and the new lexer seems to work like a charm. 
Following this, opening an existing .nestml file becomes possible and 
the lexer still works on this file. Yet, when I close geany, I again get 
the segmentation fault.
At some point (not always)s messages also appeared, saying: 
(geany:10608): GLib-GObject-CRITICAL **: g_object_unref: assertion 
'G_IS_OBJECT (object)' failed

The detailed of my implementation is on my fork of geany, on GitHub 
<https://github.com/Silmathoron/geany>.
I am working on an Ubuntu-based Linux Mint with Glib2 and Gtk2, and the 
latest master for geany; the compilation was done using:

(make distclean &&) ./autogen.sh --disable-html-docs 
--prefix=/home/me/.local && make && make install

and the output of autoconf is attached.

Could someone tell me where the problem comes from?
I first thought I forgot to tell geany something about the lexer, but 
since the crash occurs for any filetype, I'm no longer sure this is the 
problem.
An since my knowledge in C++ development is limited, I don't know how I 
could build geany in debug mode to track the problem...

Any help appreciated!

Best regards,

Tanguy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/users/attachments/20161217/ed8d9a50/attachment.html>
-------------- next part --------------
Processing configure.ac
Copying file po/Makefile.in.in

Please add the files
  codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4
  progtest.m4
from the /usr/share/aclocal directory to your autoconf macro directory
or directly to your aclocal.m4 file.
You will also need config.guess and config.sub, which you can get from
ftp://ftp.gnu.org/pub/gnu/config/.

libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
libtoolize: copying file 'build-aux/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:24: installing 'build-aux/compile'
configure.ac:9: installing 'build-aux/missing'
ctags/Makefile.am: installing 'build-aux/depcomp'
Running ./configure --disable-html-docs --prefix=/home/me/.local ...
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for ar... ar
checking the archiver (ar) interface... ar
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for gcc option to accept ISO C99... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether the C++ compiler works... yes
checking whether ln -s works... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking fnmatch.h usability... yes
checking fnmatch.h presence... yes
checking for fnmatch.h... yes
checking glob.h usability... yes
checking glob.h presence... yes
checking for glob.h... yes
checking for stdlib.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for off_t... yes
checking for size_t... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for ftruncate... yes
checking for fgetpos... yes
checking for fnmatch... yes
checking for mkstemp... yes
checking for strerror... yes
checking for strstr... yes
checking for Git revision... fcf4d1d
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GTK... yes
checking for GTHREAD... yes
checking whether binary relocation support should be enabled... no
checking for library containing connect... none required
checking whether the force is with you... no
checking whether NLS is requested... yes
checking for intltool-update... /usr/bin/intltool-update
checking for intltool-merge... /usr/bin/intltool-merge
checking for intltool-extract... /usr/bin/intltool-extract
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for perl... /usr/bin/perl
checking for perl >= 5.8.1... 5.22.1
checking for XML::Parser... ok
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for LC_MESSAGES... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for ngettext in libc... yes
checking for dgettext in libc... yes
checking for bind_textdomain_codeset... yes
checking for msgfmt... (cached) /usr/bin/msgfmt
checking for dcgettext... yes
checking if msgfmt accepts -c... yes
checking for gmsgfmt... (cached) /usr/bin/msgfmt
checking for xgettext... (cached) /usr/bin/xgettext
checking for catalogs to be installed...  ar ast be bg ca cs de el en_GB es et eu fa fi fr gl he hi hu id it ja kk ko lb lt mn nl nn pl pt pt_BR ro ru sk sl sr sv tr uk vi zh_CN zh_TW
checking for rst2pdf... no
checking for rst2pdf.py... no
checking for doxygen... no
checking for a Python interpreter with version >= 2.7... python
checking for python... /usr/bin/python
checking for python version... 2.7
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/site-packages
checking for python lxml package... yes
checking whether compiler supports GCC4-style visibility... yes
checking for sort... /usr/bin/sort
checking for uniq... /usr/bin/uniq
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating icons/Makefile
config.status: creating icons/16x16/Makefile
config.status: creating icons/24x24/Makefile
config.status: creating icons/32x32/Makefile
config.status: creating icons/48x48/Makefile
config.status: creating icons/scalable/Makefile
config.status: creating icons/tango/Makefile
config.status: creating icons/tango/16x16/Makefile
config.status: creating icons/tango/24x24/Makefile
config.status: creating icons/tango/32x32/Makefile
config.status: creating icons/tango/48x48/Makefile
config.status: creating icons/tango/scalable/Makefile
config.status: creating ctags/Makefile
config.status: creating scintilla/Makefile
config.status: creating scintilla/include/Makefile
config.status: creating src/Makefile
config.status: creating src/tagmanager/Makefile
config.status: creating plugins/Makefile
config.status: creating po/Makefile.in
config.status: creating data/Makefile
config.status: creating doc/Makefile
config.status: creating doc/geany.1
config.status: creating geany.spec
config.status: creating geany.pc
config.status: creating geany.nsi
config.status: creating doc/Doxyfile
config.status: creating tests/Makefile
config.status: creating tests/ctags/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default-1 commands
config.status: executing po/stamp-it commands
-----------------------------------------------------------
Install Geany in                 : /home/me/.local
Compiling Git revision           : fcf4d1d
Using GTK version                : 2.24.30
Enable binary relocation         : no
Build with plugin support        : yes
Use (UNIX domain) socket support : yes
Use virtual terminal support     : yes
Build HTML documentation         : no
Build PDF documentation          : no
Build API documentation          : no
Generate GtkDoc header           : yes

Configuration is done OK.

Now type 'make' to compile.


More information about the Users mailing list