On Wed, 2012-01-11 at 22:24 -0500, Francis Giraldeau wrote:
> > On Thu, 2011-12-29 at 15:50 -0500, Francis Giraldeau wrote:
> > > While working on an updated square lens, the old bug_on error came back. 
> > > This
> > > patch is some proposal to get it fixed. Adding this flag is not pretty, 
> > > but it
> > > works.
> > 
> > I don't recall the details of that problem - what exactly in bug_on is
> > causing segfaults ?
> 
> Yeah, well, the problem is not bug_on. In lens_get, when lns_get returns
> with an error, the function make_exn_lns_error() is called, which
> returns either a normaly allocated value, or a static value with
> exn_error(). The error comes from this static value which is modified at
> various places and produces a segfault.

Aaah, yes, that is nasty.

> I think it was done to report error in case of ENOMEM error. The flag
> solution is not quite exciting. What about allocating this struct in
> advance, say on aug_init? 

Yes, I like that solution much better; we'd allocate it early in
aug_init, reset it in api_entry, and do not need to worry about SIGSEGV
because of modifications.

David


_______________________________________________
augeas-devel mailing list
augeas-devel@redhat.com
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to