View topic - [Resolved] Errors while using dhcp.client

[Resolved] Errors while using dhcp.client

For discussion of realtime and/or embedded programming.

[Resolved] Errors while using dhcp.client

Postby _KB_ » Wed Nov 13, 2019 10:51 am

Hi everyone,

For a project I need to launch dhcp.client in order to get a valid IP address from a rooter.

I followed the script sequence from there : http://www.qnx.com/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.neutrino_utilities%2Fd%2Fdhcp.client.html :
dhcp.client &
if_up enx


So far so good, I have my dynamic IP and my target is reachable.

I've observed 2 disturbed facts though :

1/ /dev/log reads :
dhclient: Error occurred obtaining script name: No such file or directory. Using default
dhclient: Could not start dhcp-up script: No such file or directory

What is the script purpose? Can I use dhcp.client without it? If so, how do I disable the error message?

2/ More disturbing, from time to time while booting up, my target crashes, see file attached. The memory dump suggests it is due to if_up binary failure... So in my script I removed "if_up enx". It seems to work without it. I still get a valid dynamic IP from the rooter. Besides I got rid of the problem (no failure after 1400+ reboot).

So my question is, what is if_up purpose in the sequence? (I don't understant the documentation) And can I launch dhcp.client without it?

Thanks!
Attachments
dump2.jpg
memory dump after boot failure
(905.61 KiB) Not downloaded yet
Last edited by _KB_ on Thu Dec 12, 2019 1:57 pm, edited 1 time in total.
_KB_
Active Member
 
Posts: 36
Joined: Mon Oct 15, 2012 6:36 pm

Re: Errors while using dhcp.client (possibly due to if_up)

Postby nico04 » Wed Nov 13, 2019 12:56 pm

In the documentation, it is stated :

The minimum commands to run under QNX Neutrino are:

io-pkt-v4 -dne2000 -ptcpip
if_up -p enx
dhcp.client &
if_up enx

Or:

io-pkt-v4 -dne2000 -ptcpip
dhcp.client -Ix -u


The two lines you provided don't fulfil this requirement.

It is also mentionned the use of the following files if present :
/etc/resolv.conf
/etc/dhcp/dhcp-up
/etc/dhcp/dhcp-options

You should find example files in your Momentics installation.
nico04
Senior Member
 
Posts: 164
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: Errors while using dhcp.client (possibly due to if_up)

Postby _KB_ » Wed Nov 13, 2019 1:33 pm

Hi nico04, thanks for the quick answer.

nico04 wrote:The two lines you provided don't fulfil this requirement.


The full script I'm using :

Code: Select all
io-pkt-v4 -dvortex
waitfor /dev/io-net
dhcp.client &
if_up enx


It doesn"t explain why if_up fails on my target from time to time.
The real question is, what is it for? When I removed if_up from the script it seems to work as before (I get an IP from the server).

nico04 wrote:It is also mentionned the use of the following files if present :
/etc/resolv.conf
/etc/dhcp/dhcp-up
/etc/dhcp/dhcp-options

You should find example files in your Momentics installation.


Correct but the mention "if present" makes me expect no error message in the log if I don't need them (default config seems just fine).
_KB_
Active Member
 
Posts: 36
Joined: Mon Oct 15, 2012 6:36 pm

Re: Errors while using dhcp.client (possibly due to if_up)

Postby Tim » Wed Nov 13, 2019 5:32 pm

if_up just pauses your startup script until the network interface is 'available'. See doc's here:

http://www.qnx.com/developers/docs/6.5. ... if_up.html

You may not need it at all if the driver manages to get the interface up in time for dhcp.client. 1400 reboots would tend to make me think you don't need it but you never know.

Not sure why it's crashing your machine. But I do see you are running HAM and most people aren't doing that. Maybe HAM thinks if_up isn't responding in time (if it's waiting) and so it's trying to restart it and that's causing the node to crash. You could test that by not starting HAM and seeing if the crashes go away. If they do, then it's some combination of HAM and if_up

Tim
Tim
Senior Member
 
Posts: 1470
Joined: Wed Mar 10, 2004 12:28 am

Re: Errors while using dhcp.client (possibly due to if_up)

Postby nico04 » Thu Nov 14, 2019 7:33 am

@Tim : To my knowledge, HAM manages processes explicitly declared to be monitored.

@_KB_ : Why are you not using service pack 1 (SDP 6.5.0SP1) and more recent patches ?
nico04
Senior Member
 
Posts: 164
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: Errors while using dhcp.client (possibly due to if_up)

Postby _KB_ » Thu Nov 14, 2019 7:54 am

Tim wrote:Not sure why it's crashing your machine. But I do see you are running HAM and most people aren't doing that. Maybe HAM thinks if_up isn't responding in time (if it's waiting) and so it's trying to restart it and that's causing the node to crash. You could test that by not starting HAM and seeing if the crashes go away. If they do, then it's some combination of HAM and if_up

Tim


I'm testing this right now. Thanks.

nico04 wrote: Why are you not using service pack 1 (SDP 6.5.0SP1) and more recent patches ?

I am using 6.5.0SP1.
_KB_
Active Member
 
Posts: 36
Joined: Mon Oct 15, 2012 6:36 pm

Re: Errors while using dhcp.client (possibly due to if_up)

Postby nico04 » Thu Nov 14, 2019 8:03 am

_KB_ wrote:I am using 6.5.0SP1.


In your crash report, we can read "QNX Version 6.5.0 Release 2010/07/09-14:42:57EDT"
SP1 has been released after 2010. But maybe procnto was not modified in SP1.
However, there is a patch for procnto which has been released on June 2019.
nico04
Senior Member
 
Posts: 164
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: Errors while using dhcp.client (possibly due to if_up)

Postby _KB_ » Thu Nov 14, 2019 8:21 am

nico04 wrote:In your crash report, we can read "QNX Version 6.5.0 Release 2010/07/09-14:42:57EDT"
SP1 has been released after 2010. But maybe procnto was not modified in SP1.


Maybe...
I'm sure I have SP1 installed because we fixed an issue a week ago with another engineer working on the project without SP1 installed. And we had differences between application binaries (same source code).
Besides I double checked and there is a "6.5.0SP1" directory in "C:\QNX650\install\qnxsdp".

nico04 wrote:However, there is a patch for procnto which has been released on June 2019.



I'm aware of that, unfortunatelly one need QNX maintenance support in order to download it and it is quiet expensive.
_KB_
Active Member
 
Posts: 36
Joined: Mon Oct 15, 2012 6:36 pm

Re: Errors while using dhcp.client (possibly due to if_up)

Postby Tim » Fri Nov 15, 2019 2:50 pm

_KB_ wrote:
nico04 wrote:In your crash report, we can read "QNX Version 6.5.0 Release 2010/07/09-14:42:57EDT"
SP1 has been released after 2010. But maybe procnto was not modified in SP1.


Maybe...
I'm sure I have SP1 installed because we fixed an issue a week ago with another engineer working on the project without SP1 installed. And we had differences between application binaries (same source code).
Besides I double checked and there is a "6.5.0SP1" directory in "C:\QNX650\install\qnxsdp".


"C:\QNX650\install\qnxsdp" is where are building your own source code.

Have you actually built a new .boot image under SP1 and updated it on your machine? That's what's actually crashing. Based on what Nico04 has pointed out it appears that you have not.

Tim
Tim
Senior Member
 
Posts: 1470
Joined: Wed Mar 10, 2004 12:28 am

Re: Errors while using dhcp.client (possibly due to if_up)

Postby _KB_ » Mon Nov 18, 2019 8:25 am

Hi Tim,

I have built a new ifs file using QNX system builder from Momentics (and a bsp provided by the the manufacturer of my board, a Vortex DX2 x86).
The ifs file had been pushed to .boot folder on the target.
_KB_
Active Member
 
Posts: 36
Joined: Mon Oct 15, 2012 6:36 pm

Re: Errors while using dhcp.client (possibly due to if_up)

Postby Tim » Tue Nov 19, 2019 9:21 pm

Here's an old post I found where someone crashed the system with something semi-similar to what you have experienced.

http://community.qnx.com/sf/discussion/ ... /post90348

They claim it's having 2 network cards on the same subnet. How many cards do you have in your machine and what driver are you using?

Also note that if_up outputs something to the screen for them:
if_up: retries exhausted


I wonder if your crash happens when if_up attempts to output something if some other needed process isn't running.

Tim
Tim
Senior Member
 
Posts: 1470
Joined: Wed Mar 10, 2004 12:28 am

Re: Errors while using dhcp.client (possibly due to if_up)

Postby _KB_ » Thu Nov 21, 2019 12:50 pm

Hi Tim,

I have only one network card.
The board is Vortex DX2 (x86).
I think the message "if_up: retries exhausted" is not relevant, as it is not always linked to a dump (see other image attached).

I have another scenario which leads to a system crash.
I have 7 processes to launch at startup. Here the sequence :
Code: Select all
./P_LOG &
sleep 0.5
./P_BIBA-SERVER &
sleep 1
./P_HAL &
sleep 1
./P_DISPLAY &
sleep 1
./P_LOCAL &
sleep 1
./P_VD-SERIE &
sleep 1
./P_VD-IP &


If I remove the sleep instructions, I have regularly a system crash (more often then with the "if_up" issue) I have attached the corresponding dump.

I'm concerned about what Nico and you mentionned earlier concerning the SP1 which is missing in the dump.
Maybe I have an incompatibily between the boot image (which would be 6.5.0) and mly application (my 7 processes compiled on 6.5.0 SP1) ?
The dump suggest that my system is running on 6.5.0 (no SP1). How can I know for sure? As I said I've built an ifs file with Momentics and SP1 installed... However the besp of the board I am using (provided by the manufacturer) is 6.3.2.
Attachments
dump_without_sleep.jpg
no sleep porblem
(684.75 KiB) Not downloaded yet
dump_if_up.jpg
if_up problem
(676.1 KiB) Not downloaded yet
_KB_
Active Member
 
Posts: 36
Joined: Mon Oct 15, 2012 6:36 pm

Re: Errors while using dhcp.client (possibly due to if_up)

Postby nico04 » Thu Nov 21, 2019 2:23 pm

To check for procnto version, what I would do is (I'm using Windows as dev OS) :
- Transfer /proc/boot/procnto-smp(*) from QNX target to your PC using Momentics. Edit(**) procnto-smp and search for "6.5.0".
- Edit C:\QNX650\target\qnx6\x86\boot\sys\procnto-smp(***) and search for "6.5.0".
- Compare both search results. The important part is after "6.5.0", the date should be the same, or not.

Nicolas

* : This can be another version of procnto, like procnto, procnto-instr or procnto-smp-instr.
** : Please use a "real" editor like Notepad++ for Windows since the file is big and binary. You can also use a binary editor with text search functionality.
*** : On a linux PC, use the path you installed QNX dev tools in.
nico04
Senior Member
 
Posts: 164
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: Errors while using dhcp.client (possibly due to if_up)

Postby _KB_ » Thu Nov 21, 2019 3:24 pm

Thanks Nico ! This was a good one!
I have indeed a problem with the embedded procnto...

The one in C:\QNX650\target\qnx6\x86\boot\sys reads : 2012/06/20-13:50:45EDT.6.5.0
The one in /proc/boot reads 2010/07/09-14:42:57EDT.6.5.0

I don't know how to transfer procnto-2012 onto the target (I trieds to rebuild an ifs but I don't know how to add this version of procnto in the builder)...
_KB_
Active Member
 
Posts: 36
Joined: Mon Oct 15, 2012 6:36 pm

Re: Errors while using dhcp.client (possibly due to if_up)

Postby nico04 » Thu Nov 21, 2019 3:30 pm

Have you run "clean" before "build" ?
nico04
Senior Member
 
Posts: 164
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Next

Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 2 guests