[Vala] Regression in git master: array dup wants 1.8 TB of RAM



Hello,

Today I updated my local working tree of Vala, built and installed it,
and was unable to build the application I am working on; it wanted 1.8
TB of RAM to copy an array (that was the best I could isolate out of
the issue looking at gdb output).

I did a "git bisect" on the Vala repository and have identified this
commit (74cb5c7d) as the cause:

 http://git.gnome.org/cgit/vala/commit/?id=74cb5c7d6d1df95f7779f84b58f31ceeab5417ad

I then updated my git working tree to master again, and reverted this
commit locally.  I am now able to build my project again without it
asking for 1.8 TB at runtime.

I have not been able to isolate a "smallest test case" to exhibit the
problem, though I can say that the problem appears with AllTray.vala in
the following source tree in HEAD [r44 at the time of this writing]:

 https://code.edge.launchpad.net/~alltray-developers/alltray/trunk

What I _do_ know is that it seems like a regression to a bug I'd
previously reported in IRC where array duplication tried to allocate
1.8 TB of RAM (which of course failed).  The Vala-generated C source is:

static char** _vala_array_dup1 (char** self, int length) {
        char** result;
        int i;
        const char* _tmp0_;
        result = g_new0 (char*, length); // crashes on this line
        for (i = 0; i < length; i++) {
                result[i] = (_tmp0_ = self[i], (_tmp0_ == NULL) ?
NULL : g_strdup (_tmp0_)); }
        return result;
}

Again, I can't figure out why, and there are roughly 1000 lines in this
file (and gdb doesn't seem to be getting the backtrace right, for some
reason, the line above it claimed was in function
"all_tray_program_construct", which is quite obviously wrong).

        --- Mike




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