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

Server exit with code = -1 immediately #3

Closed
Winters123 opened this issue Oct 24, 2019 · 8 comments
Closed

Server exit with code = -1 immediately #3

Winters123 opened this issue Oct 24, 2019 · 8 comments

Comments

@Winters123
Copy link

HI,
When I make pquic, there is an error reported: it said IPV6_DONTFRAG is not defined. Then I modified all this macro as 0. It compiled successfully. But when I ran ./picoquicdemo . The terminal shows Starting PicoQUIC server on port 4443, server name = ::, just_once = 0, hrr= 0, 0 local plugins and 0 both plugins Server exit, ret = -1 Server exit with code = -1
I used CentOS 7 as the environment. How should I proceed?

Thanks and regards,
Xiangrui

@qdeconinck
Copy link
Member

Did you enable IPv6 on your running host?

@mpiraux
Copy link
Member

mpiraux commented Oct 25, 2019

Hello,
Be sure to run ./picoquicdemo from the its own directory. You probably need a newer kernel to get that flag defined. I would suggest to define it to its real value, i.e. 62, instead of zero.
If you still encounter an error, could you post a strace log of the server execution as well ?

@mpiraux mpiraux changed the title picoquicdemo Server exit with code = -1 immediately Oct 25, 2019
@Winters123
Copy link
Author

Did you enable IPv6 on your running host?

No I didn't. Should I enable it? Because I thought this demo is based on IPv4.

Thanks,
Xiangrui

@qdeconinck
Copy link
Member

qdeconinck commented Oct 28, 2019

The picoquicdemo server binds two UDP sockets, one on IPv4 on 0.0.0.0, the other one on IPv6 with ::. I suspect the creation of the second socket being the source of your error.
To make the server work, either you can do the following changes:

  • picoquic/picosocks.h: line 108: replace 2 by 1
  • picoquic/picosocks.c: line 56: remove AF_INET6,

and recompile picoquic with make.

Or you enable IPv6 on your machine.

Does one of these solutions work for you?

@Winters123
Copy link
Author

Winters123 commented Oct 28, 2019

Hello,
Be sure to run ./picoquicdemo from the its own directory. You probably need a newer kernel to get that flag defined. I would suggest to define it to its real value, i.e. 62, instead of zero.
If you still encounter an error, could you post a strace log of the server execution as well ?

Sorry for the delayed reply. I changed the flag to the real value (62). And I used strace to monitor the whole process on the client-side.

Here is what I got from the strace log:
Screenshot from 2019-10-28 18-39-53

It seems that the client returned with the value 0. Is this the sign of a successful installation?
And btw, what is the kernel version for you to compile the whole project? I used 3.10 for it (might be a little bit outdated).

Thanks,
Xiangrui

@Winters123
Copy link
Author

The picoquicdemo server binds two UDP sockets, one on IPv4 on 0.0.0.0, the other one on IPv6 with ::. I suspect the creation of the second socket being the source of your error.
To make the server work, either you can do the following changes:

  • picoquic/picosocks.h: line 108: replace 2 by 1
  • picoquic/picosocks.c: line 56: remove AF_INET6,

and recompile picoquic with make.

Or you enable IPv6 on your machine.

Does one of these solutions work for you?

Thanks for the solution provided. I changed the IPV6 flags to the value that Maxime told me (with IPv6 enabled on the OS). And the client returned with 0 when the test finished.

But when I disabled IPv6 options (like you mentioned in OP1), the client exit with a strace log like this.
Screenshot from 2019-10-28 18-04-30

Thanks,
Xiangrui

@mpiraux
Copy link
Member

mpiraux commented Oct 29, 2019

It seems that the client returned with the value 0. Is this the sign of a successful installation?

It's the sign of a successful execution at least. By looking closely at the full log, you should see that data is exchanged on a few streams that eventually get gracefully closed.

But when I disabled IPv6 options (like you mentioned in OP1), the client exit with a strace log like this.

I recommend not to change the code to make it IPv4 only, I suspect there are few other places to change than the two ones mentioned by Quentin. IPv6 can be trivially enabled these days.

@Winters123
Copy link
Author

It seems that the client returned with the value 0. Is this the sign of a successful installation?

It's the sign of a successful execution at least. By looking closely at the full log, you should see that data is exchanged on a few streams that eventually get gracefully closed.

But when I disabled IPv6 options (like you mentioned in OP1), the client exit with a strace log like this.

I recommend not to change the code to make it IPv4 only, I suspect there are few other places to change than the two ones mentioned by Quentin. IPv6 can be trivially enabled these days.

sure. Thanks for both of you :)

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

3 participants