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

path.sh test fails on macOS with a call to abort() #169

Closed
krader1961 opened this issue Nov 30, 2017 · 2 comments
Closed

path.sh test fails on macOS with a call to abort() #169

krader1961 opened this issue Nov 30, 2017 · 2 comments
Labels
Milestone

Comments

@krader1961
Copy link
Contributor

After the recent changes to the path.sh test script by @siteshwar I was still seeing failures on macOS. I fixed the problem causing issue #158 but the test was still failing. I traced it to this line in the unit test causing the subshell to fail:

x=$(FPATH= PATH=$PWD/bin $SHELL -c  ': $(whence less); myfun') 2> /dev/null

Specifically it dies from calling abort() because there is another place in the code that calls strcpy() with overlapping buffers:

  * frame #0: 0x00007fff787d1e3e libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff78910150 libsystem_pthread.dylib`pthread_kill + 333
    frame #2: 0x00007fff7872e312 libsystem_c.dylib`abort + 127
    frame #3: 0x00007fff7872e485 libsystem_c.dylib`abort_report_np + 177
    frame #4: 0x00007fff78752c2d libsystem_c.dylib`__chk_fail + 48
    frame #5: 0x00007fff78752c3d libsystem_c.dylib`__chk_fail_overlap + 16
    frame #6: 0x00007fff78752c5f libsystem_c.dylib`__chk_overlap + 34
    frame #7: 0x00007fff78752e39 libsystem_c.dylib`__strcpy_chk + 64
    frame #8: 0x000000010caf67a4 ksh`path_chkpaths(shp=0x000000010cb3a210, first=0x00001e0093e6e590, old=0x0000000000000000, pp=0x00001e0093e6e590, offset=0) at path.c:1691
    frame #9: 0x000000010caf6045 ksh`path_addcomp(shp=0x000000010cb3a210, first=0x00001e0093e6e590, old=0x0000000000000000, name="/var/folders/1j/hh_xsz117m9c5t46yxdz7x8c0000gp/T/tmp.XXXXXXXXXX.kuTUHcxp/bin/../fun", flag=1) at path.c:1626
    frame #10: 0x000000010caf5ac5 ksh`path_addpath(shp=0x000000010cb3a210, first=0x0000000000000000, path="", type=1) at path.c:1758
    frame #11: 0x000000010caf1a48 ksh`path_init(shp=0x000000010cb3a210) at path.c:501
    frame #12: 0x000000010caf1911 ksh`path_get(shp=0x000000010cb3a210, name=".") at path.c:526
    frame #13: 0x000000010cb001c4 ksh`sh_subshell(shp=0x000000010cb3a210, t=0x00001e0093e993f0, flags=4, comsub=3) at subshell.c:538
    frame #14: 0x000000010cabe63d ksh`comsubst(mp=0x00001e0093e708a0, t=0x00001e0093e993f0, type=3) at macro.c:2238
    frame #15: 0x000000010cabf221 ksh`varsub(mp=0x00001e0093e708a0) at macro.c:1201
    frame #16: 0x000000010cabb839 ksh`copyto(mp=0x00001e0093e708a0, endch=0, newquote=0) at macro.c:635
    frame #17: 0x000000010cabcbb4 ksh`sh_macexpand(shp=0x000000010cb3a210, argp=0x00001e0093e991b0, arghead=0x00007ffee31b08d8, flag=0) at macro.c:246
    frame #18: 0x000000010ca88a74 ksh`arg_expand(shp=0x000000010cb3a210, argp=0x00001e0093e991b0, argchain=0x00007ffee31b08d8, flag=0) at args.c:1113
    frame #19: 0x000000010ca8871f ksh`sh_argbuild(shp=0x000000010cb3a210, nargs=0x00007ffee31b1274, comptr=0x00001e0093e99170, flag=0) at args.c:951
    frame #20: 0x000000010cb056e6 ksh`sh_exec(shp=0x000000010cb3a210, t=0x00001e0093e99170, flags=4) at xec.c:998
    frame #21: 0x000000010cb0ab0b ksh`sh_exec(shp=0x000000010cb3a210, t=0x00001e0093e99390, flags=5) at xec.c:2276
    frame #22: 0x000000010cac74d7 ksh`exfile(shp=0x000000010cb3a210, iop=0x00001e0093e6e4d0, fno=-1) at main.c:615
    frame #23: 0x000000010cac86bb ksh`sh_main(ac=3, av=0x00007ffee31b2268, userinit=0x0000000000000000) at main.c:384
    frame #24: 0x000000010caf6fe6 ksh`main(argc=3, argv=0x00007ffee31b2268) at pmain.c:45
    frame #25: 0x00007fff78682115 libdyld.dylib`start + 1
    frame #26: 0x00007fff78682115 libdyld.dylib`start + 1
@krader1961 krader1961 added the bug label Nov 30, 2017
@krader1961 krader1961 added this to the next-minor milestone Nov 30, 2017
@siteshwar
Copy link
Contributor

siteshwar commented Nov 30, 2017 via email

@krader1961 krader1961 changed the title path.sh test fails on macOS with a path.sh test fails on macOS with a call to abort() Nov 30, 2017
@krader1961
Copy link
Contributor Author

Fixed by commit 54abf34.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants