[Home]

Summary:ASTERISK-14013: [patch] chan_vpb fails to catch exception on 1.4
Reporter:Tzafrir Cohen (tzafrir)Labels:
Date Opened:2009-04-25 04:01:16Date Closed:2009-11-10 16:21:16.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) vpb_exception.diff
Description:On module startup, chan_vpb asks libvpb to scan for relevant hardware. If libvpb fails to find any, it raises an exception:

try {
num_cards = vpb_get_num_cards();
} catch (VpbException e) {
ast_log(LOG_ERROR, "No Voicetronix cards detected\n");
return AST_MODULE_LOAD_DECLINE;
}

This seems to work as planned on trunk . However with 1.4 (on the same system and same libvpb) I get

*CLI> module load chan_vpb.so
[Apr 25 11:56:50] ERROR[20919]: chan_vpb.cc:2720 ast_module_load_result terminate called after throwing an instance of 'VpbException'
 what():  VPBREG_NO_VPB_DEVICES_DETECTED
/home/tzafrir/Proj/Asterisk/Git/asterisk/live_ast: line 170: 20919 Aborted                 $AST_BIN -C $AST_CONF "$@"

The fix/workaround (attached) is to use the parent class std::exception .

After which I get:

*CLI> module load chan_vpb.so
[Apr 25 11:58:40] ERROR[21550]: chan_vpb.cc:2722 ast_module_load_result load_module(): No Voicetronix cards detected

and no panic.
Comments:By: Mark Waters (markwaters) 2009-06-06 04:29:16

Also happening for me.

Asterisk 1.4.25.1 built by mark @ core7 on a i686 running Linux on 2009-06-06 09:11:53 UTC

Linux core7 2.6.28-11-server ASTERISK-38-Ubuntu SMP Fri Apr 17 02:48:10 UTC 2009 i686 GNU/Linux

tzafrir's fix works perfectly.

By: Leif Madsen (lmadsen) 2009-08-25 08:19:13

Which version of the VPB driver are you guys using? I'm getting an error just building it:

  [LDXX] chan_vpb.oo -> chan_vpb.so
/usr/bin/ld: /usr/local/lib/libvpb.a(call.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libvpb.a: could not read symbols: Bad value

By: Leif Madsen (lmadsen) 2009-08-25 08:47:03

Actually I think I grabbed the wrong driver. Will retest.

By: Leif Madsen (lmadsen) 2009-08-25 09:17:26

OK, looks like I can use the drivers I downloaded, but Asterisk is failing because I'm on 64-bit and the drivers aren't compiled with fPIC (from what I've Googled). I can't seem to find a good way of getting it going, so I'm moving on now. I'll need to build a 32-bit VM so I can test this.

By: Leif Madsen (lmadsen) 2009-09-08 11:59:28

I don't seem to get that error.... I get this one:

[Sep  8 08:57:23] WARNING[25677]: loader.c:368 load_dynamic_module: Error loading module 'chan_vpb.so': /usr/lib/asterisk/modules/chan_vpb.so: cannot restore segment prot after reloc: Permission denied
[Sep  8 08:57:23] WARNING[25677]: loader.c:721 load_resource: Module 'chan_vpb.so' could not be loaded.

By: Leif Madsen (lmadsen) 2009-09-08 12:21:53

Unassigning myself from this issue as I can't reproduce.

By: Digium Subversion (svnbot) 2009-11-05 13:19:57.000-0600

Repository: asterisk
Revision: 228079

U   branches/1.4/channels/chan_vpb.cc

------------------------------------------------------------------------
r228079 | qwell | 2009-11-05 13:19:56 -0600 (Thu, 05 Nov 2009) | 8 lines

Fix crash on VPB exception when no hardware is present.

(closes issue ASTERISK-14013)
Reported by: tzafrir
Patches:
     vpb_exception.diff uploaded by tzafrir (license 46)
Tested by: markwaters

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=228079

By: Digium Subversion (svnbot) 2009-11-05 13:22:01.000-0600

Repository: asterisk
Revision: 228080

_U  trunk/
U   trunk/channels/chan_vpb.cc

------------------------------------------------------------------------
r228080 | qwell | 2009-11-05 13:22:01 -0600 (Thu, 05 Nov 2009) | 15 lines

Merged revisions 228079 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r228079 | qwell | 2009-11-05 13:14:25 -0600 (Thu, 05 Nov 2009) | 8 lines
 
 Fix crash on VPB exception when no hardware is present.
 
 (closes issue ASTERISK-14013)
 Reported by: tzafrir
 Patches:
       vpb_exception.diff uploaded by tzafrir (license 46)
 Tested by: markwaters
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=228080

By: Digium Subversion (svnbot) 2009-11-05 13:22:44.000-0600

Repository: asterisk
Revision: 228081

_U  branches/1.6.0/
U   branches/1.6.0/channels/chan_vpb.cc

------------------------------------------------------------------------
r228081 | qwell | 2009-11-05 13:22:43 -0600 (Thu, 05 Nov 2009) | 22 lines

Merged revisions 228080 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r228080 | qwell | 2009-11-05 13:16:29 -0600 (Thu, 05 Nov 2009) | 15 lines
 
 Merged revisions 228079 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r228079 | qwell | 2009-11-05 13:14:25 -0600 (Thu, 05 Nov 2009) | 8 lines
   
   Fix crash on VPB exception when no hardware is present.
   
   (closes issue ASTERISK-14013)
   Reported by: tzafrir
   Patches:
         vpb_exception.diff uploaded by tzafrir (license 46)
   Tested by: markwaters
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=228081

By: Digium Subversion (svnbot) 2009-11-05 13:25:06.000-0600

Repository: asterisk
Revision: 228090

_U  branches/1.6.1/
U   branches/1.6.1/channels/chan_vpb.cc

------------------------------------------------------------------------
r228090 | qwell | 2009-11-05 13:25:05 -0600 (Thu, 05 Nov 2009) | 22 lines

Merged revisions 228080 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r228080 | qwell | 2009-11-05 13:16:29 -0600 (Thu, 05 Nov 2009) | 15 lines
 
 Merged revisions 228079 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r228079 | qwell | 2009-11-05 13:14:25 -0600 (Thu, 05 Nov 2009) | 8 lines
   
   Fix crash on VPB exception when no hardware is present.
   
   (closes issue ASTERISK-14013)
   Reported by: tzafrir
   Patches:
         vpb_exception.diff uploaded by tzafrir (license 46)
   Tested by: markwaters
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=228090

By: Digium Subversion (svnbot) 2009-11-05 13:25:43.000-0600

Repository: asterisk
Revision: 228093

_U  branches/1.6.2/
U   branches/1.6.2/channels/chan_vpb.cc

------------------------------------------------------------------------
r228093 | qwell | 2009-11-05 13:25:43 -0600 (Thu, 05 Nov 2009) | 22 lines

Merged revisions 228080 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r228080 | qwell | 2009-11-05 13:16:29 -0600 (Thu, 05 Nov 2009) | 15 lines
 
 Merged revisions 228079 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r228079 | qwell | 2009-11-05 13:14:25 -0600 (Thu, 05 Nov 2009) | 8 lines
   
   Fix crash on VPB exception when no hardware is present.
   
   (closes issue ASTERISK-14013)
   Reported by: tzafrir
   Patches:
         vpb_exception.diff uploaded by tzafrir (license 46)
   Tested by: markwaters
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=228093