Hi,

wt., 23 mar 2021 o 18:36 Willy Tarreau <w...@1wt.eu> napisaƂ(a):

> > It is most probably because of compiler optimizations. Some compiler
> > barriers are necessary to avoid instructions reordering. It is the
> purpose
> > of attached patches. Sorry to ask you it again, but could you make some
> > tests ?
>
 Sure, I'll verify!

I don't believe in it at all. free(), malloc() etc are free to manipulate
> global variables so the compiler cannot reorder these operations around
> them. We're probably facing other corner cases (or the same but not
> totally addressed maybe).
>

After reading I wasn't sure anymore I even tested properly patched package.
:) Fortunately I have a core file so I verified if hlua_not_dumpable
variable exists. I don't know how it is possible that hlua_not_dumpable is
0 in this state (bt), if Christopher theory about lacking compiler barriers
is wrong.

(gdb) p hlua_not_dumpable
$1 = 0

(gdb) bt
#0  __lll_lock_wait_private () at
../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
#1  0x00007f52fb16c34b in __GI___libc_malloc (bytes=bytes@entry=41) at
malloc.c:3063
#2  0x000055d94949e9a9 in hlua_alloc (ud=0x55d9498e90d0
<hlua_global_allocator>, ptr=<optimized out>, osize=4, nsize=41) at
src/hlua.c:8210
#3  0x000055d949622271 in luaM_realloc_ ()
#4  0x000055d949621dbe in luaC_newobj ()
#5  0x000055d949626f4d in internshrstr ()
#6  0x000055d9496271fc in luaS_new ()
#7  0x000055d94961bd03 in lua_pushstring ()
#8  0x000055d94962d48a in luaL_traceback ()
#9  0x000055d9495a1b62 in ha_task_dump (buf=buf@entry=0x7f5247c7f628,
task=0x7f5234057ba0, pfx=pfx@entry=0x55d949672f19 ' ' <repeats 13 times>)
at src/debug.c:227
#10 0x000055d9495a1fd7 in ha_thread_dump (buf=0x7f5247c7f628,
thr=<optimized out>, calling_tid=7) at src/debug.c:91
#11 0x000055d9495a2236 in debug_handler (sig=<optimized out>, si=<optimized
out>, arg=<optimized out>) at src/debug.c:847
#12 <signal handler called>
#13 _int_malloc (av=av@entry=0x7f5234000020, bytes=bytes@entry=56) at
malloc.c:4100
#14 0x00007f52fb16c35d in __GI___libc_malloc (bytes=bytes@entry=56) at
malloc.c:3065
#15 0x000055d94949e9a9 in hlua_alloc (ud=0x55d9498e90d0
<hlua_global_allocator>, ptr=<optimized out>, osize=5, nsize=56) at
src/hlua.c:8210

Reply via email to