Bug #34985 Test 'loaddata' hangs run in embedded mode, fully static x86 32-bit, gcc 2.95.3
Submitted: 2 Mar 2008 14:19 Modified: 15 Jul 2008 0:30
Reporter: Kent Boortz Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Embedded Library ( libmysqld ) Severity:S3 (Non-critical)
Version:4.1.24 pre OS:Linux (SuSE Linux 7.3)
Assigned to: CPU Architecture:Any
Triage: D1 (Critical)

[2 Mar 2008 14:19] Kent Boortz
Description:
The last lines in the server log are

  SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO
  create table t1(id integer not null auto_increment primary key)
  insert into t1 values(0)
  SELECT * INTO OUTFILE '/somepath/mysql-test/var/tmp/t1' from t1
  delete from t1
  load data infile '/somepath/mysql-test/var/tmp/t1' into table t1
  select * from t1

Thread back traces are

  #0  0x082e040f in __sigsuspend (set=0xbfffbfcc)
      at ../sysdeps/unix/sysv/linux/sigsuspend.c:54
  #1  0x082d4690 in __pthread_wait_for_restart_signal (self=0x855a380)
      at pthread.c:1004
  #2  0x082d42b1 in pthread_onexit_process (retcode=0, arg=0x0) at restart.h:36
  #3  0x082d45a6 in __pthread_kill_other_threads_np () at pthread.c:959
  #4  0x082f8c49 in __execve (file=0x843859d "/bin/sh", argv=0xbfffc228,
      envp=0xbfffd740) at ../sysdeps/unix/sysv/linux/execve.c:42
  #5  0x082e24ee in __libc_system (
      line=0x89757f8 "rm /somepath/mysql-test/var/tmp/t?.*")
      at ../sysdeps/posix/system.c:109
  #6  0x082d6dd1 in system (
      line=0x89757f8 "rm /somepath/mysql-test/var/tmp/t?.*")
      at wrapsyscall.c:159
  #7  0x0804a4e4 in my_system ()
  #8  0x0804a58a in do_system ()
  #9  0x0804f7a3 in main ()

Second thread is in

  #0  0x082e040f in __sigsuspend (set=0xbfffb03c)
      at ../sysdeps/unix/sysv/linux/sigsuspend.c:54
  #1  0x082d4690 in __pthread_wait_for_restart_signal (self=0x855a380)
      at pthread.c:1004
  #2  0x082d42b1 in pthread_onexit_process (retcode=0, arg=0x0) at restart.h:36
  #3  0x082d45a6 in __pthread_kill_other_threads_np () at pthread.c:959
  #4  0x082f8c49 in __execve (file=0x8438f46 "/bin/sh", argv=0xbfffb264,
      envp=0xbfffd740) at ../sysdeps/unix/sysv/linux/execve.c:42
  #5  0x082f8d1c in execl (path=0x8438f46 "/bin/sh", arg=0x8438f43 "sh")
      at execl.c:76
  #6  0x082eacc7 in _IO_new_proc_open (fp=0x8944288,
      command=0x894b4c0 "rm /somepath/mysql-test/var/tmp/t1",
      mode=0x8376525 "r") at iopopen.c:173
  #7  0x082eae0a in _IO_new_popen (
      command=0x894b4c0 "rm /somepath/mysql-test/var/tmp/t1",
      mode=0x8376525 "r") at iopopen.c:231
  #8  0x0804a07c in my_popen ()
  #9  0x0804a278 in do_exec ()
  #10 0x0804fb35 in main ()

Third thread is in a mode of "uninterruptible sleep (usually IO)"
and can't be attached to with gdb.

How to repeat:
Compile the latest 4.1 sources from the BitKeeper repository
or daily snapshot TAR, and build when configures like

  CC="gcc" \
  CFLAGS="-O2 -mcpu=pentiumpro" \
  CPPFLAGS="-I/usr/local/include -DDEFAULT_THREAD_STACK=126976"
  CXX="gcc" \
  CXXFLAGS="-O2 -mcpu=pentiumpro -felide-constructors" \
  LDFLAGS=-L/usr/local/lib \
  ./configure \
  --prefix=/usr/local/mysql \
  --localstatedir=/usr/local/mysql/data \
  --libexecdir=/usr/local/mysql/bin \
  --enable-thread-safe-client \
  --enable-local-infile \
  --enable-assembler \
  --with-pic \
  --with-fast-mutexes \
  --disable-shared \
  --with-client-ldflags=-all-static \
  --with-mysqld-ldflags=-all-static \
  --with-raid \
  --with-readline \
  --with-embedded-server \
  --with-archive-storage-engine \
  --without-falcon \
  --with-innodb \
  --with-extra-charsets=complex

Run the test suite like

  mkdir /tmp/foo
  perl ./mysql-test-run.pl \
  --embedded-server \
  --comment=embedded \
  --skip-rpl --skip-ndbcluster \
  --tmpdir=/tmp/foo \
  --timer --force

Suggested fix:
This is an very old gcc on an very old operating system,
mainly for GLIBC 2.2 compatibility. Not sure this should
be fixed at all.
[3 Mar 2008 19:37] Sveta Smirnova
Thank you for the report.

Verified as described.