Build failure of network:osmocom:nightly/osmo-pcap in Debian_9.0/aarch64

2018-01-20 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcap/Debian_9.0/aarch64

Package network:osmocom:nightly/osmo-pcap failed to build in Debian_9.0/aarch64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-pcap

Last lines of build log:
[  162s]libncurses.so.5 -> libncurses.so.5.9
[  162s]libcidn.so.1 -> libcidn-2.24.so
[  162s]libanl.so.1 -> libanl-2.24.so
[  162s] /usr/lib/aarch64-linux-gnu:
[  162s]libdebconfclient.so.0 -> libdebconfclient.so.0.0.0
[  162s]libpcreposix.so.3 -> libpcreposix.so.3.13.3
[  162s]libustr-1.0.so.1 -> libustr-1.0.so.1.0.4
[  162s]libsemanage.so.1 -> libsemanage.so.1
[  162s]libtic.so.5 -> libtic.so.5.9
[  162s]libdb-5.3.so -> libdb-5.3.so
[  162s]libsigsegv.so.2 -> libsigsegv.so.2.0.3
[  162s]libmenu.so.5 -> libmenu.so.5.9
[  162s]libpanel.so.5 -> libpanel.so.5.9
[  162s]libperl.so.5.24 -> libperl.so.5.24.1
[  162s]libform.so.5 -> libform.so.5.9
[  162s] /usr/lib/aarch64-linux-gnu/libfakeroot:
[  162s]libfakeroot-0.so -> libfakeroot-tcp.so
[  162s] /usr/local/lib:
[  162s] /lib:
[  162s] /usr/lib:
[  163s] [28/199] installing libffi6-3.2.1-6
[28973s] qemu-system-aarch64: terminating on signal 15 from pid 35159 (fuser)
[28973s] ### VM INTERACTION END ###
[28973s] /var/run/obs/worker/32/build/build-vm: line 913: warning: command 
substitution: ignored null byte in input
[28973s] No buildstatus set, either the base system is broken 
(kernel/initrd/udev/glibc/bash/perl)
[28973s] or the build host has a kernel or hardware problem...


Job seems to be stuck here, killed. (after 28800 seconds of inactivity)

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


[PATCH] osmo-trx[master]: Unbreak `./configure --with-usrp1` build

2018-01-20 Thread Alexander Huemer

Review at  https://gerrit.osmocom.org/5938

Unbreak `./configure --with-usrp1` build

Change-Id: I49b385594271ae64a48d4d39ee9fe26d7c95bd30
---
M Transceiver52M/Makefile.am
M Transceiver52M/USRPDevice.cpp
M configure.ac
3 files changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/38/5938/1

diff --git a/Transceiver52M/Makefile.am b/Transceiver52M/Makefile.am
index 8df2d34..5b5fafa 100644
--- a/Transceiver52M/Makefile.am
+++ b/Transceiver52M/Makefile.am
@@ -91,12 +91,13 @@
libtransceiver.la \
$(ARCH_LA) \
$(GSM_LA) \
-   $(COMMON_LA)
+   $(COMMON_LA) \
+   $(FFTWF_LIBS)
 
 if USRP1
 libtransceiver_la_SOURCES += USRPDevice.cpp
 osmo_trx_LDADD += $(USRP_LIBS)
 else
 libtransceiver_la_SOURCES += UHDDevice.cpp
-osmo_trx_LDADD += $(UHD_LIBS) $(FFTWF_LIBS)
+osmo_trx_LDADD += $(UHD_LIBS)
 endif
diff --git a/Transceiver52M/USRPDevice.cpp b/Transceiver52M/USRPDevice.cpp
index 034ccd8..e5be58d 100644
--- a/Transceiver52M/USRPDevice.cpp
+++ b/Transceiver52M/USRPDevice.cpp
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include "Logger.h"
 #include "Threads.h"
 #include "USRPDevice.h"
 
@@ -599,7 +600,7 @@
 #endif
 
 RadioDevice *RadioDevice::make(size_t tx_sps, size_t rx_sps,
-  size_t chans, double)
+  RadioDevice::InterfaceType, size_t chans, double)
 {
return new USRPDevice(tx_sps);
 }
diff --git a/configure.ac b/configure.ac
index 5cee4a6..7d26ced 100644
--- a/configure.ac
+++ b/configure.ac
@@ -113,7 +113,6 @@
 )]
 )
 AC_DEFINE(USE_UHD, 1, All UHD versions)
-PKG_CHECK_MODULES(FFTWF, fftw3f)
 ])
 
 AS_IF([test "x$with_singledb" = "xyes"], [
@@ -160,6 +159,7 @@
 AM_CONDITIONAL(ARCH_ARM_A15, [test "x$with_neon_vfpv4" = "xyes"])
 
 PKG_CHECK_MODULES(LIBUSB, libusb-1.0)
+PKG_CHECK_MODULES(FFTWF, fftw3f)
 
 AC_CHECK_HEADER([boost/config.hpp],[],
 [AC_MSG_ERROR([boost/config.hpp not found, install e.g. libboost-dev])])

-- 
To view, visit https://gerrit.osmocom.org/5938
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I49b385594271ae64a48d4d39ee9fe26d7c95bd30
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Huemer 


[PATCH] libosmocore[master]: tests/ussd: prevent uninitialized memory access

2018-01-20 Thread Vadim Yanitskiy
Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/5934

to look at the new patch set (#2).

tests/ussd: prevent uninitialized memory access

Previously an incorrect length value was passed to both
gsm_7bit_decode_n_ussd() and gsm_7bit_encode_n_ussd()
functions during test_7bit_ussd() execution, due to:

   octets_written = strlen(decoded);

The problem is that a 7-bit encoded string takes less memory
than its 8-bit equivalent. So, here strlen() returns one-byte
bigger value, that octets_written is. This then causes the
uninitialized memory access.

Found using Valgrind:

Conditional jump or move depends on uninitialised value(s)
   at 0x506DCCC: gsm_7bit_decode_n_ussd (gsm_utils.c:248)
   by 0x40134B: test_7bit_ussd (ussd_test.c:104)
   by 0x400F5D: main (ussd_test.c:161)

Conditional jump or move depends on uninitialised value(s)
   at 0x506DBB7: gsm_7bit_decode_n_hdr (gsm_utils.c:220)
   by 0x506DC9E: gsm_7bit_decode_n_ussd (gsm_utils.c:246)
   by 0x40134B: test_7bit_ussd (ussd_test.c:104)
   by 0x400F5D: main (ussd_test.c:161)

Conditional jump or move depends on uninitialised value(s)
   at 0x506DBCB: gsm_septet_lookup (gsm_utils.c:153)
   by 0x506DBCB: gsm_7bit_decode_n_hdr (gsm_utils.c:224)
   by 0x506DC9E: gsm_7bit_decode_n_ussd (gsm_utils.c:246)
   by 0x40134B: test_7bit_ussd (ussd_test.c:104)
   by 0x400F5D: main (ussd_test.c:161)

Change-Id: Ic31805b6a5a917dfc6284edba6ffdd21246ac20c
---
M tests/ussd/ussd_test.c
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/34/5934/2

diff --git a/tests/ussd/ussd_test.c b/tests/ussd/ussd_test.c
index 8d88dbb..429c72d 100644
--- a/tests/ussd/ussd_test.c
+++ b/tests/ussd/ussd_test.c
@@ -90,8 +90,7 @@
OSMO_ASSERT(strcmp(encoded_hex, osmo_hexdump_nospc(coded, 
octets_written)) == 0);
 
gsm_7bit_decode_n_ussd(decoded, sizeof(decoded), coded, octets_written 
* 8 / 7);
-   octets_written = strlen(decoded);
-   printf("decoded = %s\n\n", osmo_hexdump((uint8_t *)decoded, 
octets_written));
+   printf("decoded = %s\n\n", osmo_hexdump((uint8_t *)decoded, 
strlen(decoded)));
 
OSMO_ASSERT(strncmp(text, decoded, strlen(text)) == 0);
OSMO_ASSERT(strcmp(appended_after_decode, decoded + strlen(text)) == 0);

-- 
To view, visit https://gerrit.osmocom.org/5934
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic31805b6a5a917dfc6284edba6ffdd21246ac20c
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 


libosmocore[master]: tests/ussd: prevent uninitialized memory access

2018-01-20 Thread Vadim Yanitskiy

Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/5934/1//COMMIT_MSG
Commit Message:

Line 16: value, that octets_written is. This then causes the
> and why is that? strlen() doesn't include any NUL byte, so why is it longer
Good question, I'll look closer and update commit msg.
You can also check putting a debug printf ;)


-- 
To view, visit https://gerrit.osmocom.org/5934
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic31805b6a5a917dfc6284edba6ffdd21246ac20c
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: Yes


libosmocore[master]: MNCC: Add MNCC to string dumper

2018-01-20 Thread Harald Welte

Patch Set 3: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/5625
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I216aaf70868ba5f3860a60c4b2442957531a3011
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] libosmocore[master]: MNCC: Add MNCC to string dumper

2018-01-20 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: MNCC: Add MNCC to string dumper
..


MNCC: Add MNCC to string dumper

As MNCC is rather hard to debug (wireshark cannot trace UNIX domain
sockets), let's add our own decoder that we can use from related
debug log statements in the respective programs.

Change-Id: I216aaf70868ba5f3860a60c4b2442957531a3011
---
M include/osmocom/gsm/mncc.h
M src/gsm/Makefile.am
M src/gsm/libosmogsm.map
A src/gsm/mncc.c
4 files changed, 429 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/gsm/mncc.h b/include/osmocom/gsm/mncc.h
index f2450d9..5ca2986 100644
--- a/include/osmocom/gsm/mncc.h
+++ b/include/osmocom/gsm/mncc.h
@@ -82,3 +82,12 @@
GSM_MNCC_BCAP_OTHER_ITC = 5,
GSM_MNCC_BCAP_RESERVED  = 7,
 };
+
+struct msgb;
+struct msgb *osmo_mncc_stringify(const uint8_t *msg, unsigned int len);
+
+void _osmo_mncc_log(int subsys, int level, const char *file, int line, const 
char *prefix,
+   const uint8_t *msg, unsigned int len);
+
+#define osmo_mncc_log(ss, level, prefix, msg, len) \
+   _osmo_mncc_log(ss, level, __BASE_FILE__, __LINE__, prefix, msg, len);
diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am
index 12f56db..f85aba3 100644
--- a/src/gsm/Makefile.am
+++ b/src/gsm/Makefile.am
@@ -30,7 +30,7 @@
milenage/aes-internal.c milenage/aes-internal-enc.c \
milenage/milenage.c gan.c ipa.c gsm0341.c apn.c \
gsup.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c \
-   gsm23003.c
+   gsm23003.c mncc.c
 libgsmint_la_LDFLAGS = -no-undefined
 libgsmint_la_LIBADD = $(top_builddir)/src/libosmocore.la
 
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index 985ec83..9a7073d 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -427,5 +427,8 @@
 osmo_imsi_str_valid;
 osmo_msisdn_str_valid;
 
+osmo_mncc_stringify;
+_osmo_mncc_log;
+
 local: *;
 };
diff --git a/src/gsm/mncc.c b/src/gsm/mncc.c
new file mode 100644
index 000..fa4726c
--- /dev/null
+++ b/src/gsm/mncc.c
@@ -0,0 +1,416 @@
+/* mncc.c - utility routines for the MNCC API between the 04.08
+ * message parsing and the actual Call Control logic */
+
+/* (C) 2008-2017 by Harald Welte 
+ * (C) 2009 by Andreas Eversberg 
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see .
+ *
+ */
+
+#include "../config.h"
+
+#ifdef HAVE_SYS_SOCKET_H
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+/* FIXME FIXME FIXME FIXME FIXME START */
+#define MNCC_SETUP_REQ 0x0101
+#define MNCC_SETUP_IND 0x0102
+#define MNCC_SETUP_RSP 0x0103
+#define MNCC_SETUP_CNF 0x0104
+#define MNCC_SETUP_COMPL_REQ   0x0105
+#define MNCC_SETUP_COMPL_IND   0x0106
+/* MNCC_REJ_* is perfomed via MNCC_REL_* */
+#define MNCC_CALL_CONF_IND 0x0107
+#define MNCC_CALL_PROC_REQ 0x0108
+#define MNCC_PROGRESS_REQ  0x0109
+#define MNCC_ALERT_REQ 0x010a
+#define MNCC_ALERT_IND 0x010b
+#define MNCC_NOTIFY_REQ0x010c
+#define MNCC_NOTIFY_IND0x010d
+#define MNCC_DISC_REQ  0x010e
+#define MNCC_DISC_IND  0x010f
+#define MNCC_REL_REQ   0x0110
+#define MNCC_REL_IND   0x0111
+#define MNCC_REL_CNF   0x0112
+#define MNCC_FACILITY_REQ  0x0113
+#define MNCC_FACILITY_IND  0x0114
+#define MNCC_START_DTMF_IND0x0115
+#define MNCC_START_DTMF_RSP0x0116
+#define MNCC_START_DTMF_REJ0x0117
+#define MNCC_STOP_DTMF_IND 0x0118
+#define MNCC_STOP_DTMF_RSP 0x0119
+#define MNCC_MODIFY_REQ0x011a
+#define MNCC_MODIFY_IND0x011b
+#define MNCC_MODIFY_RSP0x011c
+#define MNCC_MODIFY_CNF0x011d
+#define MNCC_MODIFY_REJ0x011e
+#define MNCC_HOLD_IND  0x011f
+#define MNCC_HOLD_CNF  0x0120
+#define MNCC_HOLD_REJ  0x0121
+#define MNCC_RETRIEVE_IND  0x0122
+#define MNCC_RETRIEVE_CNF  0x0123
+#define MNCC_RETRIEVE_REJ  0x0124
+#define MNCC_USERINFO_REQ   

[MERGED] osmo-msc[master]: Store/retrieve SMS validity time in the SMS datebase

2018-01-20 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Store/retrieve SMS validity time in the SMS datebase
..


Store/retrieve SMS validity time in the SMS datebase

Compute a validity timestamp based on SMS validity time.
Store the computed value in the database and recompute the validity
time when an SMS is read from the database.

Change-Id: Id27c250d3a64cd109416450e8ca155b18a8b9568
---
M src/libmsc/db.c
1 file changed, 11 insertions(+), 8 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libmsc/db.c b/src/libmsc/db.c
index e80ef53..4bf9b1f 100644
--- a/src/libmsc/db.c
+++ b/src/libmsc/db.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -690,9 +691,7 @@
dbi_result result;
char *q_text, *q_daddr, *q_saddr;
unsigned char *q_udata;
-   char *validity_timestamp = "-2-2";
-
-   /* FIXME: generate validity timestamp based on validity_minutes */
+   time_t now, validity_timestamp;
 
dbi_conn_quote_string_copy(conn, (char *)sms->text, _text);
dbi_conn_quote_string_copy(conn, (char *)sms->dst.addr, _daddr);
@@ -700,7 +699,9 @@
dbi_conn_quote_binary_copy(conn, sms->user_data, sms->user_data_len,
   _udata);
 
-   /* FIXME: correct validity period */
+   now = time(NULL);
+   validity_timestamp = now + sms->validity_minutes * 60;
+
result = dbi_conn_queryf(conn,
"INSERT INTO SMS "
"(created, valid_until, "
@@ -710,14 +711,14 @@
 "user_data, text, "
 "dest_addr, dest_ton, dest_npi, "
 "src_addr, src_ton, src_npi) VALUES "
-   "(datetime('now'), %u, "
+   "(datetime('%lld', 'unixepoch'), datetime(%lld, 'unixepoch'), "
"%u, %u, %u, "
"%u, %u, %u, "
"%u, "
"%s, %s, "
"%s, %u, %u, "
"%s, %u, %u)",
-   validity_timestamp,
+   (int64_t)now, (int64_t)validity_timestamp,
sms->reply_path_req, sms->status_rep_req, sms->is_report,
sms->msg_ref, sms->protocol_id, sms->data_coding_scheme,
sms->ud_hdr_ind,
@@ -741,15 +742,17 @@
struct gsm_sms *sms = sms_alloc();
const char *text, *daddr, *saddr;
const unsigned char *user_data;
+   time_t validity_timestamp;
 
if (!sms)
return NULL;
 
sms->id = dbi_result_get_ulonglong(result, "id");
 
-   /* FIXME: validity */
-   /* FIXME: those should all be get_uchar, but sqlite3 is braindead */
sms->created = dbi_result_get_datetime(result, "created");
+   validity_timestamp = dbi_result_get_datetime(result, "valid_until");
+   sms->validity_minutes = (validity_timestamp - sms->created) / 60;
+   /* FIXME: those should all be get_uchar, but sqlite3 is braindead */
sms->reply_path_req = dbi_result_get_ulonglong(result, 
"reply_path_req");
sms->status_rep_req = dbi_result_get_ulonglong(result, 
"status_rep_req");
sms->is_report = dbi_result_get_ulonglong(result, "is_report");

-- 
To view, visit https://gerrit.osmocom.org/5875
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id27c250d3a64cd109416450e8ca155b18a8b9568
Gerrit-PatchSet: 2
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


libosmocore[master]: tests/ussd: prevent uninitialized memory access

2018-01-20 Thread Harald Welte

Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/5934/1//COMMIT_MSG
Commit Message:

Line 16: value, that octets_written is. This then causes the
and why is that? strlen() doesn't include any NUL byte, so why is it longer?


-- 
To view, visit https://gerrit.osmocom.org/5934
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic31805b6a5a917dfc6284edba6ffdd21246ac20c
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: Yes