Closed fsgeek closed 4 years ago
Seems to happen for touch as well.
This was a termination ordering issue - the preload code called close when we were cleaning up resources. Solution was to move the close to before I cleaned up the file descriptor map table.
Scenario: LD_PRELOAD on ls. Crashes:
(gdb) bt
0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
1 0x00007ffff75e5801 in __GI_abort () at abort.c:79
2 0x00007ffff75d539a in __assert_fail_base (fmt=0x7ffff775c7d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
3 0x00007ffff75d5412 in __GI___assert_fail (assertion=0x7ffff7bcb917 "fd_lookup_table", file=0x7ffff7bcb900 "../finesse/api/fdmgr.c", line=291,
4 0x00007ffff7bc9961 in finesse_lookup_file_state (fd=6) at ../finesse/api/fdmgr.c:291
5 0x00007ffff7bc2efb in finesse_close (fd=6) at ../finesse/api/openclose.c:249
6 0x00007ffff7bc159c in close (fd=6) at ../finesse/preload/close.c:10
7 0x00007ffff7bc4f1d in CleanupClientConnectionState (ccs=0x555555787a30) at ../finesse/communications/fcc.c:24
8 0x00007ffff7bc5533 in FinesseStopClientConnection (FinesseClientHandle=0x555555787a30) at ../finesse/communications/fcc.c:130
9 0x00007ffff7bc1cff in finesse_real_shutdown () at ../finesse/api/init.c:77
10 0x00007ffff7bc15c1 in finesse_preload_deinit () at ../finesse/preload/init.c:22
11 0x00007ffff7de5b73 in _dl_fini () at dl-fini.c:138
12 0x00007ffff75e8041 in run_exit_handlers (status=0, listp=0x7ffff7990718 <exit_funcs>, run_list_atexit=run_list_atexit@entry=true,
13 0x00007ffff75e813a in __GI_exit (status=) at exit.c:139
---Type to continue, or q to quit---
14 0x00007ffff75c6b9e in __libc_start_main (main=0x555555557e90, argc=2, argv=0x7fffffffe0c8, init=, fini=,
15 0x000055555555987a in ?? ()
This looks like an ordering issue - we've torn down the table, but we're still trying to use it.