From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id sG7qDwLOS2AZJAAA0tVLHw (envelope-from ) for ; Fri, 12 Mar 2021 20:24:34 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id UKu8CwLOS2DCXQAAB5/wlQ (envelope-from ) for ; Fri, 12 Mar 2021 20:24:34 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7453223DD6 for ; Fri, 12 Mar 2021 21:24:33 +0100 (CET) Received: from localhost ([::1]:46084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKoKm-0005Zx-LJ for larch@yhetil.org; Fri, 12 Mar 2021 15:24:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKoK5-0005Eb-Nq for help-guix@gnu.org; Fri, 12 Mar 2021 15:23:50 -0500 Received: from mout02.posteo.de ([185.67.36.66]:47265) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKoK1-0004z2-EG for help-guix@gnu.org; Fri, 12 Mar 2021 15:23:49 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id B595B2400FD for ; Fri, 12 Mar 2021 21:23:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1615580621; bh=zoU6uY4appFtPgEzWvBGJrYvZkV5Fx7vZEuJXXNs/vY=; h=From:To:Subject:Date:From; b=Gl4Jo6TMet2M++IeoqGDRP7qF7wAWSTFLCK28lYy/vdNAJTeMMOmqMFvP+P87BPCG 5mOUZQQJNmCPB9D9RRqMaSUkXqoYG6KLJznH2YnR0GCVGCK+spf90y/QIaFdqfuOTk vLJcW8BE4X8YAFUpFbNEkEfWHJQygQKkw7v5PZo+b5u2g3DecFoNKfl0lkscrZvzUc r9gUQcnCwjNrqFSwMhWkDLhs0Kk4Iw/JnL2cv/b+GIjKvsfU4D9/Rb5rzxCB7gl0ws dWUEl+a5BGvyzDGE28JhAo4ggj25t/f3giSGk5gKw9kEuCxs6udh8egXCpguGdzmMr MdqZeMSceMk3Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Dxy251F5Qz9rxG for ; Fri, 12 Mar 2021 21:23:40 +0100 (CET) From: HiPhish To: help-guix@gnu.org Subject: Segfault when building GTK+ application with Meson Date: Fri, 12 Mar 2021 21:21:39 +0100 Message-ID: <4639154.31r3eYUQgx@titan> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart4306740.LvFx2qVVIh" Content-Transfer-Encoding: 7Bit Received-SPF: pass client-ip=185.67.36.66; envelope-from=hiphish@posteo.de; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615580673; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=t6B2Rg531+PIgKZXE1HwFsVYVGwqqDk06SY2K3n3toY=; b=ch52aK1ZIeQLdmwdenEIWkOkkSsMV54kSqsOIjVxDGave2dQaqyA5DUQIjQD7dPicNpZ8/ JHytoDTLvNO/dFVGS7fI824n1MeSsj5b/+7yjYH8/zmJSgyEckr57V+PFlM1kr17Qsa50X mJgTuF32WQt2hCZJ6PZ3lwWocUqbwsJV92XHLSvMGVkRpjmCRXOzN8M32V6tVKfoy4KdEH JD84srAkyHWx6OxeTb+CYfDAzj91Sb4LxIDmf7hB0ww79kRoOu8LRMuOI9FPwylYo5v+oW AFlBCFZIvBgOf61yMV2/ecPJr0LfZ5vk0vmI5PJoyqCl/2AXkiSiwCqAVJ/auA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615580673; a=rsa-sha256; cv=none; b=MFF4MjzlD8otAdaC/pJHOOwruXevisjlpg8hObfr9xcm2czfL+l/SMejLQx0xlQyqxefAl 67BiHQln6LpTDgbmuNggxMHR2sqYwkpgfcsfV76EXnqvUrHHPGlQEn5VUedfv1z9oSJECC tHGIvaHgMX8gthqMt8x3flSFDFM6/5xNYKnX2zdghUFqf72eryKNKRu4AhjDGdlRTfdUsB g7qu5tXVjGJBP6scnMyYFK2SmzGajENn6LwsPDeSMoyuMq5BgbwlbU4PfGiYJ51SmvtHNT EVq/hwnWjEoYhD4M9qN/FBzSHz/rCjII3RP4TNWblxRy5J6NLFTUI7Rr44cL2g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.de header.s=2017 header.b=Gl4Jo6TM; dmarc=pass (policy=none) header.from=posteo.de; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: -0.49 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.de header.s=2017 header.b=Gl4Jo6TM; dmarc=pass (policy=none) header.from=posteo.de; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 7453223DD6 X-Spam-Score: -0.49 X-Migadu-Scanner: scn0.migadu.com X-TUID: MmFTIisDLBRi This is a multi-part message in MIME format. --nextPart4306740.LvFx2qVVIh Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Hello everyone, I have a weird problem: when I create a Guix environment for GTK+ development and when I use Meson to build the project I get a segmentation fault when I run the compiled application. I have tried with a basic C example from Meson's website[1]. Here is the environment manifest: (specifications->manifest '("gcc-toolchain" "meson" "ninja" "pkg-config" "gtk+@3")) I enable it as usual: `guix environment -m guix.scm`. Then I compile it with Meson as usual and run it: $ meson build $ cd build $ meson compile $ ./demo Segmentation fault The C code, stripped down to the base basic of what it takes to trigger as segfault: #include #include static void activate(GtkApplication *app, gpointer user_data) { GtkWidget *window; GtkWidget *label; window = gtk_application_window_new(app); /* <--- Note this */ } int main(int argc, char **argv) { GtkApplication *app; app = gtk_application_new(NULL, G_APPLICATION_FLAGS_NONE); puts("Hello"); return 0; } If I remove the marked line above the application terminates normally. However, if I compile the above code with GCC it works fine: $ gcc $(pkg-config --cflags --libs gtk+-3.0) main.c hello Loading the segfault into GDB reveals the following: $ gdb ./demo core.32123 GNU gdb (GDB) 10.1 Reading symbols from ./demo... [New LWP 32123] [Thread debugging using libthread_db enabled] Using host libthread_db library "/gnu/store/ fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/libthread_db.so.1". Core was generated by `./demo'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007fe962f75f2c in call_init (l=, argc=argc@entry=1, argv=argv@entry=0x7ffdd0e22cf8, env=env@entry=0x7ffdd0e22d08) at dl-init.c:74 74 dl-init.c: No such file or directory. It would be really nice if you could help me track down the issue because it affects more than just GTK+, but I have not been able to narrow its source down any further. I have attached the source code (I hope that's OK with the rules). To provide some background: I want to get into GTK+ development and Vala, so I tried running the Vala language server. It has a bug which has been fixed in the current master branch, so I tried compiling from source, but I get a segmentation fault there as well. The only dependencies GTK+ 3 and the Vala language server have in common are glib and json-glib, so my guess is that's it's something inside glib. The language server does not segfault if I let Guix build it, only if I use Guix to set up an environment and then compile it from source myself. [1]: https://mesonbuild.com/Tutorial.html --nextPart4306740.LvFx2qVVIh Content-Disposition: attachment; filename="main.c" Content-Transfer-Encoding: 7Bit Content-Type: text/x-csrc; charset="utf-8"; name="main.c" #include #include static void activate(GtkApplication *app, gpointer user_data) { GtkWidget *window; GtkWidget *label; window = gtk_application_window_new(app); /* label = gtk_label_new("Hello GNOME!"); */ /* gtk_container_add(GTK_CONTAINER(window), label); */ /* gtk_window_set_title(GTK_WINDOW(window), "Welcome to GNOME"); */ /* gtk_widget_show_all(window); */ } int main(int argc, char **argv) { GtkApplication *app; int status; app = gtk_application_new(NULL, G_APPLICATION_FLAGS_NONE); puts("Hello"); /* g_signal_connect(app, "activate", G_CALLBACK(activate), NULL); */ /* status = g_application_run(G_APPLICATION(app), argc, argv); */ /* g_object_unref(app); */ /* return status; */ return 0; } --nextPart4306740.LvFx2qVVIh Content-Disposition: attachment; filename="meson.build" Content-Transfer-Encoding: 7Bit Content-Type: text/x-meson; charset="utf-8"; name="meson.build" project('tutorial', 'c') gtkdep = dependency('gtk+-3.0') glibdep = [dependency('glib-2.0'), dependency('gobject-2.0')] executable('demo', 'main.c', dependencies: gtkdep) --nextPart4306740.LvFx2qVVIh Content-Disposition: attachment; filename="guix.scm" Content-Transfer-Encoding: 7Bit Content-Type: text/x-scheme; charset="utf-8"; name="guix.scm" ;;; Manifest file for GNU Guix environment (specifications->manifest '("gcc-toolchain" "meson" "ninja" "pkg-config" "gtk+@3")) --nextPart4306740.LvFx2qVVIh--