Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 344885

Summary: >=dev-db/mysql-5.1.51 undefined reference to `_db_pargs_'
Product: Gentoo Linux Reporter: Alexander Goomenyuk <emerg.reanimator>
Component: Current packagesAssignee: Gentoo Linux MySQL bugs team <mysql-bugs>
Status: RESOLVED TEST-REQUEST    
Severity: normal CC: david.oberlitner, knielsen, kripton, terietor, tim
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://bugs.mysql.com/bug.php?id=37606
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Build log
Emerge --info output
/var/tmp/portage/dev-db/mysql-5.1.56/temp/build.log

Description Alexander Goomenyuk 2010-11-10 06:05:38 UTC
mysql build failed with:
../../strings/.libs/libmystrings.so: undefined reference to `_db_pargs_'
../../strings/.libs/libmystrings.so: undefined reference to `_db_doprnt_'
../../strings/.libs/libmystrings.so: undefined reference to `_db_enter_'
../../strings/.libs/libmystrings.so: undefined reference to `_db_return_'

Tried several times, but the result is the same.
It might be ebuild issue also. Please look at upstream, bug report. The similar problem occurs when building from "old tree". I am not sure what stands for "tree" term.

ccache disabled.
Comment 1 Alexander Goomenyuk 2010-11-10 06:07:10 UTC
Created attachment 253839 [details]
Build log
Comment 2 Alexander Goomenyuk 2010-11-10 06:07:38 UTC
Created attachment 253841 [details]
Emerge --info output
Comment 3 Tim Redman 2010-11-12 16:40:46 UTC
I am seeing this same build error.  I have MySQL on two different machines, and it spits this error out on only one.  The only difference between the two is that I have the "debug" USE flag set on the one that is failing.  The "debug" USE flag is also set in the attached "emerge --info" output that the OP provided.  I'm recompiling now without the flag enabled and will post results as soon as it's finished.
Comment 4 Tim Redman 2010-11-12 17:11:15 UTC
To update, the build completed successfully with the "debug" USE flag turned off.  So that would appear to be the immediate workaround for this issue, until somebody can figure out what the problem is with the debugging code.
Comment 5 Alexander Goomenyuk 2010-11-16 13:21:13 UTC
(In reply to comment #3)
> I am seeing this same build error.  I have MySQL on two different machines, and
> it spits this error out on only one.  The only difference between the two is
> that I have the "debug" USE flag set on the one that is failing.  The "debug"
> USE flag is also set in the attached "emerge --info" output that the OP
> provided.  I'm recompiling now without the flag enabled and will post results
> as soon as it's finished.
> 
This also works for me on two PCs.

Comment 6 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2010-11-16 13:48:18 UTC
*** Bug 345693 has been marked as a duplicate of this bug. ***
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-11-27 11:05:51 UTC
jmbsvicetto:
It looks like that the shared embedded patch is causing this. Ask the patch author to look please?
Comment 8 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2010-11-27 14:48:26 UTC
*** Bug 346963 has been marked as a duplicate of this bug. ***
Comment 9 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2010-11-27 14:50:29 UTC
knielsen is looking at the patch. It seems we'll have to add a link to libdbug on libmystrings or mysql will fail to build when enabling debug.
Comment 10 Kristian Nielsen 2010-11-27 21:28:47 UTC
I think this happens because there is a cyclic dependency between libmysys and libdbug. Apparently this does not work well with -Wl,--as-needed when libmysys and libdbug are build as .so.

I pushed a patch here that I think fixes the problem (I only tested applying manually against a MySQL source tarball, not inside gentoo):

    git@github.com:knielsen/gentoo-mysql-extra.git

It avoids building libdbug.so and friends, which should solve the problem
Comment 11 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-11-27 22:10:56 UTC
Doing a test run with that updated patch now, thanks.
Comment 12 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-11-28 04:41:29 UTC
knielsen:
(In reply to comment #10)
> I think this happens because there is a cyclic dependency between libmysys and
> libdbug. Apparently this does not work well with -Wl,--as-needed when libmysys
> and libdbug are build as .so.
> 
> I pushed a patch here that I think fixes the problem (I only tested applying
> manually against a MySQL source tarball, not inside gentoo):
>     git@github.com:knielsen/gentoo-mysql-extra.git
> It avoids building libdbug.so and friends, which should solve the problem
This patch has problems:
5.1.52: test-unit now fails (it passed on the previous version):

make -j4 -l7 test-unit 
cd unittest && make test
make[1]: Entering directory `/var/tmp/portage/dev-db/mysql-5.1.52/work/mysql/unittest'
perl unit.pl run mytap mysys strings  ../storage/archive ../storage/blackhole ../storage/csv ../storage/federated ../storage/heap ../storage/innobase ../storage/innodb_plugin ../storage/myisam ../storage/myisammrg  
Running tests: mytap mysys strings ../storage/archive ../storage/blackhole ../storage/csv ../storage/federated ../storage/heap ../storage/innobase ../storage/innodb_plugin ../storage/myisam ../storage/myisammrg
mysys/bitmap-t ..... Unrecognized character \x7F at mysys/bitmap-t line 1.
^M                       ^Mmysys/bitmap-t ..... Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run 
mysys/base64-t ..... Unrecognized character \x7F at mysys/base64-t line 1.
^M                       ^Mmysys/base64-t ..... Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run 
strings/strings-t .. Unrecognized character \x7F at strings/strings-t line 1.
^M                       ^Mstrings/strings-t .. Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run 

Test Summary Report
-------------------
mysys/bitmap-t   (Wstat: 65280 Tests: 0 Failed: 0)
  Non-zero exit status: 255
  Parse errors: No plan found in TAP output
mysys/base64-t   (Wstat: 65280 Tests: 0 Failed: 0)
  Non-zero exit status: 255
  Parse errors: No plan found in TAP output
strings/strings-t (Wstat: 65280 Tests: 0 Failed: 0)
  Non-zero exit status: 255
  Parse errors: No plan found in TAP output
Files=3, Tests=0,  1 wallclock secs ( 0.02 usr +  0.01 sys =  0.03 CPU)
Result: FAIL
Failed 3/3 test programs. 0/0 subtests failed.
make[1]: *** [test] Error 255

5.1.53: compile failure (previous version of patch worked).

make[2]: Entering directory `/var/tmp/portage/dev-db/mysql-5.1.53/work/mysql/cmd-line-utils/readline'
x86_64-pc-linux-gnu-gcc -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR -D_GNU_SOURCE=1 -I. -I../../include -I../../include -I../../include -I../..   -Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror -g -DSAFE_MUTEX -DSAFEMALLOC -march=nocona -O2 -pipe -g -DHAVE_ERRNO_AS_DEFINE=1 -fno-strict-aliasing   -DUNIV_LINUX -DUNIV_LINUX -MT complete.o -MD -MP -MF .deps/complete.Tpo -c -o complete.o complete.c
cc1: warnings being treated as errors
complete.c: In function 'fnprint':
complete.c:676: error: ignoring return value of 'fwrite', declared with attribute warn_unused_result
make[2]: *** [complete.o] Error 1
make[2]: *** Waiting for unfinished jobs....

Comment 13 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-11-28 05:24:57 UTC
Ignore the last message, I'm testing more combinations and got some of them confused.
Comment 14 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-11-28 23:25:27 UTC
I've put USE=debug into package.use.mask for these MySQL versions now, so that I can roll out 5.1.52-r1 and 5.1.53.

knielsen:
1. test-unit in 5.1.5[23] breaks with your latest patch.
2. 5.1.53 refuses to compile with USE=debug, regardless of which patch version.

Comment 15 Kristian Nielsen 2010-11-29 11:19:00 UTC
There is something really wierd with those failures:

"mysys/bitmap-t ..... Unrecognized character \x7F at mysys/bitmap-t line 1"

mysys/bitmap-t is supposed to be an elf binary, but it looks like something is trying to run it as some kind of script (Perl/sh)?

I was not able to repeat locally :-(

Note that I made and test the patch against 5.1.50, as that is what the version in the file name says ...
Comment 16 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-04-21 12:47:33 UTC
please test 5.1.56 and reopen if needed.
Comment 17 Alexander Goomenyuk 2011-04-23 07:02:17 UTC
(In reply to comment #16)
> please test 5.1.56 and reopen if needed.

I can't classify this resolution as fix of the problem, but at least it state explicitly that debug not supported.

Here is /var/tmp/portage/dev-db/mysql-5.1.56/temp/build.log with debug USE flag
 * Package:    dev-db/mysql-5.1.56
 * Repository: gentoo
 * Maintainer: mysql-bugs@gentoo.org
 * USE:        community debug elibc_glibc kernel_linux perl ssl userland_GNU x86
 * FEATURES:   sandbox splitdebug
 * ERROR: dev-db/mysql-5.1.56 failed (setup phase):
 *   Bug #344885: Upstream has broken USE=debug for 5.1 series >=5.1.51
 * 
 * Call stack:
 *      ebuild.sh, line   56:  Called pkg_setup
 *      ebuild.sh, line 1439:  Called mysql_pkg_setup
 *   mysql.eclass, line  804:  Called die
 * The specific snippet of code:
 *         die "Bug #344885: Upstream has broken USE=debug for 5.1 series >=5.1.51"
 * 
 * If you need support, post the output of 'emerge --info =dev-db/mysql-5.1.56',
 * the complete build log and the output of 'emerge -pqv =dev-db/mysql-5.1.56'.
 * The complete build log is located at '/var/tmp/portage/dev-db/mysql-5.1.56/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-db/mysql-5.1.56/temp/die.env'.
 * S: '/var/tmp/portage/dev-db/mysql-5.1.56/work/mysql'
Comment 18 Alexander Goomenyuk 2011-04-23 07:06:32 UTC
Created attachment 270939 [details]
/var/tmp/portage/dev-db/mysql-5.1.56/temp/build.log

Build log w/o debug
Comment 19 Alexander Goomenyuk 2011-04-23 07:16:06 UTC
(In reply to comment #18)
> Created attachment 270939 [details]
> /var/tmp/portage/dev-db/mysql-5.1.56/temp/build.log
> 
> Build log w/o debug

w/o debug USE flag build fails because of undefined reference:
/var/tmp/portage/dev-db/mysql-5.1.56/work/mysql/strings/my_vsnprintf.c:103: undefined reference to `strnmov'
collect2: ld returned 1 exit status
make[3]: *** [resolve_stack_dump] Error 1
make[3]: Leaving directory `/var/tmp/portage/dev-db/mysql-5.1.56/work/mysql/extra'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/dev-db/mysql-5.1.56/work/mysql/extra'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/var/tmp/portage/dev-db/mysql-5.1.56/work/mysql/extra'
make: *** [all-recursive] Error 1
emake failed
Comment 20 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-04-23 13:22:42 UTC
The failure you're getting is a different issue. Please follow it on bug 364451.