# Mysqld crashes at first start

## mamac

Hi,

Installing dev-db/mariadb-5.5.40-r1 on a frech Gentoo hosted on a Soekris Net4801 (Geode).

emerge --config =dev-db/mariadb-5.5.40-r1 runs fine.

But when I start mysql (/etc/init.d/mysql start), it crashes.

```

141123 14:36:52 [ERROR] mysqld got signal 4 ;

This could be because you hit a bug. It is also possible that this binary

or one of the libraries it was linked against is corrupt, improperly built,

or misconfigured. This error can also be caused by malfunctioning hardware.

To report this bug, see http://kb.askmonty.org/en/reporting-bugs

We will try our best to scrape up some info that will hopefully help

diagnose the problem, but since we have already crashed, 

something is definitely wrong and this may fail.

Server version: 5.5.40-MariaDB-log

key_buffer_size=16777216

read_buffer_size=262144

max_used_connections=0

max_threads=153

thread_count=0

It is possible that mysqld could use up to 

key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 135575 K  bytes of memory

Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0x0

Attempting backtrace. You can use the following information to find out

where mysqld died. If you see no messages after this, something went

terribly wrong...

stack_bottom = 0x0 thread_stack 0x48000

/usr/sbin/mysqld(my_print_stacktrace+0x29)[0x84aaa0b]

/usr/sbin/mysqld(handle_fatal_signal+0x275)[0x826f678]

linux-gate.so.1(__kernel_sigreturn+0x0)[0xb77a7c80]

/usr/sbin/mysqld[0x8406241]

/usr/sbin/mysqld[0x83ee132]

/usr/sbin/mysqld[0x840b9c0]

/usr/sbin/mysqld[0x83cc944]

/usr/sbin/mysqld[0x83a4b95]

/usr/sbin/mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x51)[0x8271429]

/usr/sbin/mysqld[0x81a38f6]

/usr/sbin/mysqld(_Z11plugin_initPiPPci+0x3ef)[0x81a5ae1]

/usr/sbin/mysqld[0x8146d9d]

/usr/sbin/mysqld(_Z11mysqld_mainiPPc+0x9fc)[0x8148a8a]

/usr/sbin/mysqld(main+0x1b)[0x813085b]

/lib/libc.so.6(__libc_start_main+0xf3)[0xb72a65f3]

/usr/sbin/mysqld[0x8142a34]

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains

information that should help you find out what is causing the crash.

```

I've seen several Gentoo users with the same problem but it was old topics...

Any hint appreciated.

Thank you.

----------

## Ant P.

Hm, it's crashing in a "plugin_init"... do you have any exotic storage engines enabled?

----------

## mamac

Not sure I have anything exotic, it's a very standard/default installation.

Below are the flags used for Mariadb:

```

# emerge -pv mariadb

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R    ] dev-db/mariadb-5.5.40-r1  USE="community pam perl ssl -bindist -cluster -debug -embedded -extraengine -jemalloc -latin1 -max-idx-128 -minimal -oqgraph -profiling (-selinux) -sphinx -static -static-libs -systemtap -tcmalloc {-test} (-tokudb)" 0 kB

```

On my dev. environment where mysql starts fine I have "bindist" enabled, maybe I need to enable it...

Also tried to start mysql wiht mysqld_safe:

```

# mysqld_safe --skip-grant-tables --skip-networking

141123 21:32:09 mysqld_safe unknown option '--err-log=/var/log/mysql/mysql.err'

141123 21:32:10 mysqld_safe Logging to '/var/log/mysql/mysqld.err'.

141123 21:32:11 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

141123 21:32:15 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

```

----------

## mamac

Uninstalled and re-installed Mariadb and updated world, but still the same problem.

I read that it could be related to mismatch with 32/64 bits build?

How can I make sure the OS and the Mariadb build is 32 bits?

----------

## mamac

Ok, I think I found what I asked for in the previous message:

```

lljm ~ # uname -m

i586

lljm ~ # mysql --version

mysql  Ver 15.1 Distrib 5.5.40-MariaDB, for Linux (x86_64) using readline 6.2

```

Correct me if I'm wrong but that means the OS is 32 bits and Mariadb is 64, can this setup work?

----------

## Ant P.

You need a 64-bit kernel to run a 64-bit mysqld.

But there's more wrong here than that; if it was really 32-bit you wouldn't be able to run that program at all. And "i586" looks like a symptom of some other misconfiguration, it should print i686 unless you have a really ancient system.

----------

## mamac

Ancient system I have (Soekris NET4801 with Geode CPU).

The i686 won't work on this plateform.

I probably got Mariadb in 64 bits as I originally installed it while chrooting the disc on my laptop which is AMD64.

Any way to get MariaDB 32 bits version?

P.S. emerge apache in the same way but no problem to start apache server...

----------

## mamac

I will try

```

ABI_X86="32" emerge -pv mariadb

```

----------

## mamac

This is where I am now:

```

# uname -a

Linux lljm 3.16.5-gentoo #9 SMP Wed Nov 26 22:12:23 CET 2014 i586 Geode(TM) Integrated Processor by National Semi Geode by NSC GNU/Linux

lljm ~ # file /usr/sbin/mysqld 

/usr/sbin/mysqld: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, stripped

```

But still mysqld doesn't start, same error as in the begining of this thread...

----------

## mamac

I just realized Mariadb seems to be the 64 bits version:

```

$ mysql --version

mysql  Ver 15.1 Distrib 5.5.40-MariaDB, for Linux (x86_64) using readline 5.1

```

Need to find out how to get the 32 bits...

----------

## grknight

 *mamac wrote:*   

> 
> 
> But when I start mysql (/etc/init.d/mysql start), it crashes.
> 
> ```
> ...

 

SIGILL is very uncommon for a simple crash.  Usually an indication of something else going on.

 *mamac wrote:*   

> 
> 
> ```
> 
> stack_bottom = 0x0 thread_stack 0x48000
> ...

 

With a more complete backtrace, there could be more indications of what is going on.

https://wiki.gentoo.org/wiki//etc/portage/env gives instructions on how to get a better debug trace per package.

Brian

----------

