Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure on Ubuntu 17.04 #1680

Closed
shamisp opened this issue Jul 6, 2017 · 8 comments
Closed

Failure on Ubuntu 17.04 #1680

shamisp opened this issue Jul 6, 2017 · 8 comments

Comments

@shamisp
Copy link
Contributor

shamisp commented Jul 6, 2017

[ RUN      ] malloc_hook.single_thread
[     INFO ] Reduced heap free space to minimum: 4720 after allocating 10000 bytes
*** Error in `/home/pasha/ucx/build/test/gtest/gtest': double free or corruption (out): 0x0000ffff78135010 ***
Makefile:2400: recipe for target 'test' failed
@shamisp
Copy link
Contributor Author

shamisp commented Jul 6, 2017

@yosefe most likely error flow is broken. Ubuntu 17.04. I pretty sure it is generic bug.

@yosefe
Copy link
Contributor

yosefe commented Jul 6, 2017

might be related to #1566

@yosefe yosefe added the Bug label Jul 6, 2017
@shamisp
Copy link
Contributor Author

shamisp commented Jul 6, 2017

Looks similar. I opened up GDB and I do not see anything odd. fails here:

258         ptr = malloc(large_alloc_size);                                                                                                                                               │
   │259         if (!RUNNING_ON_VALGRIND) {                                                                                                                                                   │
   │260             void *state = malloc_get_state();                                                                                                                                         │
   │261             malloc_set_state(state);                                                                                                                                                  │
   │262         }                                                                                                                                                                             │
  >│263         free(ptr);     

@shamisp
Copy link
Contributor Author

shamisp commented Jul 12, 2017

Per @yosefe request adding backtrace:

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
#1  0x0000ffff8fef5f5c in __GI_abort () at abort.c:89
#2  0x0000ffff8ff2d7d8 in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0xffff8ffde800 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
#3  0x0000ffff8ff33bf8 in malloc_printerr (action=3, str=0xffff8ffde928 "double free or corruption (out)", ptr=<optimized out>, ar_ptr=<optimized out>) at malloc.c:5048
#4  0x0000ffff8ff345f8 in _int_free (av=0xffff90006998 <main_arena>, p=0xffff8cdf6000, have_lock=0) at malloc.c:3904
#5  0x00000000004699b8 in test_thread::test (this=0xfffff84cbe98) at /home/ucx/contrib/../test/gtest/ucm/malloc_hook.cc:263
#6  0x0000000000471a84 in test_thread::thread_func (arg=<optimized out>) at /home/ucx/contrib/../test/gtest/ucm/malloc_hook.cc:85
#7  0x0000ffff902c1004 in start_thread (arg=0x471a78 <test_thread::thread_func(void*)>) at pthread_create.c:458
#8  0x0000ffff8ff8bee8 in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:87

@shamisp
Copy link
Contributor Author

shamisp commented Jul 12, 2017

258         ptr = malloc(large_alloc_size);                                                                                                                                               │
   │259         if (!RUNNING_ON_VALGRIND) {                                                                                                                                                   │
   │260             void *state = malloc_get_state();                                                                                                                                         │
   │261             malloc_set_state(state);                                                                                                                                                  │
   │262         }                                                                                                                                                                             │
  >│263         free(ptr);                   

(gdb) p ptr 
$1 = (void *) 0xffff8cdf6010
(gdb) p large_alloc_size
$2 = 41943040
(gdb) 

@shamisp
Copy link
Contributor Author

shamisp commented Jul 12, 2017

I just confirmed, it fails exactly in the same place on x86. So, this is ubuntu 17.04 specific issue.

@shamisp shamisp changed the title Failure on A1100 Failure on Ubuntu 17.04 Jul 12, 2017
@shamisp
Copy link
Contributor Author

shamisp commented Jul 12, 2017

In order to pass the compilation you need #1690

@yosefe
Copy link
Contributor

yosefe commented Feb 4, 2018

should be fixed by 0a214d1 - need to make sure only one thread does malloc_get_state/malloc_set_state, and no other thread calls malloc/free in that time

@yosefe yosefe closed this as completed Feb 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants