<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic udhcpc segmentation fault in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/udhcpc-segmentation-fault/m-p/126460#M306</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using ltib (20051213) on a 5474. I've configured it to use dhcp (udhcpc from busybox), but udhcpc is giving a segfault when it runs. Specifically:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-sh-2.05b# udhcpc -b -i eth0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;udhcpc (v0.9.9-pre) started&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Segmentation fault&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-sh-2.05b#&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone know how to fix this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 12 Aug 2006 03:07:37 GMT</pubDate>
    <dc:creator>SteveJoiner</dc:creator>
    <dc:date>2006-08-12T03:07:37Z</dc:date>
    <item>
      <title>udhcpc segmentation fault</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/udhcpc-segmentation-fault/m-p/126460#M306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using ltib (20051213) on a 5474. I've configured it to use dhcp (udhcpc from busybox), but udhcpc is giving a segfault when it runs. Specifically:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-sh-2.05b# udhcpc -b -i eth0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;udhcpc (v0.9.9-pre) started&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Segmentation fault&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-sh-2.05b#&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone know how to fix this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Aug 2006 03:07:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/udhcpc-segmentation-fault/m-p/126460#M306</guid>
      <dc:creator>SteveJoiner</dc:creator>
      <dc:date>2006-08-12T03:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: udhcpc segmentation fault</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/udhcpc-segmentation-fault/m-p/126461#M307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I did some digging and it seems to be segfaulting when it calls:&lt;BR /&gt;&lt;BR /&gt;run_script(NULL, "deconfig");&lt;BR /&gt;&lt;BR /&gt;I did a "find ./ -name deconfig" on my filesystem, but there's no deconfig to be found. Any thoughts?&lt;BR /&gt;&lt;BR /&gt;-Steve&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Aug 2006 05:22:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/udhcpc-segmentation-fault/m-p/126461#M307</guid>
      <dc:creator>SteveJoiner</dc:creator>
      <dc:date>2006-08-12T05:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: udhcpc segmentation fault</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/udhcpc-segmentation-fault/m-p/126462#M308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Digging in a little more, it looks like run_script() is failing when it calls vfork(). It appears that the segfault is happening in vfork(). In particular, the offending code in run_script() looks like this:&lt;BR /&gt;&lt;BR /&gt; pid = vfork();&lt;BR /&gt; if (pid) {&lt;BR /&gt; waitpid(pid, NULL, 0);&lt;BR /&gt; for (curr = envp; *curr; curr++) free(*curr);&lt;BR /&gt; free(envp);&lt;BR /&gt; return;&lt;BR /&gt; } else if (pid == 0) {&lt;BR /&gt; /* close fd's? */&lt;BR /&gt;&lt;BR /&gt; /* exec script */&lt;BR /&gt; execle(client_config.script, client_config.script,&lt;BR /&gt; name, NULL, envp);&lt;BR /&gt; LOG(LOG_ERR, "script %s failed: %m", client_config.script);&lt;BR /&gt; exit(1);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;I have verified that the code is getting to the vfork() then segfaulting. Anyone know how to fix this?&lt;BR /&gt;&lt;BR /&gt;-Steve&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2006 01:32:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/udhcpc-segmentation-fault/m-p/126462#M308</guid>
      <dc:creator>SteveJoiner</dc:creator>
      <dc:date>2006-08-15T01:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: udhcpc segmentation fault</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/udhcpc-segmentation-fault/m-p/126463#M309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I fixed it.&lt;BR /&gt;&lt;BR /&gt;For anyone else who runs into this problem (and for the ltib maintainer), I fixed this by replacing the vfork() call with a fork() call. I don't know why that fixed it, but it did.&lt;BR /&gt;&lt;BR /&gt;After the segfault was fixed, I found that udhcpc was unable to get a lease when my system booted. This seemed to be cased by the ethernet interface not being initialized, so I added "ifconfig $INTERFACE 0.0.0.0" in my /etc/rc.d/init.d/network script right before the udhcpc call. That seems to have fixed that problem.&lt;BR /&gt;&lt;BR /&gt;If you're fixing this in ltib, it may be helpful to know that /etc/rc.c/init.d/network is in the skell package. While you're in there, you may want to fix another little bug that I noticed: most of the init scripts in /etc/rc.c/init.d/ have a line that looks like this:&lt;BR /&gt;&lt;BR /&gt;if [ "$1 = "stop" -o "$1 = "restart" ] &lt;BR /&gt;&lt;BR /&gt;It should be changed to this:&lt;BR /&gt;&lt;BR /&gt;if [ "$1" = "stop" -o "$1" = "restart" ] &lt;BR /&gt;&lt;BR /&gt;-Steve&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2006 02:36:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/udhcpc-segmentation-fault/m-p/126463#M309</guid>
      <dc:creator>SteveJoiner</dc:creator>
      <dc:date>2006-08-16T02:36:09Z</dc:date>
    </item>
  </channel>
</rss>

