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

Re: Bug#816698: subversion: FTBFS on mips, mipsel



Control: reassign -1 gcc-5 5.3.1-10
Control: affects -1 src:subversion

On Fri, Mar 04, 2016 at 06:41:00PM +0100, Christian Hofstaedtler wrote:
> Your package FTBFS on the mips and mipsel buildds:
> 
> https://buildd.debian.org/status/fetch.php?pkg=subversion&arch=mips&ver=1.9.3-2%2Bb1&stamp=1457047589
> https://buildd.debian.org/status/fetch.php?pkg=subversion&arch=mipsel&ver=1.9.3-2%2Bb1&stamp=1457043167
> 
> Both somewhere in the testsuite.

This worked fine previously[0] with the exact same source using gcc-5
5.3.1-6.

[0]: https://buildd.debian.org/status/fetch.php?pkg=subversion&arch=mips&ver=1.9.3-2&stamp=1452933856

The segfaults in the test programs have been seen with gcc-5 5.3.1-10
and 5.3.1-11.  Using sid's gcc-snapshot 20150610-1 works fine.

Experimenting with the GCC optimizations, the tests succeed at -O0 and
-O1 but fail at -O2.  Playing with the individual optimizations, using
"-O2 -fno-ipa-sra" causes the build to succeed and similarly "-O1
-fipa-sra" causes it to fail.

Looking at the backtrace of one of the tests that fails, arguments on
the stack are getting mixed up, causing later function calls to
dereference a pointer of the wrong type and, luckily, segfault since the
memory being used as a pointer happens to be zeros.

etler% gdb --args .libs/lt-client-test --allow-segfaults 10
GNU gdb (Debian 7.10-1+b1) 7.10
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "mipsel-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from .libs/lt-client-test...done.
(gdb) bt
No stack.
(gdb) run
Starting program: /home/jamessan/subversion-1.9.3/BUILD/subversion/tests/libsvn_client/.libs/lt-client-test --allow-segfaults 10
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/mipsel-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
apr_pvsprintf (pool=0x76200988, fmt=0x77f90204 "@%ld", ap=0x7fff33b8) at /build/apr-1WgCht/apr-1.5.2/memory/unix/apr_pools.c:1127
1127    /build/apr-1WgCht/apr-1.5.2/memory/unix/apr_pools.c: No such file or directory.
(gdb) bt
#0  apr_pvsprintf (pool=0x76200988, fmt=0x77f90204 "@%ld", ap=0x7fff33b8) at /build/apr-1WgCht/apr-1.5.2/memory/unix/apr_pools.c:1127
#1  0x77bc1f08 in apr_psprintf (p=<optimized out>, fmt=<optimized out>) at /build/apr-1WgCht/apr-1.5.2/memory/unix/apr_pools.c:2055
#2  0x77f2747c in make_external_description (new_external_description=0x7fff3440, local_abspath_or_url=0x761a0058 "\030", item=0x761781d0, info=0x761781f8, pool=0x76200988, external_pegrev=...)
    at ../subversion/libsvn_client/copy.c:280
#3  0x77f28038 in pin_externals_prop (pinned_externals=0x77f8fbdc, externals_to_pin=0x77f0f5f8, repos_root_url=0x7fff358c "@\026\032v",
    local_abspath_or_url=local_abspath_or_url@entry=0x761a3300 "file:///home/jamessan/subversion-1.9.3/BUILD/subversion/tests/cmdline/svn-test-work/libsvn_client/pin-externals/A", ctx=0x76200988,
    ctx@entry=0x761a0a80, result_pool=0x761a0018, result_pool@entry=0x1, scratch_pool=scratch_pool@entry=0x76178018, externals_prop_val=0x761a3378) at ../subversion/libsvn_client/copy.c:552
#4  0x77f28448 in resolve_pinned_externals (pinned_externals=0x7fff358c, externals_to_pin=0x77f0f5f8, ra_session=0x761a80e0,
    repos_root_url=0x761a0218 "file:///home/jamessan/subversion-1.9.3/BUILD/subversion/tests/cmdline/svn-test-work/libsvn_client/pin-externals", ctx=0x76200988, ctx@entry=0x7fff3854,
    result_pool=result_pool@entry=0x761a0018, scratch_pool=scratch_pool@entry=0x761a0018, pair=0x761a0078, pair=0x761a0078) at ../subversion/libsvn_client/copy.c:651
#5  0x77f2c080 in repos_to_repos_copy (copy_pairs=0x761a0058, make_parents=1981415512, revprop_table=0x1, commit_callback=0x77c92854 <svn_pool_create_ex+64>, commit_baton=0x0,
    commit_baton@entry=0x76200d60, ctx=0x76200988, ctx@entry=0x7619ff98, is_move=0, is_move@entry=2012922000, pin_externals=1, pin_externals@entry=2013122612, externals_to_pin=0x7619ff28,
    externals_to_pin@entry=0x77348018, pool=0x761a0018, pool@entry=0x7619ff28) at ../subversion/libsvn_client/copy.c:1720
#6  0x77f2d744 in try_copy (timestamp_sleep=0x0, dst_path_in=0x761a0018 "\030\200\064w\030\200\027v\030", is_move=is_move@entry=0, allow_mixed_revisions=allow_mixed_revisions@entry=1,
    metadata_only=0, metadata_only@entry=2147432300, make_parents=make_parents@entry=0, ignore_externals=0, ignore_externals@entry=4334816, pin_externals=1, pin_externals@entry=7,
    externals_to_pin=0x7619ff28, externals_to_pin@entry=0x77fcec1c <do_lookup_x+772>, revprop_table=0x0, revprop_table@entry=0x21e, commit_callback=<optimized out>,
    commit_baton=commit_baton@entry=0x0, ctx=0x76200988, ctx@entry=0x77fcec1c <do_lookup_x+772>, pool=<optimized out>, sources=0x76207800, sources=0x76207800)
    at ../subversion/libsvn_client/copy.c:3115
#7  0x77f2d95c in svn_client_copy7 (sources=0x76207800, dst_path=0x76207820 "file:///home/jamessan/subversion-1.9.3/BUILD/subversion/tests/cmdline/svn-test-work/libsvn_client/pin-externals/A_copy",
    copy_as_child=0, make_parents=0, ignore_externals=0, metadata_only=0, pin_externals=1, externals_to_pin=0x7619ff28, revprop_table=0x0, commit_callback=0x0, commit_baton=0x0, ctx=0x76200988,
    pool=0x77348018) at ../subversion/libsvn_client/copy.c:3148
#8  0x00402c9c in test_copy_pin_externals (opts=<optimized out>, pool=0x77348018) at ../subversion/tests/libsvn_client/client-test.c:1159
#9  0x77faecd4 in do_test_num (progname=0x108 <error: Cannot access memory at address 0x108>, test_num=2000029808, test_funcs=0x41a1a0 <test_funcs>, msg_only=451661471, opts=0x7fff3a40,
    opts@entry=0x0, header_msg=header_msg@entry=0x0, pool=pool@entry=0x77348018) at ../subversion/tests/svn_test_main.c:466
#10 0x77fb0418 in svn_test_main (argc=3, argv=<optimized out>, max_threads=0, test_funcs=0x41a1a0 <test_funcs>) at ../subversion/tests/svn_test_main.c:1026
#11 0x00408558 in main (argc=1981811080, argv=0x77f90204) at ../subversion/tests/libsvn_client/client-test.c:1442
(gdb) frame 3
#3  0x77f28038 in pin_externals_prop (pinned_externals=0x77f8fbdc, externals_to_pin=0x77f0f5f8, repos_root_url=0x7fff358c "@\026\032v",
    local_abspath_or_url=local_abspath_or_url@entry=0x761a3300 "file:///home/jamessan/subversion-1.9.3/BUILD/subversion/tests/cmdline/svn-test-work/libsvn_client/pin-externals/A", ctx=0x76200988,
    ctx@entry=0x761a0a80, result_pool=0x761a0018, result_pool@entry=0x1, scratch_pool=scratch_pool@entry=0x76178018, externals_prop_val=0x761a3378) at ../subversion/libsvn_client/copy.c:552
552           SVN_ERR(make_external_description(&pinned_desc, local_abspath_or_url,
(gdb) p ctx
$3 = (svn_client_ctx_t *) 0x76200988
(gdb) p iterpool
$4 = (apr_pool_t *) 0x76158018
(gdb) l
547             }
548
549           SVN_ERR_ASSERT(external_pegrev.kind == svn_opt_revision_date ||
550                          external_pegrev.kind == svn_opt_revision_number);
551
552           SVN_ERR(make_external_description(&pinned_desc, local_abspath_or_url,
553                                             item, info, external_pegrev, iterpool));
554
555           svn_stringbuf_appendcstr(buf, pinned_desc);
556         }
(gdb) frame 2
#2  0x77f2747c in make_external_description (new_external_description=0x7fff3440, local_abspath_or_url=0x761a0058 "\030", item=0x761781d0, info=0x761781f8, pool=0x76200988, external_pegrev=...)
    at ../subversion/libsvn_client/copy.c:280
280                 peg_rev_str = apr_psprintf(pool, "@%ld",
(gdb) p pool
$5 = (apr_pool_t *) 0x76200988

Notice that in frame 3 the iterpool argument to
make_external_description is an apr_pool_t pointer to address 0x76158018.
In frame 2, the corresponding pool variable is suddenly referencing
address 0x76200988 instead, which is actually the svn_client_ctx_t
pointer from earlier in the stack.

Cheers,
-- 
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <jamessan@debian.org>


Reply to: