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

ksh93u+ dumps core when fds >32 #1494

Open
sowmya573 opened this issue Aug 25, 2021 · 1 comment
Open

ksh93u+ dumps core when fds >32 #1494

sowmya573 opened this issue Aug 25, 2021 · 1 comment

Comments

@sowmya573
Copy link

I have an application which invokes multiple ksh93 scripts and ,where each script might call other and it goes on... and most of the commands are run in subshell enviroment with pipe.
ex: $(echo "file1 file2 file3" | grep "file1").

So in a particular situation, application is dumping core in sfsync.
After some investigation, I could see that in sh_subtmpfile, "fcntl" call returns fd as "99". But when i tried to print shp->lim.open_max, it shows 32. So it looked like some memory overflow has happened which resulted in coredump.
As per my understanding i feel like in sh_subtmpfile,
(sp->tmpfd = fd = fcntl(1,F_DUPFD,10) ==> here, replacing fcntl() call with sh_fcntl() call would solve the purpose, which will inturn call the sh_iovalidfd, and that takes care of (fd>max) cases.

So my question here is, is there a global #define of fcntl to sh_fcntl which would take care of such cases. Looks like in my envirnonment, fcntl() is not replaced with sh_fcntl. Did i miss anything during compilation. Please suggest.

Note: This is seen on ksh93u+ version, built on AIX.

@McDutchie
Copy link
Contributor

McDutchie commented Nov 4, 2021

Hi there, this repo is inactive and AT&T stopped working on ksh93 years ago. My own ksh93 community fork ksh 93u+m has many subshell-related and I/O-related bugs fixed. Could you try building that and see if that fixes the bug? Also, if you get any build errors please let me know – I lost access to any possibility to test on AIX some time ago.

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

No branches or pull requests

2 participants