[MDEV-21293] mariabackup crashes when not using full path Created: 2019-12-11 Updated: 2023-04-27 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Backup |
| Affects Version/s: | 10.2.9, 10.3.2, 10.4.0, 10.4.10 |
| Fix Version/s: | 10.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | László Károlyi | Assignee: | Marko Mäkelä |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | backup, crash | ||
| Environment: |
OSX Catalina, Homebrew binary & source compiled |
||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Hi, this is the same bug that occurred in https://jira.mariadb.org/browse/MDEV-14453. Here's the transcript from IRC #maria: 18:22 < karolyi> hey guys, mariabackup is coredumping for me on Catalina: 'mariabackup - seemingly the bug still persists. |
| Comments |
| Comment by Marko Mäkelä [ 2019-12-12 ] | |||||||
|
karolyi, can you produce a stack trace for the crash? I realize that invoking the program in gdb might use a full pathname to the executable, but perhaps you can try that nevertheless? Another option would be to invoke as
and hope that the core dump will be enabled before the unknown option --help is being processed. Then, you would have to do
If all this fails, then as a last resort I would ask you to attach the output of
so that we would get some idea where it crashes. Finally, from which binary package was /usr/local/bin/mariabackup installed? We might need a build log of that. | |||||||
| Comment by László Károlyi [ 2019-12-12 ] | |||||||
|
Hey, I'm not sure I have `strace` on a macbook, much less GDB but I'll try to get some debug output when I get back there. As for the package question, I believe homebrew uses the following script to build the package: | |||||||
| Comment by László Károlyi [ 2019-12-12 ] | |||||||
|
Alright, I'm back on my mac again. GDB will run the binary with the full path and it will work. mariabackup --core-file --help doesn't create a core file, it crashes before it gets to that point. the strace equivalent on osx is dtruss, that gives the following output: {{ Laszlos-MBP:~ root# dtruss mariabackup --help SYSCALL(args) = return }} hope this helps. | |||||||
| Comment by Marko Mäkelä [ 2019-12-12 ] | |||||||
|
karolyi, can you try to set a breakpoint to sigaction and then remove those calls? I would expect SIGABRT to create a core dump by default. Then we should hopefully get to the right point. For the record, on my Debian GNU/Linux system, I just tried invoking mariabackup that was built using cmake -DWITH_ASAN=ON, and I see no crash for
The exit code is 1, and I get a list of parameters and their values as output. With a signal, the exit code ought to be something like 128+SIGABRT = 134. | |||||||
| Comment by László Károlyi [ 2019-12-12 ] | |||||||
|
I'm not experienced enough with debugging and setting breakpoints on already compiled stuff on OSX. If you can tell me how, I can try. | |||||||
| Comment by Marko Mäkelä [ 2019-12-12 ] | |||||||
|
An alternative solution would be to add a sleep to the start of the main() function and then
to attach the debugger to the process before it has a chance of crashing. Then we should get a proper stack trace of the crash. | |||||||
| Comment by László Károlyi [ 2019-12-12 ] | |||||||
|
attaching a GDB right after firing up the process the way you told doesn't help unfortunately. the process quits before GDB could attach itself to it. | |||||||
| Comment by Marko Mäkelä [ 2019-12-12 ] | |||||||
|
Did you try to add a call to sleep at the start of the main() function? man 3 sleep tells me:
| |||||||
| Comment by László Károlyi [ 2019-12-12 ] | |||||||
|
I managed to put a my_sleep(1000000) into main() and copied the compiled file in place. GDB can't attach, here's the message: Attaching to process 30804 the newly compiled file still crashes. | |||||||
| Comment by László Károlyi [ 2019-12-12 ] | |||||||
|
Sorry, my bad, GDB has to be started as root. I see the following: Attaching to process 31669 warning: Mach error at "i386-darwin-nat.c:132" in function "virtual void i386_darwin_nat_target::fetch_registers(struct regcache *, int)": (os/kern) invalid argument (0x4) warning: unhandled dyld version (16) | |||||||
| Comment by Marcin Gryszkalis [ 2020-01-14 ] | |||||||
|
I debugged this problem (on FreeBSD - it doesn't happen on Linux as it uses /proc/self/exe which always works).
because call to realpath(3) fails and above assignment is invalid as my_errno is not int, it's defined as
but above test runs before threads are initialized and my_thread_var is unusable | |||||||
| Comment by Marko Mäkelä [ 2020-01-16 ] | |||||||
|
marcin.gryszkalis, thank you for your analysis! Could you please submit a pull request for MariaDB Server 10.2 to fix it? That seems to be the earliest affected version. | |||||||
| Comment by Dmitry Petrov [ 2020-10-28 ] | |||||||
|
So, will this annoying bug ever be fixed? |