[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#637236: FTBFS on kfreebsd-amd64: gengtype: Internal error: abort in get_output_file_with_visibility, at gengtype.c:1998


The Internal error: abort in get_output_file_with_visibility, at
gengtype.c:1998, seen sometimes on kFreeBSD, seems to be here:

> err = regcomp (files_rules[rulix].frul_re,
>                files_rules[rulix].frul_srcexpr,
>                files_rules[rulix].frul_rflags);
> if (err)
>   {
>     /* The regular expression compilation fails only when
>        file_rules is buggy.  */
>     gcc_unreachable ();

So it seems to fail to compile a regex, but apparently not always.
Unfortunately we can't see the return value / error (and nobody could
reproduce this yet outside of the buildds), but I guess an error that
might happen only _sometimes_ is REG_ESPACE (The regex routines ran out
of memory).

This happens inside of a loop, so maybe something is exhausting
resources and leaving too little memory for when some unused-yet regex
needs to be compiled?  A new obstack is created on each iteration but
they were not being properly freed until this commit (fixing it in GCC
4.7.0, but not in GCC 4.6.3) :


So I guess that could be worth a try?

Also in another commit I noticed a change that might be important when
multiple jobs are running (though this doesn't seem to be the situation
yet for gcc-4.6 on kFreeBSD) :


Specifically this part:

@@ -3853,9 +3862,10 @@
 # First, parse all files and save a state file.
 	$(RUN_GEN) build/gengtype$(build_exeext) $(GENGTYPE_FLAGS) \
-                    -S $(srcdir) -I gtyp-input.list -w gtype.state
+                    -S $(srcdir) -I gtyp-input.list -w tmp-gtype.state
 # Second, read the state file and generate all files.  This ensure that
 # gtype.state is correctly read:
+	$(SHELL) $(srcdir)/../move-if-change tmp-gtype.state gtype.state
 	$(RUN_GEN) build/gengtype$(build_exeext) $(GENGTYPE_FLAGS) \
                     -r gtype.state
 	$(STAMP) s-gtype

Steven Chamberlain

Reply to: