Discussion:
XEmacs segfault
Ralf Angeli
2005-02-01 20:07:49 UTC
Permalink
When trying to prepare an example for the xemacs-beta list XEmacs just
died. I am currently on a dial-up connection and won't search for the
reference to the respective message including a backtrace but you
should be able to find it via Gmane.

I suspect the segfault is a result of the presence of shy groups in
`LaTeX-auto-class-regexp-list'. At least it doesn't happen if I
remove the entries containing shy groups from the variable. We should
definitely not ship 11.55 with these regexps enabled in XEmacs.
--
Ralf
David Kastrup
2005-02-01 20:37:54 UTC
Permalink
Post by Ralf Angeli
When trying to prepare an example for the xemacs-beta list XEmacs just
died. I am currently on a dial-up connection and won't search for the
reference to the respective message including a backtrace but you
should be able to find it via Gmane.
I suspect the segfault is a result of the presence of shy groups in
`LaTeX-auto-class-regexp-list'. At least it doesn't happen if I
remove the entries containing shy groups from the variable. We
should definitely not ship 11.55 with these regexps enabled in
XEmacs.
!@##@$#! What XEmacs version? We _do_ have some
do-not-use-shy-regexp comment in preview.el.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Ralf Angeli
2005-02-01 20:59:02 UTC
Permalink
Post by David Kastrup
Post by Ralf Angeli
When trying to prepare an example for the xemacs-beta list XEmacs just
died. I am currently on a dial-up connection and won't search for the
reference to the respective message including a backtrace but you
should be able to find it via Gmane.
I suspect the segfault is a result of the presence of shy groups in
`LaTeX-auto-class-regexp-list'. At least it doesn't happen if I
remove the entries containing shy groups from the variable. We
should definitely not ship 11.55 with these regexps enabled in
XEmacs.
Yes, it's really getting funny.
Post by David Kastrup
What XEmacs version?
21.4.16. There was some discussion on the XEmacs lists about problems
with shy groups in connection with Gnus. In this case the result was
a hang of XEmacs. As far as I know this started with 21.4.16. They
recently found a fix for that but I don't know if this will fix as
well the segfault I am seeing here.

It wouldn't be a big deal to disable the regexps in concern for XEmacs
in general, but if we get some feedback from the XEmacs people we
could probably disable them for affected releases only.
Post by David Kastrup
We _do_ have some do-not-use-shy-regexp comment in preview.el.
For XEmacs in general?
--
Ralf
David Kastrup
2005-02-01 21:31:45 UTC
Permalink
Post by Ralf Angeli
Post by David Kastrup
Post by Ralf Angeli
When trying to prepare an example for the xemacs-beta list XEmacs just
died. I am currently on a dial-up connection and won't search for the
reference to the respective message including a backtrace but you
should be able to find it via Gmane.
I suspect the segfault is a result of the presence of shy groups in
`LaTeX-auto-class-regexp-list'. At least it doesn't happen if I
remove the entries containing shy groups from the variable. We
should definitely not ship 11.55 with these regexps enabled in
XEmacs.
Yes, it's really getting funny.
Post by David Kastrup
What XEmacs version?
21.4.16. There was some discussion on the XEmacs lists about problems
with shy groups in connection with Gnus. In this case the result was
a hang of XEmacs. As far as I know this started with 21.4.16. They
recently found a fix for that but I don't know if this will fix as
well the segfault I am seeing here.
It wouldn't be a big deal to disable the regexps in concern for XEmacs
in general, but if we get some feedback from the XEmacs people we
could probably disable them for affected releases only.
Post by David Kastrup
We _do_ have some do-not-use-shy-regexp comment in preview.el.
For XEmacs in general?
2002-04-04 Nix <***@esperi.demon.co.uk>

* preview.el (preview-parse-messages):
Cater for XEmacs shy grouping bug (shy grouping
very nearly doesn't work in XEmacs-21.4...)

2002-03-15 David Kastrup <***@t-online.de>

(preview-parse-messages): New regexp parser. Nick, if the shy
groups \(?: ...\) worry XEmacs, make them non-shy and adjust the
match-... thingies appropriately.
(preview-analyze-error): and another save-restriction...

However, the actual code at least now uses quite a few shy regexps.
But fewer than the comments if I can see correctly. So it would
appear that either only _some_ usage of shy regexps was tragic at that
time, or that in the mean time, without XEmacs users complaining
violently, preview-latex has become non-operative. I doubt that the
latter is really the case.

The problem with Nix at that time (our XEmacs porter) is that he was
working in whirlwind mode and his first priority was to get things
running without having to touch too many things. So it is unclear
what of the stuff for which he introduced bandaid fixes and
workarounds actually got fixed in XEmacs. He _did_ quite a bit of
work fixing things also in XEmacs, but there were also things he did
not touch IIRC.

More details will probably be found in the archives of the
preview-latex-devel list which is not available through gmane at that
point of time, I think, but via sourceforge.

But I don't recollect that Nix actually fixed anything WRT regexps,
and not having followed the XEmacs lists, I don't know what and how he
reported problems.

The way it sounds from the ChangeLog, it appears to be some
"well-known" problem at the time. But maybe I am mistaken.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Jan-Ake Larsson
2005-02-02 09:23:31 UTC
Permalink
Post by David Kastrup
However, the actual code at least now uses quite a few shy regexps.
But fewer than the comments if I can see correctly. So it would
appear that either only _some_ usage of shy regexps was tragic at that
time, or that in the mean time, without XEmacs users complaining
violently, preview-latex has become non-operative. I doubt that the
latter is really the case.
So do I, since I use preview-latex daily in XEmacs 21.4.15.

/JÅ
--
We are MicroSoft. You will be assimilated. Resistance is futile.
David Kastrup
2005-02-02 10:13:13 UTC
Permalink
Post by Jan-Ake Larsson
Post by David Kastrup
However, the actual code at least now uses quite a few shy regexps.
But fewer than the comments if I can see correctly. So it would
appear that either only _some_ usage of shy regexps was tragic at that
time, or that in the mean time, without XEmacs users complaining
violently, preview-latex has become non-operative. I doubt that the
latter is really the case.
So do I, since I use preview-latex daily in XEmacs 21.4.15.
It is probably some sort of initialization problem, like the first
group used in matching for a process-sentinel or a new session not
being allowed to be shy, or like there must not be more shy groups
used at any given time than non-shy groups have been used previously
in the session or something.

Hopefully, we can get some more details so that we know what
workaround would appear safe.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Ralf Angeli
2005-02-02 10:36:32 UTC
Permalink
Post by David Kastrup
It is probably some sort of initialization problem, like the first
group used in matching for a process-sentinel or a new session not
being allowed to be shy, or like there must not be more shy groups
used at any given time than non-shy groups have been used previously
in the session or something.
The fix in XEmacs involved the following change log entry:

2005-01-26 Arnaud Giersch <***@free.fr>

* regex.c (re_match_2_internal):
Correctly initialize loop which clears uninitialized registers.

The diff can be found at the following URL:

<URL:http://cvs.xemacs.org/viewcvs.cgi/XEmacs/xemacs/src/regex.c.diff?r1=1.25.2.11&r2=1.25.2.12&only_with_tag=release-21-4>
--
Ralf
David Kastrup
2005-02-01 21:50:26 UTC
Permalink
Post by Ralf Angeli
Post by David Kastrup
Post by Ralf Angeli
When trying to prepare an example for the xemacs-beta list XEmacs just
died. I am currently on a dial-up connection and won't search for the
reference to the respective message including a backtrace but you
should be able to find it via Gmane.
I suspect the segfault is a result of the presence of shy groups in
`LaTeX-auto-class-regexp-list'. At least it doesn't happen if I
remove the entries containing shy groups from the variable. We
should definitely not ship 11.55 with these regexps enabled in
XEmacs.
Yes, it's really getting funny.
Post by David Kastrup
What XEmacs version?
21.4.16. There was some discussion on the XEmacs lists about problems
with shy groups in connection with Gnus. In this case the result was
a hang of XEmacs. As far as I know this started with 21.4.16. They
recently found a fix for that but I don't know if this will fix as
well the segfault I am seeing here.
It wouldn't be a big deal to disable the regexps in concern for XEmacs
in general, but if we get some feedback from the XEmacs people we
could probably disable them for affected releases only.
Maybe it is just a problem of initializing the data structures once.
Just do
(string-match "\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(.\
\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)" "x")
once, and everything will turn out fine.

Or something. I hate life.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Ralf Angeli
2005-02-01 22:30:01 UTC
Permalink
Post by David Kastrup
Post by Ralf Angeli
21.4.16. There was some discussion on the XEmacs lists about problems
with shy groups in connection with Gnus. In this case the result was
a hang of XEmacs. As far as I know this started with 21.4.16. They
recently found a fix for that but I don't know if this will fix as
well the segfault I am seeing here.
It wouldn't be a big deal to disable the regexps in concern for XEmacs
in general, but if we get some feedback from the XEmacs people we
could probably disable them for affected releases only.
Maybe it is just a problem of initializing the data structures once.
Just do
(string-match "\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(.\
\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)" "x")
once, and everything will turn out fine.
Or something. I hate life.
Am I supposed to laugh or cry now? After doing this, the segfault
doesn't happen anymore.
--
Ralf
David Kastrup
2005-02-01 22:49:25 UTC
Permalink
Post by Ralf Angeli
Post by David Kastrup
Post by Ralf Angeli
21.4.16. There was some discussion on the XEmacs lists about
problems with shy groups in connection with Gnus. In this case
the result was a hang of XEmacs. As far as I know this started
with 21.4.16. They recently found a fix for that but I don't know
if this will fix as well the segfault I am seeing here.
It wouldn't be a big deal to disable the regexps in concern for
XEmacs in general, but if we get some feedback from the XEmacs
people we could probably disable them for affected releases only.
Maybe it is just a problem of initializing the data structures once.
Just do
(string-match "\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(\\(.\
\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)\\)" "x")
once, and everything will turn out fine.
Or something. I hate life.
Am I supposed to laugh or cry now? After doing this, the segfault
doesn't happen anymore.
Wait for feedback from the XEmacs folks. The above is just blindly
poking around in the dark. It may well be that it does not help
across a (save-match-data ...) or across the equivalent implemented
for process sentinels.

And honestly, it can hardly be called a solution. It is not even a
workaround. It is poking a hornets' nest right in the middle, in the
hope that the furious hornets will be exhausted by the time the guests
arrive.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Loading...