lxde / lxterminal

VTE terminal emulator written in GTK
GNU General Public License v2.0
159 stars 56 forks source link

unixsocket.c code over optimized #41

Closed bdubbs closed 4 years ago

bdubbs commented 6 years ago

$ gcc --version gcc (GCC) 7.2.0

When doing a standard build, lxterminal exits immediately. I traced this down the code in unixsocket.c function init():

unlink(socket_path);
g_free(socket_path);
start_controller(&sock_addr, lxtermwin, fd);
return TRUE;

The start_controller() code is called in line and the return code is not set properly. If I pass:

CFLAGS="-O2 -fno-inline-functions-called-once -fno-inline-small-functions" ./configure

and rebuild unixsocket.c, lxterminal then starts normally. This actually looks like a compiler optimization bug to me, but I suggest you address it either as above or with some other way to return the correct value.

-- Bruce Dubbs linuxfromscratch.org

mtasaka commented 6 years ago

This is most probably due to #40 .

bdubbs commented 6 years ago

Indeed.

sed -i '/lxtermwin, argc, argv/s/init/return init/' src/unixsocket.c

fixes the problem for me.