Closed osalbahr closed 1 year ago
I can guess why it fails, we had the same problem w/ dlsym(). But it's not important right now. Ask me on the next telecon.
On Sat, 13 May 2023 23:42:40 -0700 Osama Albahrani @.***> wrote:
For some reason, intercepting
malloc
fails on Ubuntu but passes on CentOS 7. Unfortunately, there is no CentOS/Fedora runner provided by GitHub (yet? actions/runner-images#1443). I could use docker/podman as a workaround, but I will postpone fiixing this since intercepting malloc() isn't one of my main concerns anyways. Here is the output onUbuntu 22.04.2 LTS x86_64
:***@***.***:~/ld-preload-practice/memkind-file-io$ LD_PRELOAD=./mymalloc.so ./fake-malloc Segmentation fault (core dumped) ***@***.***:~/ld-preload-practice/memkind-file-io$ ./fake-malloc Flushing at 11 Calling malloc sizeof(int) ... iptr = 0x556b737de6b0 Flushing at 15 *iptr = 41 Flushing at 17 Calling malloc sizeof(char) ... cptr = 0x556b737de6b0 Flushing at 22 *cptr = A Flushing at 24 Calling malloc 0 ... zero = 0x556b737de6b0 Flushing at 29 ***@***.***:~/ld-preload-practice/memkind-file-io$ LD_PRELOAD=./mymalloc.so ./fake-malloc Segmentation fault (core dumped) ***@***.***:~/ld-preload-practice/memkind-file-io$ ltrace ./fake-malloc Flushing at 11 Calling malloc sizeof(int) ... iptr = 0x561786bc96b0 Flushing at 15 *iptr = 41 Flushing at 17 Calling malloc sizeof(char) ... cptr = 0x561786bc96b0 Flushing at 22 *cptr = A Flushing at 24 Calling malloc 0 ... zero = 0x561786bc96b0 Flushing at 29 +++ exited (status 0) +++ ***@***.***:~/ld-preload-practice/memkind-file-io$ ltrace ls err.txt fake-malloc fancy-file-io Makefile myio.so mymalloc.so optanemalloc.so README.md exp fake-malloc.c fancy-file-io.c myio.c mymalloc.c optanemalloc.c out.txt test.sh +++ exited (status 0) +++ ***@***.***:~/ld-preload-practice/memkind-file-io$ LD_PRELOAD=./mymalloc.so ls Segmentation fault (core dumped) ***@***.***:~/ld-preload-practice/memkind-file-io$ LD_PRELOAD=./mymalloc.so cd ***@***.***:~$ ltrace cd ***@***.***:~$ sudo apt upgrade -y ltrace Reading package lists... Done Building dependency tree... Done Reading state information... Done ltrace is already the newest version (0.7.3-6.1ubuntu6). Calculating upgrade... Done Get more security updates through Ubuntu Pro with 'esm-apps' enabled: exo-utils libpostproc55 libavcodec58 libavutil56 libswscale5 libexo-2-0 libswresample3 libavformat58 libexo-common libavfilter7 Learn more about Ubuntu Pro at https://ubuntu.com/pro 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. ***@***.***:~$
Agreed. I mostly created this issue for documentation purposes. It’s not my priority to get it working on Ubuntu right now, but it would be nice to eventually do that since it seems to be the OS most used for this type of research. For example, https://github.com/utsaslab/SplitFS#system-requirements, https://github.com/utsaslab/WineFS#system-requirements, and https://github.com/utsaslab/chipmunk/tree/main#system-requirements. Or it could just be UT Austin.
I don’t know if it’s an issue with dlsym()
per se, since “Test fake-fopen” seemed to work fine on the same GitHub Actions build. The next step of isolation would be to try using memkind_malloc() without intercepting libc malloc since it crashes before the program even starts. I was able to fix a similar error on CentOS by intercepting realloc in a similar fashion. I’m guessing Ubuntu uses calloc() at program startup or something. For some reason, ltrace
on Ubuntu as seen above didn’t say much. It might be an issue with the VCL image, not sure.
For some reason, intercepting
malloc
fails on Ubuntu but passes on CentOS 7. Unfortunately, there is no CentOS/Fedora runner provided by GitHub (yet? actions/runner-images#1443). I could use docker/podman as a workaround, but I will postpone fiixing this since intercepting malloc() isn't one of my main concerns anyways. Here is the output onUbuntu 22.04.2 LTS x86_64
: