pkgsrc-Users archive

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

Re: libgpg-error core dumps on Solaris 10 sparc with gcc 4.9.2



Hi Thomas et all,

I'm amazed that people are still working on this problem. The Solaris environment I settled in with is no-longer pkgsrc based but rather a mix of OpenCSW and my own builds-- It's still GCC 4.9.2 though so there shouldn't be any problem with it to retest.

I went ahead and did the build with the patched src but unfortunately, I'm still seeing (the same?) core dumps:

-bash-3.2# ./gpg-error --version
gpg-error (libgpg-error) 1.21
Assertion failed: !"sizeof lock obj", file posix-lock.c, line 119
Abort (core dumped)

-bash-3.2# pstack core
core 'core' of 17551:   ./gpg-error --version
 ff25ebfc _lwp_kill (6, 0, 0, ff23e0a4, ffffffff, 6) + 8
 ff1d29a8 abort    (ffbff4f0, 1, ff2d3400, ffb58, ff2d5518, 0) + 110
 ff1d2be4 _assert  (ff33cc08, ff33cbf8, 77, ff3337a8, ff874, ff34faf8) + 64
 ff333744 get_lock_object (ff3501b8, ff3330ac, ff3372a4, ff3370d4, 1, 0) + 5c
 ff3337ac _gpgrt_lock_lock (ff3501b8, ffbff80c, 0, ff, 0, 1) + 4
 ff33719c _gpgrt_fflush (0, 0, ff3501b8, 0, 0, 0) + c8
 ff3372a4 do_deinit (1, 1cc4, ff2d7940, ff2d92c0, ff302a00, 1c00) + 10
 ff1d3170 _exithandle (ff2d9540, ff2d7940, 1c00, 1, 1e, 15166) + 40
 ff1c1178 exit     (0, 1, 1e, 25710, ff2d78c4, 92bec) + 4
 000118f0 main     (2, ffbffa0c, ffbffa18, 25840, ff300140, ffbffb10) + 57c
 00010c68 _start   (0, 0, 0, 0, 0, 0) + 5c

The tests all still fail when built with gcc (2/6 fail when built with Sun's compiler but that's another story)

Here's GDB (same but a little nicer to read):

-bash-3.2# gdb ./gpg-error
...
Reading symbols from ./gpg-error...done.
(gdb) run
Starting program: /usr/local/src/gpgerr_final/bin/gpg-error
[Thread debugging using libthread_db enabled]
[New Thread 1 (LWP 1)]
Usage: gpg-error GPG-ERROR [...]
Assertion failed: !"sizeof lock obj", file posix-lock.c, line 119

Program received signal SIGABRT, Aborted.
[Switching to Thread 1 (LWP 1)]
0xff25ebfc in _lwp_kill () from /lib/libc.so.1
(gdb) backtrace
#0  0xff25ebfc in _lwp_kill () from /lib/libc.so.1
#1  0xff1f7ae8 in raise () from /lib/libc.so.1
#2  0xff1d29b0 in abort () from /lib/libc.so.1
#3  0xff1d2bec in _assert () from /lib/libc.so.1
#4  0xff33374c in get_lock_object (lockhd=lockhd@entry=0xff3501b8 <estream_list_lock>) at posix-lock.c:119
#5  0xff3337b4 in _gpgrt_lock_lock (lockhd=lockhd@entry=0xff3501b8 <estream_list_lock>) at posix-lock.c:168
#6  0xff3371a4 in lock_list () at estream.c:421
#7  _gpgrt_fflush (stream=stream@entry=0x0) at estream.c:3700
#8  0xff3372ac in do_deinit () at estream.c:509
#9  0xff1d3178 in _exithandle () from /lib/libc.so.1
#10 0xff1c1180 in exit () from /lib/libc.so.1
#11 0x00011b30 in main (argc=1, argv=0xffbffa64) at gpg-error.c:390

I don't consider myself a seasoned builder so there is always the possibility that I'm doing something wonky in my environment. For that reason, I hope some other Solaris users (few as they may be) might also chime in.

Thanks for your effort!
Ibraheem



On Fri, Feb 26, 2016 at 5:26 AM, Thomas Klausner <wiz%netbsd.org@localhost> wrote:
On Thu, Nov 05, 2015 at 05:00:04PM -0600, Tim Zingelman wrote:
> On Mon, 11 May 2015, Ibraheem Saleh wrote:
>
> > Building libgpg-error 1.19 on Solaris 10 sparc with gcc 4.9.2 succeeds
> > without error but coredumps when trying to use it.
> >
> > bmake test fails all 5 of the tests with the same assertion message:
> >
> > gmake[2]: Entering directory
> > `/usr/pkgsrc/security/libgpg-error/work/libgpg-error-1.19/tests'
> > Assertion failed: !"sizeof lock obj", file posix-lock.c, line 119
> > Abort (core dumped)
> > FAIL: t-version
> >
> > Anyone know whats going on or how to fix this?
>
> I'm thinking that the problem is that in _gpgrt_lock_t the second
> element ends up being 64 bit aligned (a long of padding after vers)
> giving a total sizeof=32 and no such alignment happens for
> gpgrt_lock_t so sizeof=28.  I added a printf before the assert and it
> reported those two exact different sizes, so that supports the theory.
>
> typedef struct
> {
>   long _vers;
>   union {
>     volatile char _priv[24];
>     long _x_align;
>     long *_xp_align;
>   } u;
> } gpgrt_lock_t;
>
> typedef struct
> {
>   long vers;
> #if USE_POSIX_THREADS
>   union {
>     pthread_mutex_t mtx;
>     long *dummy;
>   } u;
> #endif
> } _gpgrt_lock_t;
>
> I just tested on Solaris 10 Sparc and the following patch resolves the
> problem.  I'm not sure if this patch is appropriate for all platforms
> or only Sparc.  If someone else has the cycles to pass this fix
> upstream that would be great.
> (Also note I did NOT take out the patch from
> patches/patch-src_estream.c when testing this fix... it seemed
> unrelated to the assert failure.)
>
>
> --- src/gen-posix-lock-obj.c.orig       Thu Nov  5 16:44:59 2015
> +++ src/gen-posix-lock-obj.c    Thu Nov  5 16:49:19 2015
> @@ -109,7 +109,7 @@
>            "  union {\n"
>            "    volatile char _priv[%d];\n"
>            "%s"
> -          "    long _x_align;\n"
> +          "    long long _x_align;\n"
>            "    long *_xp_align;\n"
>            "  } u;\n"
>            "} gpgrt_lock_t;\n"
>
> Please include me directly in followups, I am not currently subscribed
> to pkgsrc-users.

I had sent the problem report and patch upstream, and NIIBE Yutaka
<gniibe%fsij.org@localhost> committed a patch upstream to fix this, and asked
for testers.

Since I don't have Solaris 10 access, please try:

http://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgpg-error.git;a=commit;h=5168b97fb5e2eebdc99b40f96f9b6289647e87d2

Thanks,
 Thomas



Home | Main Index | Thread Index | Old Index