[OpenSIPS-Devel] [OpenSIPS/opensips] f4b803: modules/b2b_logic: fix b2b_logic lable for dbtext

2016-03-04 Thread Ovidiu Sas
  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: f4b803f1dbe90bd492e126d9b9c43215334e39fe
  
https://github.com/OpenSIPS/opensips/commit/f4b803f1dbe90bd492e126d9b9c43215334e39fe
  Author: Ovidiu Sas 
  Date:   2016-03-04 (Fri, 04 Mar 2016)

  Changed paths:
M db/schema/b2b_logic.xml
M modules/b2b_logic/b2b_logic.c
M scripts/db_berkeley/opensips/version
M scripts/dbtext/opensips/b2b_logic
M scripts/dbtext/opensips/version
M scripts/mysql/b2b-create.sql
M scripts/oracle/b2b-create.sql
M scripts/postgres/b2b-create.sql
M scripts/sqlite/b2b-create.sql

  Log Message:
  ---
  modules/b2b_logic: fix b2b_logic lable for dbtext
 - allow scenario, e1_sid and e2_sid fields to be NULL


___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] [OpenSIPS/opensips] 11a805: modules/b2b_entities: fix crash when restoring b2b...

2016-03-04 Thread Ovidiu Sas
  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 11a805b99fbc6c90e314798cc2207b33bd181513
  
https://github.com/OpenSIPS/opensips/commit/11a805b99fbc6c90e314798cc2207b33bd181513
  Author: Ovidiu Sas 
  Date:   2016-03-04 (Fri, 04 Mar 2016)

  Changed paths:
M modules/b2b_entities/b2be_db.c

  Log Message:
  ---
  modules/b2b_entities: fix crash when restoring b2b entities from dbtext


___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] [OpenSIPS/opensips] 7e0175: modules/usrloc: fix location table for dbtext

2016-03-04 Thread Ovidiu Sas
  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 7e0175b17e1bd63ddf386814e5d7dbb8ff803264
  
https://github.com/OpenSIPS/opensips/commit/7e0175b17e1bd63ddf386814e5d7dbb8ff803264
  Author: Ovidiu Sas 
  Date:   2016-03-04 (Fri, 04 Mar 2016)

  Changed paths:
M db/schema/location.xml
M modules/usrloc/ul_mod.h
M scripts/db_berkeley/opensips/version
M scripts/dbtext/opensips/location
M scripts/dbtext/opensips/version
M scripts/mysql/usrloc-create.sql
M scripts/oracle/usrloc-create.sql
M scripts/postgres/usrloc-create.sql
M scripts/sqlite/usrloc-create.sql

  Log Message:
  ---
  modules/usrloc: fix location table for dbtext
 - allow domain field to be NULL


___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] [OpenSIPS/opensips] 6d126a: tm: Refactor some hardcoded static string lengths

2016-03-04 Thread Liviu Chircu
  Branch: refs/heads/2.1
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 6d126a1564742c7cd58bd286cbf587c1fab96b45
  
https://github.com/OpenSIPS/opensips/commit/6d126a1564742c7cd58bd286cbf587c1fab96b45
  Author: Liviu Chircu 
  Date:   2016-03-04 (Fri, 04 Mar 2016)

  Changed paths:
M modules/tm/mi.c

  Log Message:
  ---
  tm: Refactor some hardcoded static string lengths

This also fixes a couple of chopped MI error strings in "t_uac_dlg"

(cherry picked from commit 60d4d4bc1edc493aaedcee40976347d3fbe9094e)


___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] [opensips] async() crashes in local_route (#820)

2016-03-04 Thread Liviu Chircu
Affected versions: OpenSIPS 2.X

To reproduce, trigger the following local_route

```
local_route
{
async(avp_db_query(...), resume_route);
}
```

 with a locally generated message:

`scripts/opensipsctl fifo t_uac_dlg MESSAGE sip:netcat@172.16.36.33:8889 . . 
"\"From: \r\nTo: \r\n\""`

OpenSIPS will crash with:

```
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x7fecb2693647 in update_cloned_msg_from_msg (c_msg=0x0, 
msg=0x7fecb28e79a0 ) at sip_msg.c:1139
1139if ( (c_msg->msg_flags & (FL_SHM_UPDATABLE|FL_SHM_CLONE))==0 ) {
(gdb) bt
#0  0x7fecb2693647 in update_cloned_msg_from_msg (c_msg=0x0, 
msg=0x7fecb28e79a0 ) at sip_msg.c:1139
#1  0x7fecb268507d in t_handle_async (msg=0x7fecb28e79a0 , 
a=0x7fecc3f96540, resume_route=6) at async.c:226
#2  0x0041a302 in do_action (a=0x7fecc3f966d0, msg=0x7fecb28e79a0 
) at action.c:1877
#3  0x0041201f in run_action_list (a=0x7fecc3f961d0, msg=0x7fecb28e79a0 
) at action.c:172
#4  0x00411eec in run_actions (a=0x7fecc3f961d0, msg=0x7fecb28e79a0 
) at action.c:137
#5  0x004120f6 in run_top_route (a=0x7fecc3f961d0, msg=0x7fecb28e79a0 
) at action.c:206
#6  0x7fecb26ba85a in t_uac (method=0x7fecc3fe4d60, headers=0x7fffe94f7570, 
body=0x0, dialog=0x7fecb28d3a60 , cb=0x7fecb268d42a , 
cbp=0x7fecb4271060, release_func=0x0) at uac.c:302
#7  0x7fecb268df57 in mi_tm_uac_dlg (cmd_tree=0x7fecc3fe4cd0, param=0x0) at 
mi.c:533
#8  0x7fecb354ee27 in run_mi_cmd (cmd=0x7fecc3fd9970, t=0x7fecc3fe4cd0, 
f=0x7fecb3554a27 , param=0x0) at ../../mi/mi.h:107
#9  0x7fecb3551fb3 in mi_fifo_server (fifo_stream=0x115a990) at 
fifo_fnc.c:586
#10 0x7fecb3552e4c in fifo_process (rank=0) at mi_fifo.c:214
#11 0x00481e4a in start_module_procs () at sr_module.c:763
#12 0x0042fe53 in main_loop () at main.c:650
#13 0x004328d3 in main (argc=7, argv=0x7fffe94f7df8) at main.c:1252
```

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/820___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] [OpenSIPS/opensips] 60d4d4: tm: Refactor some hardcoded static string lengths

2016-03-04 Thread Liviu Chircu
  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 60d4d4bc1edc493aaedcee40976347d3fbe9094e
  
https://github.com/OpenSIPS/opensips/commit/60d4d4bc1edc493aaedcee40976347d3fbe9094e
  Author: Liviu Chircu 
  Date:   2016-03-04 (Fri, 04 Mar 2016)

  Changed paths:
M modules/tm/mi.c

  Log Message:
  ---
  tm: Refactor some hardcoded static string lengths

This also fixes a couple of chopped MI error strings in "t_uac_dlg"


___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] [opensips] async() crashes on end-to-end ACKs (#819)

2016-03-04 Thread Liviu Chircu
Present in all 2.X versions.

To reproduce: simply throw in an `async()` call in the beginning of the request 
route:

```
route
{
async(avp_db_query(...));
...
```

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/819___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


Re: [OpenSIPS-Devel] [opensips] [1.11] Crash on TCP read (#813)

2016-03-04 Thread Saúl Ibarra Corretgé
Thanks Razvan!

On Fri, Mar 4, 2016 at 3:43 PM, Răzvan Crainea 
wrote:

> Closed #813 .
>
> —
> Reply to this email directly or view it on GitHub
> .
>
> ___
> Devel mailing list
> Devel@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>
>


-- 
/Saúl
bettercallsaghul.com
___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] [OpenSIPS/opensips] 2555c5: Allow setting branch flags when no branches are ye...

2016-03-04 Thread Liviu Chircu
  Branch: refs/heads/2.1
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 2555c5e2fefe50dc8d61b5d488113330a601060c
  
https://github.com/OpenSIPS/opensips/commit/2555c5e2fefe50dc8d61b5d488113330a601060c
  Author: Liviu Chircu 
  Date:   2016-03-04 (Fri, 04 Mar 2016)

  Changed paths:
M dset.c

  Log Message:
  ---
  Allow setting branch flags when no branches are yet appended

Commit 5e3f06800e was too restrictive, since flags for "branch 0"
(a special branch, stored in current struct sip_msg) may be set regardless of
the number of append_branch() operations done previously!

Reported by Dragomir Haralambiev

(cherry picked from commit 6d1704c6c936921c504c8261ef5de1d710ed3d22)


___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] [OpenSIPS/opensips] cde7bd: tcp: prevent invalid mem access

2016-03-04 Thread Razvan Crainea
  Branch: refs/heads/2.1
  Home:   https://github.com/OpenSIPS/opensips
  Commit: cde7bd4795dee92b11de0dc86c9273195b044f1f
  
https://github.com/OpenSIPS/opensips/commit/cde7bd4795dee92b11de0dc86c9273195b044f1f
  Author: Razvan Crainea 
  Date:   2016-03-04 (Fri, 04 Mar 2016)

  Changed paths:
M net/proto_tcp/tcp_common.h

  Log Message:
  ---
  tcp: prevent invalid mem access

Reported by Saúl Ibarra Corretgé

(cherry picked from commit a607aa846f659f9edf5e08bdb13831e633cdde33)


___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] [OpenSIPS/opensips] a607aa: tcp: prevent invalid mem access

2016-03-04 Thread Razvan Crainea
  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: a607aa846f659f9edf5e08bdb13831e633cdde33
  
https://github.com/OpenSIPS/opensips/commit/a607aa846f659f9edf5e08bdb13831e633cdde33
  Author: Razvan Crainea 
  Date:   2016-03-04 (Fri, 04 Mar 2016)

  Changed paths:
M net/proto_tcp/tcp_common.h

  Log Message:
  ---
  tcp: prevent invalid mem access

Reported by Saúl Ibarra Corretgé


___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


Re: [OpenSIPS-Devel] [opensips] [1.11] Crash on TCP read (#813)

2016-03-04 Thread Răzvan Crainea
Closed #813.

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/813#event-577857822___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] [OpenSIPS/opensips] 57085a: tcp: prevent invalid mem access

2016-03-04 Thread Razvan Crainea
  Branch: refs/heads/1.11
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 57085a3dee9cb1b71d71a9505cae406ae431c788
  
https://github.com/OpenSIPS/opensips/commit/57085a3dee9cb1b71d71a9505cae406ae431c788
  Author: Razvan Crainea 
  Date:   2016-03-04 (Fri, 04 Mar 2016)

  Changed paths:
M tcp_read.c

  Log Message:
  ---
  tcp: prevent invalid mem access

Reported by Saúl Ibarra Corretgé
Closes #813


___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


Re: [OpenSIPS-Devel] [opensips] [1.11] Crash on TCP read (#813)

2016-03-04 Thread Saúl Ibarra Corretgé
Yep, good old `malloc` :-)

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/813#issuecomment-192299774___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


Re: [OpenSIPS-Devel] [opensips] [1.11] Crash on TCP read (#813)

2016-03-04 Thread Răzvan Crainea
So you're using `malloc`? If so, you might indeed run into the first issue you 
pointed out.

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/813#issuecomment-192297263___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


Re: [OpenSIPS-Devel] [opensips] [1.11] Crash on TCP read (#813)

2016-03-04 Thread Saúl Ibarra Corretgé
There you go:


(gdb) bt
#0  tcp_read_req (con=con@entry=0xa773e948,
bytes_read=bytes_read@entry=0xbfb3b8cc)
at tcp_read.c:711
#1  0x080e08a2 in handle_io (fm=0x99015c8, idx=idx@entry=-1,
event_type=event_type@entry=1) at tcp_read.c:1036
#2  0x080e271c in io_wait_loop_epoll (repeat=, h=, t=) at io_wait.h:867
#3  tcp_receive_loop (unix_sock=72) at tcp_read.c:1144
#4  0x080dc690 in tcp_init_children (chd_rank=chd_rank@entry=0x81e362c,
startup_done=startup_done@entry=0x0) at tcp_main.c:2378
#5  0x0805db02 in main_loop () at main.c:1011
#6  main (argc=11, argv=0xbfb3bbf4) at main.c:1612
(gdb) print req
$1 = (struct tcp_req *) 0x995eaf8
(gdb) print cur
cur_lock curr_dir current_dlg_pointer  current_req
(gdb) print current_req
$2 = {next = 0x0,
  buf = "\r\n\r\n2.0 200 OK\r\nVia: SIP/2.0/TLS
81.23.228.129:443;received=81.23.228.129;branch=z9hG4bK5a46.32065967.0\r\nVia:
SIP/2.0/UDP 81.23.228.150:5060;branch=z9hG4bK5a46.b782e725.0\r\nRecord-Route:

wrote:

> What allocator are you using? Could you print the req variable in gdb and
> paste the output here?
>
> —
> Reply to this email directly or view it on GitHub
> .
>
> ___
> Devel mailing list
> Devel@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>
>


-- 
/Saúl
bettercallsaghul.com
___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


Re: [OpenSIPS-Devel] [opensips] [1.11] Crash on TCP read (#813)

2016-03-04 Thread Răzvan Crainea
What allocator are you using? Could you print the `req` variable in gdb and 
paste the output here?

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/813#issuecomment-192293339___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


Re: [OpenSIPS-Devel] [opensips] [1.11] Crash on TCP read (#813)

2016-03-04 Thread Saúl Ibarra Corretgé
@razvancrainea it crashed here: 
https://github.com/OpenSIPS/opensips/blob/1.11/tcp_read.c#L711 My guess is that 
it accesses freed memory, hence the crash. It might work sometimes, but if a 
hardened system memory allocator is used it will.

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/813#issuecomment-192265551___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


Re: [OpenSIPS-Devel] [opensips] [1.11] Crash on TCP read (#813)

2016-03-04 Thread Răzvan Crainea
Hi, Saul!

The first issue you pointed out, might indeed cause an "invalid" use of 
unallocated memory. However, since that's only pkg memory, nobody can come and 
use that buffer, so that can't cause any crash. Nevertheless, thanks for 
pointing it out, I will shortly fix that.

Regarding the `release_tcpconn` issue, I couldn't find any possible path where 
the function would get called twice. Even though `tcp_read_req` explicitly 
releases the connection, it only does it on successful cases.

Thanks for pointing these out, but I don't see a bug in the code. Perhaps the 
core dump might give us more information. Can you point out the line that 
crashed?

Thanks,
Răzvan


---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/813#issuecomment-192260018___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel