[Geany] Crash on some php files (opensolaris)

Enrico Tröger enrico.troeger at xxxxx
Sun Apr 27 15:17:29 UTC 2008

On Fri, 25 Apr 2008 20:00:12 +0300, Andris Raugulis <ar at null.lv> wrote:

> > > svn worth a try?
> > Sure! It only can get better ;-).
> Sorry to jump in unasked, but I had similar issues with Geany 0.13.
> When I opened PHP files, Geany crashed within vStringNCatS function. 
> I spent quite a time debugging and found that issue lies in regexps.
> Don't know if it will help with your OpenSolaris, but I can tell
> what I did to solve it in FreeBSD:
> I compiled Geany with -lgnuregex and changed related .c files to
> include proper GNU regex header.
Could you next time report such problems to us? Thanks.

Both problems (your FreeBSD changes and the OpenSolaris crashes) should
be fixed in SVN r2532.

Over the weekend I spent some time in installing OpenSolaris and after
the third try it finally worked ;-). And luckily I was able to
reproduce and fix the crash.

Once discovered the problem seems quiteobvious:
we had a file "regex.h" in tagmanager/include/ which was intended to be
included only if there is no system-wide regex.h (e.g. on Windows).
This file contains the GNU regex interface. Due to missing #ifdefs this
file was unintentionally included in every build. This was ok when the
system-wide (usually in /usr/include) regex.h was compatible as it is
on most GNU systems.

On those where it is not (like on OpenSolaris) it crashes. Since SVN
r2532 regex.h is only included when no system-wide one was found and
the related code can be compiled in with the configure option
"--enable-gnu-regex". Then Geany has its own GNU regex implementation.
But this should only be used when the system has no support for regex
(not sure if this can happen on other systems than Windows, just in

There was an additional problem in the code in src/encodings.c which
used the "buffer" element of the regex_t struct which seems to be only
present in the GNU regex implementation. This has been removed and so
the regex code in src/encodings.c will also work on non-GNU systems


Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/users/attachments/20080427/c37894f0/attachment.pgp>

More information about the Users mailing list