Home Forum Developers General discussions [590]

JRPassphrase Registration Control

In order to register on this site, you must first submit the passphrase below.

TODO list for each hardware target can be found as sticky topic in the corresponding forum


Gilles
useravatar
User Info

[590]

Hello

After copying the libraries + configuration + Asterisk files manually, I tried running it with "./asterisk -c", but get the following error:


...
"asterisk: can't resolve symbol '_fork'"
Does it meant that the "*patch" files  located in ./package/asterisk aren't applied by default? Or could the error be elsewhere?

Thank you.



Edited By:  Gilles
Jul-27-11 20:14:53

Administrator has disabled public posting
Chewi
useravatar
User Info

Re: [590]

That's strange because it should give you that error at link time, not runtime. I certainly saw it when building 1.6 before I added a patch.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: [590]

I'm actually trying to run Asterisk (1.4, as it's the default) on the standard uClinux 2010 kernel straight from Blackfin's site, ie. I just compile Asterisk in Switchfin and then copy the Asterisk binary + the libraries it needs from Switchfin and drop them on an Atcom IP01, so I can test applications independently from the kernel. Strange error :-/


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: [590]

I rebuilt the Switchfin 2010 image and tried running Asterisk, but am still getting the error.

Incidently, all the libraries Asterisk needs are identical between Switchfin 2010 and uClinux 2010, save for libc.so.0:

Code:


FROM UCLINUX-DIST 2010
root:/var/tmp> ls -al /lib/
-rwxr-xr-x    1 root     root        247564 Jul  8 10:52 libc.so.0

FROM SWITCHFIN 2010
switchfin-2010/build_ip04/root/lib# ll
-rwxr-xr-x  1 root root 229892 2011-07-26 12:55 libc.so.0*

I don't know if it helps, but here's the very end of "strace asterisk -c":


...
open("/lib/ld-uClibc.so.", O_RDONLY)    = 11
fstat(11, {st_mode=S_IFREG|0755, st_size=20396, ...}) = 0
close(11)                               = 0
open("/lib/libc.so.0", O_RDONLY)        = 11
fstat(11, {st_mode=S_IFREG|0755, st_size=247564, ...}) = 0
close(11)                               = 0
open("/lib/ld-uClibc.so.", O_RDONLY)    = 11
fstat(11, {st_mode=S_IFREG|0755, st_size=20396, ...}) = 0
close(11)                               = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x9fa000
write(2, "", 0)                         = 0
write(2, "./asterisk", 10./asterisk)              = 10
write(2, ": can't resolve symbol '", 24: can't resolve symbol ') = 24
write(2, "_fork", 5_fork)                    = 5
write(2, "'\n", 2'
)                      = 2
munmap(0x9fa000, 4096)                  = 0
_exit(1)                                = ?
Why is libc.so different between the two distros? Is the Switchfin version more recent?


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: [590]

Can you tell me exactly which uClinux file you have downloaded? Our libc.so.0 seems to come from the prebuilt "2010R1-RC4" toolchain. My copy is 229892 bytes just like yours. This file size differs from the one in the archive, presumably because the library gets stripped somehow. I tried stripping it myself and didn't get it to exactly 229892 bytes but it was close.

As for _fork, I gather that uClinux-dist used to delay this failure until runtime like you are seeing but later changed it to a link time failure. I don't know why you're only seeing it at runtime now.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: [590]

I compiled the uClinux-dist 2010R1-RC5 using the uClinux-2010R1RC4 toolchain.

According to this message from the Blackfin forum, "The distribution no longer builds uClibc separately; it will install the uClibc that is part of the toolchain so if you need to make uClibc changes, you need to update your toolchain accordingly".

After rebooting with a RAM-based uClinux-dist 2010, I copied /bin/asterisk + configuration files from Switchfin, and get the fork() error.

I notice that Switchfin uses the "blackfin-toolchain-uclibc-default", while I used the "blackfin-toolchain-uclibc-full" to compile uClinux:

Code:


/usr/src/switchfin-2010/dl# ll
-rw-r--r-- 1 root root 504065803 2010-12-13 09:58 blackfin-linux-dist-2010R1-RC5.tar.bz2
-rw-r--r-- 1 root root  43853455 2010-10-06 00:52 blackfin-toolchain-2010R1-RC4.i386.tar.bz2
-rw-r--r-- 1 root root  52603183 2010-10-06 01:35 blackfin-toolchain-uclibc-default-2010R1-RC4.i386.tar.bz2


/usr/src# ll
-rw-r--r--  1 root root  504065803 2011-05-12 15:31 blackfin-linux-dist-2010R1-RC5.tar.bz2
-rw-r--r--  1 root root   43853455 2011-05-12 15:30 blackfin-toolchain-2010R1-RC4.i386.tar.bz2
-rw-r--r--  1 root root   61637259 2011-05-12 15:30 blackfin-toolchain-uclibc-full-2010R1-RC4.i386.tar.bz2


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: [590]

I'm still very confused by what you're doing. Before you said you're using the uClinux "kernel", now it sounds like you're using a whole uClinux system. Maybe the "full" toolchain includes some kind of fork replacement that the "default" toolchain doesn't have. In general, while you can usually use binaries built with glibc on other glibc-based systems, you shouldn't really do this with binaries built with uClinux.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: [590]

Sorry about the misunderstanding. Indeed, by "uClinux", I didn't mean just the kernel, but the whole distro as well, to which I simply add Asterisk manually.

After recompiling uClinux-dist with the "default" uClibc toolchain instead of the "full" uClibc toolchain, libc.so.0 is still 247.564 bytes long.
FWIW, "file" says that it's stripped, so that doesn't explain the size difference with Switchfin's libc.so.0.

Is there a way to investigate why the kernel reports the "can't resolve symbol" when launching Asterisk?

Thank you.


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: [590]

There's not much to investigate. fork isn't possible on Blackfin systems so the C library won't have it. Once patched, Asterisk shouldn't have fork present in the first place and if it does, it should fail to link. In short, you're building it wrong.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: [590]

And still, I get no error when building Switchfin and uClinux-dist using the default options :-/ I'll see if I find more infos. Thanks for your help.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: [590]

Investigated this issue today, but couldn't reproduce the error. Since both Switchin and uClinux-dist use the same toolchain, I have no idea what went wrong. Anyway, thanks for the help.


Administrator has disabled public posting
Henning
useravatar
User Info

Re: [590]

Hey,

I stumbled into the same error. But I think it's somehow connected to modules.conf.

Scenario 1: I don't load all possible modules, instead I just load some arbitrary modules. And it worked.

 Spoiler Show Spoiler / Hide Spoiler
 
;
; Asterisk configuration file
;
; Module Loader configuration file
;

[modules]
autoload=no
;
; Any modules that need to be loaded before the Asterisk core has been
; initialized (just after the logger has been initialized) can be loaded
; using 'preload'. This will frequently be needed if you wish to map all
; module configuration files into Realtime storage, since the Realtime
; driver will need to be loaded before the modules using those configuration
; files are initialized.
;
;
load => codec_g726.so
load => format_g723.so
load => format_g726.so
load => codec_speex.so

; Module names listed in "global" section will have symbols globally
; exported to modules loaded after them.
;
[global]
 Spoiler Show Spoiler / Hide Spoiler
 
                           _____________________________________
        a8888b.           / Welcome to the uClinux distribution \
       d888888b.         /       _     _                         \
       8P"YP"Y88        /       | |   |_|            __  __ (TM)  |
       8|o||o|88  _____/        | |    _ ____  _   _ \ \/ /       |
       8'    .88       \        | |   | |  _ \| | | | \  /        |
       8`._.' Y8.       \       | |__ | | | | | |_| | /  \        |
      d/      `8b.       \      \____||_|_| |_|\____|/_/\_\       |
     dP   .    Y8b.       \   For embedded processors including   |
    d8:'  "  `::88b        \    the Analog Devices Blackfin      /
   d8"         'Y88b        \___________________________________/
  :8P    '      :888
   8a.   :     _a88P         For further information, check out:
._/"Yaa_:   .| 88P|            - http://blackfin.uclinux.org/
\    YP"    `| 8P  `.          - http://docs.blackfin.uclinux.org/
/     \.___.d|    .'           - http://www.uclinux.org/
`--..__)8888P`._.'  jgs/a:f    - http://www.analog.com/blackfin

Have a lot of fun...


BusyBox v1.16.2 (2011-12-13 16:43:11 CET) hush - the humble shell

root:/> PHY: 0:00 - Link is Up - 100/Full

root:/> asterisk -c
Asterisk 1.4.42, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
[ Booting...
[ Reading Master Configuration ]
[ Initializing Custom Configuration Options ]
[Jan  1 00:00:07] NOTICE[269]: manager.c:3182 init_manager: Unable to open management configuration manager.conf.  Call management disabled.
[Jan  1 00:00:07] NOTICE[269]: cdr.c:1449 do_reload: CDR simple logging enabled.
[Jan  1 00:00:07] WARNING[269]: db.c:66 dbinit: Unable to open Asterisk database '/var/lib/asterisk/astdb': No such file or directory
[Jan  1 00:00:07] NOTICE[269]: loader.c:1006 load_modules: 4 modules will be loaded.
.... ]
Asterisk Ready.
*CLI>
Scenario 2: I try to load all possible modules.
 Spoiler Show Spoiler / Hide Spoiler
 
;
; Asterisk configuration file
;
; Module Loader configuration file
;

[modules]
autoload=yes
;
; Any modules that need to be loaded before the Asterisk core has been
; initialized (just after the logger has been initialized) can be loaded
; using 'preload'. This will frequently be needed if you wish to map all
; module configuration files into Realtime storage, since the Realtime
; driver will need to be loaded before the modules using those configuration
; files are initialized.
;
;

; Module names listed in "global" section will have symbols globally
; exported to modules loaded after them.
;
[global]
and it does not work.
 Spoiler Show Spoiler / Hide Spoiler
         a8888b.           / Welcome to the uClinux distribution \
       d888888b.         /       _     _                         \
       8P"YP"Y88        /       | |   |_|            __  __ (TM)  |
       8|o||o|88  _____/        | |    _ ____  _   _ \ \/ /       |
       8'    .88       \        | |   | |  _ \| | | | \  /        |
       8`._.' Y8.       \       | |__ | | | | | |_| | /  \        |
      d/      `8b.       \      \____||_|_| |_|\____|/_/\_\       |
     dP   .    Y8b.       \   For embedded processors including   |
    d8:'  "  `::88b        \    the Analog Devices Blackfin      /
   d8"         'Y88b        \___________________________________/
  :8P    '      :888
   8a.   :     _a88P         For further information, check out:
._/"Yaa_:   .| 88P|            - http://blackfin.uclinux.org/
\    YP"    `| 8P  `.          - http://docs.blackfin.uclinux.org/
/     \.___.d|    .'           - http://www.uclinux.org/
`--..__)8888P`._.'  jgs/a:f    - http://www.analog.com/blackfin

Have a lot of fun...


BusyBox v1.16.2 (2011-12-13 16:43:11 CET) hush - the humble shell

root:/> PHY: 0:00 - Link is Up - 100/Full

root:/> asterisk -c
Asterisk 1.4.42, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
[ Booting...
[ Reading Master Configuration ]
[ Initializing Custom Configuration Options ]
[Jan  1 00:00:13] NOTICE[269]: manager.c:3182 init_manager: Unable to open management configuration manager.conf.  Call management disabled.
[Jan  1 00:00:13] NOTICE[269]: cdr.c:1449 do_reload: CDR simple logging enabled.
[Jan  1 00:00:13] WARNING[269]: db.c:66 dbinit: Unable to open Asterisk database '/var/lib/asterisk/astdb': No such file or directory
[Jan  1 00:00:13] NOTICE[269]: loader.c:1006 load_modules: 121 modules will be loaded.
.............[Jan  1 00:00:14] NOTICE[269]: res_smdi.c:886 smdi_load: Unable to load config smdi.conf: SMDI disabled
[Jan  1 00:00:14] WARNING[269]: res_smdi.c:1364 load_module: No SMDI interfaces are available to listen on, not starting SMDI listener.
.[Jan  1 00:00:14] WARNING[269]: res_features.c:3635 load_config: Could not load features.conf
....[Jan  1 00:00:14] NOTICE[269]: app_queue.c:4506 reload_queues: No call queueing config file (queues.conf), so no call queues
............[Jan  1 00:00:15] ERROR[269]: codec_dahdi.c:602 find_transcoders: Failed to open /dev/dahdi/transcode: No such file or directory
.[Jan  1 00:00:15] WARNING[269]: res_crypto.c:507 crypto_load: Unable to open key directory '/var/lib/asterisk/keys'
..[Jan  1 00:00:15] NOTICE[269]: chan_agent.c:1168 read_agent_config: No agent configuration found -- agent support disabled
...[Jan  1 00:00:15] WARNING[269]: pbx_spool.c:522 load_module: Unable to create queue directory /var/spool/asterisk/outgoing -- outgoing spool disabled
..........[Jan  1 00:00:15] WARNING[269]: app_followme.c:302 reload_followme: No follow me config file (followme.conf), so no follow me
...............[Jan  1 00:00:15] WARNING[269]: cdr_custom.c:99 load_config: Failed to load configuration file. Module not activated.
.............[Jan  1 00:00:15] WARNING[269]: cdr_csv.c:112 load_config: unable to load config: cdr.conf
...[Jan  1 00:00:16] WARNING[269]: res_musiconhold.c:846 moh_scan_files: Cannot open dir /var/lib/asterisk/moh or dir does not exist
[Jan  1 00:00:16] WARNING[269]: res_musiconhold.c:1468 load_module: No music on hold classes configured, disabling music on hold.
..[Jan  1 00:00:16] ERROR[269]: chan_dahdi.c:13223 setup_dahdi: Unable to load chan_dahdi.conf
.......[Jan  1 00:00:16] NOTICE[269]: chan_ooh323.c:2494 load_module: ---------------------------------------------------------------------------------
---  ******* IMPORTANT NOTE ***********
---
---  This module is currently unsupported.  Use it at your own risk.
---
--------------------------------------------------------[Jan  1 00:00:16] NOTICE[269]: chan_ooh323.c:1883 reload_config: Unable to load config ooh323.conf, d
.....[Jan  1 00:00:16] WARNING[269]: app_voicemail.c:9215 load_config: Failed to load configuration file.
...[Jan  1 00:00:16] WARNING[269]: chan_iax2.c:12784 load_module: Unable to open IAX timing interface: No such file or directory
[Jan  1 00:00:16] ERROR[269]: chan_iax2.c:11425 set_config: Unable to load config iax.conf
........asterisk: can't resolve symbol '_fork'
root:/>
So, I believe, that somewhere a _fork was not changed into _vfork or something like that. Could that be?

Here is the end of my "strace asterisk -c"
 Spoiler Show Spoiler / Hide Spoiler
 
fstat(8, {st_mode=S_IFREG|0755, st_size=20396, ...}) = 0
close(8)                                = 0
munmap(0xa7d000, 1225)                  = 0
munmap(0xaac000, 10248)                 = 0
munmap(0xaa7000, 2984)                  = 0
stat("/etc/ld.so.cache", {st_mode=S_IFREG|0644, st_size=1225, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY)      = 8
mmap2(NULL, 1225, PROT_READ, MAP_PRIVATE, 8, 0) = 0xa7d000
close(8)                                = 0
open("/usr/lib/asterisk/modules/app_dahdiras.so", O_RDONLY) = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=12524, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0xaa6000
read(8, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0j\0\1\0\0\0 \17\0\0004\0\0\0"..., 4096) = 4096
mmap2(NULL, 10248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE|MAP_EXECUTABLE, 8, 0) = 0xaac000
mmap2(NULL, 2984, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xaa7000
pread(8, "el\n\0    -- Starting RAS on %s\n\0\0"..., 2952, 8192) = 2952
close(8)                                = 0
munmap(0xaa6000, 4096)                  = 0
open("/lib/libpthread.so.0", O_RDONLY)  = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=39312, ...}) = 0
close(8)                                = 0
open("/lib/libdl.so.0", O_RDONLY)       = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=7668, ...}) = 0
close(8)                                = 0
open("/lib/libtonezone.so.2.0", O_RDONLY) = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=221472, ...}) = 0
close(8)                                = 0
open("/lib/libsqlite3.so.0", O_RDONLY)  = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=361608, ...}) = 0
close(8)                                = 0
open("/usr/lib/libspeexdsp.so.1", O_RDONLY) = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=74168, ...}) = 0
close(8)                                = 0
open("/lib/libgcc_s.so.1", O_RDONLY)    = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=62376, ...}) = 0
close(8)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=229892, ...}) = 0
close(8)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=229892, ...}) = 0
close(8)                                = 0
open("/lib/ld-uClibc.so.0liso.1", O_RDONLY) = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=20396, ...}) = 0
close(8)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=229892, ...}) = 0
close(8)                                = 0
open("/lib/ld-uClibc.so.0liso.1", O_RDONLY) = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=20396, ...}) = 0
close(8)                                = 0
open("/lib/libm.so.0", O_RDONLY)        = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=62280, ...}) = 0
close(8)                                = 0
open("/lib/libgcc_s.so.1", O_RDONLY)    = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=62376, ...}) = 0
close(8)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=229892, ...}) = 0
close(8)                                = 0
open("/lib/libpthread.so.0", O_RDONLY)  = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=39312, ...}) = 0
close(8)                                = 0
open("/lib/libgcc_s.so.1", O_RDONLY)    = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=62376, ...}) = 0
close(8)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=229892, ...}) = 0
close(8)                                = 0
open("/lib/libm.so.0", O_RDONLY)        = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=62280, ...}) = 0
close(8)                                = 0
open("/lib/libgcc_s.so.1", O_RDONLY)    = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=62376, ...}) = 0
close(8)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=229892, ...}) = 0
close(8)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=229892, ...}) = 0
close(8)                                = 0
open("/lib/ld-uClibc.so.0lili.1", O_RDONLY) = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=20396, ...}) = 0
close(8)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=229892, ...}) = 0
close(8)                                = 0
open("/lib/ld-uClibc.so.0lili.1", O_RDONLY) = 8
fstat(8, {st_mode=S_IFREG|0755, st_size=20396, ...}) = 0
close(8)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xaa6000
write(2, "", 0)                         = 0
write(2, "asterisk", 8asterisk)                 = 8
write(2, ": can't resolve symbol '", 24: can't resolve symbol ') = 24
write(2, "_fork", 5_fork)                    = 5
write(2, "'\n", 2'
)                      = 2
munmap(0xaa6000, 4096)                  = 0
_exit(1)                                = ?
So, my solution would be, to set "autoload=no" and to load all 121 modules by hand "load => xy.so" in order to track the module, which is causing the trouble.

Could someone please tell me, where I could find a list (or something like that), which tells me the names of the 121 autoload modules?

Henning


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: [590]

What about running "show modules" in the CLI to find out which modules were auto-loaded?

It could also be useful to grep through the source code (where in the tree?) to find any occurence of fork() which haven't been rewritten to use vfork() instead.


Administrator has disabled public posting
Henning
useravatar
User Info

Re: [590]

Thanks for your relpy, Gilles. It's working now :-)

Modules.conf:

 Spoiler Show Spoiler / Hide Spoiler
 
;
; Asterisk configuration file
;
; Module Loader configuration file
;

[modules]
autoload=yes
;
; Any modules that need to be loaded before the Asterisk core has been
; initialized (just after the logger has been initialized) can be loaded
; using 'preload'. This will frequently be needed if you wish to map all
; module configuration files into Realtime storage, since the Realtime
; driver will need to be loaded before the modules using those configuration
; files are initialized.
;
;

noload => app_dahdiras.so
noload => app_dahdibarge.so
noload => app_dahdiscan.so

; Module names listed in "global" section will have symbols globally
; exported to modules loaded after them.
;
[global]
And my target:
 Spoiler Show Spoiler / Hide Spoiler
 
                           _____________________________________
        a8888b.           / Welcome to the uClinux distribution \
       d888888b.         /       _     _                         \
       8P"YP"Y88        /       | |   |_|            __  __ (TM)  |
       8|o||o|88  _____/        | |    _ ____  _   _ \ \/ /       |
       8'    .88       \        | |   | |  _ \| | | | \  /        |
       8`._.' Y8.       \       | |__ | | | | | |_| | /  \        |
      d/      `8b.       \      \____||_|_| |_|\____|/_/\_\       |
     dP   .    Y8b.       \   For embedded processors including   |
    d8:'  "  `::88b        \    the Analog Devices Blackfin      /
   d8"         'Y88b        \___________________________________/
  :8P    '      :888
   8a.   :     _a88P         For further information, check out:
._/"Yaa_:   .| 88P|            - http://blackfin.uclinux.org/
\    YP"    `| 8P  `.          - http://docs.blackfin.uclinux.org/
/     \.___.d|    .'           - http://www.uclinux.org/
`--..__)8888P`._.'  jgs/a:f    - http://www.analog.com/blackfin

Have a lot of fun...


BusyBox v1.16.2 (2011-12-13 16:43:11 CET) hush - the humble shell

root:/> PHY: 0:00 - Link is Up - 100/Full

root:/> asterisk -c
Asterisk 1.4.42, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
[ Booting...
[ Reading Master Configuration ]
[ Initializing Custom Configuration Options ]
[Jan  1 00:00:09] NOTICE[269]: manager.c:3182 init_manager: Unable to open management configuration manager.conf.  Call management disabled.
[Jan  1 00:00:09] NOTICE[269]: cdr.c:1449 do_reload: CDR simple logging enabled.
[Jan  1 00:00:09] WARNING[269]: db.c:66 dbinit: Unable to open Asterisk database '/var/lib/asterisk/astdb': No such file or directory
[Jan  1 00:00:09] NOTICE[269]: loader.c:1006 load_modules: 118 modules will be loaded.
.............[Jan  1 00:00:10] NOTICE[269]: res_smdi.c:886 smdi_load: Unable to load config smdi.conf: SMDI disabled
[Jan  1 00:00:10] WARNING[269]: res_smdi.c:1364 load_module: No SMDI interfaces are available to listen on, not starting SMDI listener.
.[Jan  1 00:00:10] WARNING[269]: res_features.c:3635 load_config: Could not load features.conf
....[Jan  1 00:00:10] NOTICE[269]: app_queue.c:4506 reload_queues: No call queueing config file (queues.conf), so no call queues
............[Jan  1 00:00:10] ERROR[269]: codec_dahdi.c:602 find_transcoders: Failed to open /dev/dahdi/transcode: No such file or directory
.[Jan  1 00:00:11] WARNING[269]: res_crypto.c:507 crypto_load: Unable to open key directory '/var/lib/asterisk/keys'
..[Jan  1 00:00:11] NOTICE[269]: chan_agent.c:1168 read_agent_config: No agent configuration found -- agent support disabled
...[Jan  1 00:00:11] WARNING[269]: pbx_spool.c:522 load_module: Unable to create queue directory /var/spool/asterisk/outgoing -- outgoing spool disabled
........[Jan  1 00:00:11] WARNING[269]: app_followme.c:302 reload_followme: No follow me config file (followme.conf), so no follow me
...............[Jan  1 00:00:11] WARNING[269]: cdr_custom.c:99 load_config: Failed to load configuration file. Module not activated.
.............[Jan  1 00:00:11] WARNING[269]: cdr_csv.c:112 load_config: unable to load config: cdr.conf
...[Jan  1 00:00:12] WARNING[269]: res_musiconhold.c:846 moh_scan_files: Cannot open dir /var/lib/asterisk/moh or dir does not exist
[Jan  1 00:00:12] WARNING[269]: res_musiconhold.c:1468 load_module: No music on hold classes configured, disabling music on hold.
..[Jan  1 00:00:12] ERROR[269]: chan_dahdi.c:13223 setup_dahdi: Unable to load chan_dahdi.conf
.......[Jan  1 00:00:12] NOTICE[269]: chan_ooh323.c:2494 load_module: ---------------------------------------------------------------------------------
---  ******* IMPORTANT NOTE ***********
---
---  This module is currently unsupported.  Use it at your own risk.
---
--------------------------------------------------------[Jan  1 00:00:12] NOTICE[269]: chan_ooh323.c:1883 reload_config: Unable to load config ooh323.conf, d
.....[Jan  1 00:00:12] WARNING[269]: app_voicemail.c:9215 load_config: Failed to load configuration file.
...[Jan  1 00:00:12] WARNING[269]: chan_iax2.c:12784 load_module: Unable to open IAX timing interface: No such file or directory
[Jan  1 00:00:12] ERROR[269]: chan_iax2.c:11425 set_config: Unable to load config iax.conf
.........[Jan  1 00:00:13] WARNING[269]: acl.c:401 ast_get_ip_or_srv: Unable to lookup 'indutel.sip'
[Jan  1 00:00:13] ERROR[269]: chan_sip.c:18935 build_peer: host lookup failed for indutel.sip, on peer indutel, removing peer
[Jan  1 00:00:13] WARNING[269]: acl.c:401 ast_get_ip_or_srv: Unable to lookup 'pbx.sip'
[Jan  1 00:00:13] ERROR[269]: chan_sip.c:18935 build_peer: host lookup failed for pbx.sip, on peer pbx, removing peer
........ ]
Asterisk Ready.
*CLI> dialplan show
[ Context 'local' created by 'pbx_config' ]
  '20' =>           1. Dial(SIP/indutel)                          [pbx_config]
                    2. Hangup()                                   [pbx_config]

-= 1 extension (2 priorities) in 1 context. =-
*CLI>
BTW, thanks for your fast answers and great support. :-)


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: [590]

No problem. I just happened to be sitting at my PC when I got the notification smile


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: [590]

The stock modules.conf provided by Switchfin applies noload to several modules, including these DAHDI ones. As to why these modules don't fail to build in the first place, I'm really not sure.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: [590]

Chewi wrote:

As to why these modules don't fail to build in the first place, I'm really not sure.
I remember that it depends on the version of the toolchain: Some applications compiled with the 2008, I think (not sure) some would trigger a warning in the 2009 version, and failed compiling with the 2010 toolchain.

Anyhow, porting code to an MMU-less CPU like the Blackfin may require more than just changing fork() to vfork(), so I guess it's a sain decision to refuse to compile any code that still has a single fork() as a way to show users that this application obviously hasn't been worked to run on that CPU.

Note that an application being in the uClinux-dist tree is no guarantee that it actually compiles/works: I needed some extra apps, so enabled them in the buildroot but the toolchain refused to compile them. Bit of a mess.

I guess that's why Blackfin (Mike Frysinger/vapier) is also collaborating on the Gentoo Embedded project.


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: [590]

Yeah, I know the older toolchain didn't abort. I was assuming he was using the new one but maybe he's not.

Blindly replacing fork() with vfork() does worry me and that's one reason why I'm leaning towards Yate. There are only three instances of fork() and I am fairly confident that these have been dealt with properly.

I'm pretty sure Mike Frysinger was a Gentoo developer long before he worked for ADI but Gentoo is certainly a good distro to do embedded stuff with.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: [590]

I'm interested in any feedback about alternative VoIP servers for the Atcom (I guess that means just Yate, as Freeswitch is unlikely to run on the Blackfin). I also don't really trust a big, monolithic application like Asterisk to run safely on such a different CPU.


Administrator has disabled public posting
Henning
useravatar
User Info

Re: [590]

Chewi wrote:


Yeah, I know the older toolchain didn't abort. I was assuming he was using the new one but maybe he's not.
I'm using the newest toolchain and distro available. I really have no clue, where I messed up... but provoking the compiler to do unknown things... I'm famous for that. ;-)


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: [590]

Funny that the toolchain was able to compile the IAX module, since it seems not to have been rewritten/patched accordingly:


[Jan  1 00:00:16] ERROR[269]: chan_iax2.c:11425 set_config: Unable to load config iax.conf
........asterisk: can't resolve symbol '_fork'


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: [590]

I don't believe you messed up, I can't actually find any offending instance of fork() in the Asterisk code.


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: [590]

Gilles wrote:

Funny that the toolchain was able to compile the IAX module, since it seems not to have been rewritten/patched accordingly:


[Jan  1 00:00:16] ERROR[269]: chan_iax2.c:11425 set_config: Unable to load config iax.conf
........asterisk: can't resolve symbol '_fork'
I don't think chan_iax2 was the cause and he didn't prevent that one from loading. This error would have appeared before any other output from the offending module.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: [590]

So the output from the console is not linear, ie. some error can be due to a totally different module?


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: [590]

Maybe not, that depends on how Asterisk loads them. What I meant was that it would have finished loading chan_iax2 and started to load the next module when that error appeared. Whatever module it was wouldn't have been able to initialise and display any output at all because that error comes from the shared library loader and that has to resolve all symbols before it can load a given library.


Administrator has disabled public posting
admin
useravatar
User Info

Re: [590]

Hi Guys,

So the following modules seems to be problematic?

noload => app_dahdiras.so
noload => app_dahdibarge.so
noload => app_dahdiscan.so

I've checked in the code and it seems only app_dahdiras.so is problematic.
Does your Asterisk fail with app_dahdibarge.so and app_dahdiscan.so?

As per app_dahdiras.so I think vfork substitution is a good candidate here as child and parent doesn't really share much in this case.
Still the child is doing much more then just execv.
Anyone willing to test patched app_dahdiras.so? smile

Best Reagards
Dimitar


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: [590]

Hi Dimitar,

Apparently, rewriting an application use vfork() instead of fork() is either trivial or very involved:

Porting Applications to uClinux

We have no Fork

BTW, is that fork/vfork issue due to the use of the smaller uClibc instead of the fuller Glibc, or because the Atcom uses the Blackfin non-MMU CPU, or both?

Cheers,


Administrator has disabled public posting
Chewi
useravatar
User Info

Re: [590]

Nothing to do with the libc. No MMU means uClinux and therefore no fork. Without an MMU, fork is just complicated for the kernel to handle.


Administrator has disabled public posting
Gilles
useravatar
User Info

Re: [590]

I read somewhere that uClinux uses uClibc (obviously, since Glibc is too big for appliances), so I was wondering if the absence of fork() was due to the kernel or the C library.


Administrator has disabled public posting
admin
useravatar
User Info

Re: [590]

Hi Gilles,

Using fork you get child process with stack and heap memory the same as on the parent process. But still if child change something it doesn't affect the parent memory. This can be done easily with the help of Memory Management Unit MMU which Blackfin doesn't have.

So the alternatives is to use vfork with all the problems we get smile
For example with vfork the parent is put on hold until child exit or 'exec' - replace itself with another process. With vfork the child amd parent share the same memory etc.   

So it is a CPU limitation actually.

Best Regards
Dimitar


Administrator has disabled public posting

Board Info

Board Stats:   Total Users: 2587  Total Topics: 299  Total Polls: 1  Total Posts: 1727  Dormant
User Info:   Newest User :  user2553   Members Online: 0   Guests Online: 213
Online  There are no members online
Topic
New
Locked
Topic
New
Locked
Sticky
Active
New/Active
Sticky
Active
New/Active
New/Closed
New Sticky
Closed/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky Active Locked
Active/Sticky
Sticky/Locked
Sticky/Active/Locked