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

unable to create a new stream: No such file or directory #374

Closed
Pr0gmaT1k opened this issue Mar 3, 2016 · 9 comments
Closed

unable to create a new stream: No such file or directory #374

Pr0gmaT1k opened this issue Mar 3, 2016 · 9 comments

Comments

@Pr0gmaT1k
Copy link

I compile iperf bin for android with NDK r10e.
I use LDFLAGS="-fPIE -pie -fuse-ld=bfd" configs to build.

But now it said when i use as client or server:
iperf3: error - unable to create a new stream: No such file or directory

As server, on the client side i get:
iperf3: error - control socket has closed unexpectedly

The only warning that i get at compile time is:
portable_endian.h:133:3: warning: #warning platform not supported [-Wcpp]
portable_endian.h:158:0: warning: "htobe64" redefined [enabled by default]
In file included from /usr/lib/gcc/arm-linux-androideabi/4.7.3/../../../../arm-linux-androideabi/include/endian.h:87:0,
from /usr/lib/gcc/arm-linux-androideabi/4.7.3/../../../../arm-linux-androideabi/include/netinet/in.h:31,
from iperf_udp.c:35:

How can i workaround that ?

@Pr0gmaT1k
Copy link
Author

also -v said:
iperf 3.1
Linux localhost 3.10.65+ #1 SMP PREEMPT Mon Sep 14 20:33:24 CST 2015 aarch64
Optional features available: CPU affinity setting, IPv6 flow label, TCP congestion algorithm setting, sendfile / zerocopy

@Pr0gmaT1k
Copy link
Author

Well another interesting things.
When i install Magic iPerf3 from store, the same binaries work.

The iperf3 inside /data/data/com.nextdoordeveloper.miperf.miperf/files/iperf3 even if i copy it in another location.
BUT,
If i delete the app, the issue reappears. with his own binaries that work just before.

@brbsix
Copy link

brbsix commented Mar 11, 2016

I had the same issue after sourcing Iperf3 binaries from he.net - Network Tools. It needed write access to /data/data/net.he.networktools/cache/, which obviously does not exist when the APK is not installed.

So I opened it up in a hex editor, found the template string /data/data/net.he.networktools/cache/iperf3.XXXXXX, and replaced it with the path to a world-writable directory. You'll have to figure out where you want that to be since AFAIK there is no /tmp in Android. Basically you'll want to replace the template string with something like ////////////////path/to/writable/dir/iperf3.XXXXXX (you should probably take care to make sure the replacement string is the same length just to be safe).

I didn't want to go through the trouble of compiling it for Android, but you can also just change it prior to compilation. Also you can obviously disregard the prior comment about matching replacement string length if you go this route.

char buf[] = "/tmp/iperf3.XXXXXX";

Hope that helps,
Six

@Pr0gmaT1k
Copy link
Author

It work perfectly with existing binaries.

Android have a writable tmp in /data/local/tmp.

Thanks a lot !

@crearo
Copy link

crearo commented Jul 10, 2018

Hi I'm trying the exact same thing. How did you get this to work?

I am unable to push the iperf3 binary to /data/local/tmp. here's the reason

I have tried running the binary from /data/data/app.package/ and i get the same unable to create a new stream: No such file or directory error.

@AndroidPat
Copy link

AndroidPat commented Oct 9, 2018

It work perfectly with existing binaries.

Android have a writable tmp in /data/local/tmp.

Thanks a lot !

I'm having huge problems making Android version of iPerf3 binaries. I'm wondering if you could share your binaries for different architectures?

@hugoinfante83
Copy link

matching replacement string length

Thanks for the tip!!!!

@Juliocbr
Copy link

Juliocbr commented Aug 11, 2021

Hi

I have the same issue, I modified these lines in iperf_api.c according to @brbsix explanation:

char buf[] = "/data/local/tmp/iperf3.XXXXXX";
snprintf(template, sizeof(template) / sizeof(char), "%s", buf);

but when I execute some iperf command using "Runtime.getRuntime().exec(cmd)", I get this error:

...
},
    	"intervals":	[],
    	"end":	{
    	},
    	"error":	"error - unable to create a new stream: Permission denied"
    }
...

Notes: I'm using NDK to compile the iperf3 library and I put the executable file in jniLibs, I change the name of executable, for example "iperf3" to "libiperf3.so". I'm using non rooted device.

@davidBar-On
Copy link
Contributor

Can the reason be insufficient permissions to access "/data/local/tmp/", as explained in @crearo reference to: https://stackoverflow.com/questions/23094806/copy-file-to-data-local-tmp?

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

7 participants