Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 878237 - dev-libs/libzia-4.37 leaves trace of segfault in dmesg
Summary: dev-libs/libzia-4.37 leaves trace of segfault in dmesg
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Thomas Beierlein
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-25 07:55 UTC by Agostino Sarubbo
Modified: 2022-10-28 05:36 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2022-10-25 07:55:52 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: dev-libs/libzia-4.37 leaves trace of segfault in dmesg.
Discovered on: amd64 (internal ref: ci)

NOTE:
To reproduce this issue:
1) Install the package with FEATURES=test
2) Check dmesg output with: dmesg -T | grep -E '( segfault | traps:| audit:)'

This type of report comes from a check that is a bit outside of the tinderbox, that's the reason because build.log was not provided (however in cases like these the build.log doesn't help much) but if you need further help to diagnose this issue feel free to ask.

In any case I'm providing what I can see via dmesg.
Comment 1 Agostino Sarubbo gentoo-dev 2022-10-25 07:56:24 UTC
[Tue Oct 25 09:41:25 2022] conftest[2190]: segfault at e9ca854 ip 00007f610e991a79 sp 00007fffbfaf81b8 error 4 in libc.so.6[7f610e85e000+150000]
[Tue Oct 25 09:44:03 2022] conftest[25190]: segfault at 7f0f6854 ip 00007fc77f0bda79 sp 00007ffe3c9def08 error 4 in libc.so.6[7fc77ef8a000+150000]
Comment 2 Thomas Beierlein gentoo-dev 2022-10-25 17:50:18 UTC
According to configure.log the following snippet from configure.ac seemst o be the reason for the segfault:

--
#include <features.h>
#include <stdio.h>
#ifdef __CYGWIN__
#include <cygwin/version.h>
#endif
FILE *f;
int main(void){
    f=fopen("conftest.libc.out", "wt");
    if (!f) return -1;
#ifdef __GLIBC__
    fprintf(f, "glibc %d.%d (%s)\n", __GLIBC__, __GLIBC_MINOR__, gnu_get_libc_version());
#endif
#ifdef __CYGWIN__
    fprintf(f, "cygwin %d.%d.%d, api %d.%d\n",
    CYGWIN_VERSION_DLL_MAJOR/1000,
    CYGWIN_VERSION_DLL_MAJOR%1000,
    CYGWIN_VERSION_DLL_MINOR,
    CYGWIN_VERSION_API_MAJOR,
    CYGWIN_VERSION_API_MINOR);
#endif    
    fclose(f);
    return 0;
}
--

Compiler complains about missing prototype of gnu_get_libc_version() and assumes return type 'int' but the printf() expects an 'char *' instead. Sounds like a missing include file.
Comment 3 Thomas Beierlein gentoo-dev 2022-10-27 20:26:12 UTC
(In reply to Thomas Beierlein from comment #2)
 
> Compiler complains about missing prototype of gnu_get_libc_version() and
> assumes return type 'int' but the printf() expects an 'char *' instead.
> Sounds like a missing include file.

Adding '#include <gnu/libc-version.h>' does indeed fix the problem.

Downside is that the function 'gnu_get_libc_version' seems not to exist in MUSL libc. 
So using the above include does not solve the problem for musl profiles. 

Needs more work
Comment 4 Larry the Git Cow gentoo-dev 2022-10-28 05:36:26 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f9162a5a83a098608205a35ce5abfe7a4edb2f6

commit 2f9162a5a83a098608205a35ce5abfe7a4edb2f6
Author:     Thomas Beierlein <tomjbe@gentoo.org>
AuthorDate: 2022-10-28 05:34:15 +0000
Commit:     Thomas Beierlein <tomjbe@gentoo.org>
CommitDate: 2022-10-28 05:36:01 +0000

    dev-libs/libzia: Fix segfault during configure
    
    Closes: https://bugs.gentoo.org/878237
    Signed-off-by: Thomas Beierlein <tomjbe@gentoo.org>

 dev-libs/libzia/files/libzia-4.37-configure.patch | 14 ++++++++++++++
 dev-libs/libzia/libzia-4.37.ebuild                |  5 +++++
 2 files changed, 19 insertions(+)