Setting environment variables of mkl - sh

In order to set the environment variables of the mkl toolset on linux, I have to execute the script mklvars.sh. But now I get the errors
/opt/intel/mkl/bin/mklvars.sh: 33: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 34: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 36: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 37: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 38: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 39: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 40: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 41: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 42: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 43: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 44: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 45: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 46: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 82: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 83: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 84: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 87: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 90: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 91: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
/opt/intel/mkl/bin/mklvars.sh: 92: /opt/intel/mkl/bin/mklvars.sh: typeset: not found
The error lines start with
typeset SCRIPT_NAME=$0
typeset MOD_NAME=mod
typeset MKL_LP64_ILP64=
typeset MKL_MOD=
typeset MKL_TARGET_ARCH=
typeset MKLVARS_VERBOSE=
typeset MKL_MIC_ARCH=
typeset MKL_BAD_SWITCH=
typeset OLD_LD_LIBRARY_PATH=
typeset OLD_LIBRARY_PATH=
typeset OLD_MIC_LD_LIBRARY_PATH=
typeset OLD_NLSPATH=
How can I fix that, and what exactly is the problem?

Try this
source /opt/intel/<address>/mklvars.sh
For example, I remember I did,
source /opt/intel/mkl/bin/mklvars.sh intel64
You need to source the environment variables. This should solve your problem. Hope it works !

Related

How to use bpf_probe_read() to copy large length data in EBPF program?

I am trying to dump the contents of the user space buffer in write() system call by running ebpf programs on tracepoint/syscalls/sys_enter_write.
I want to copy data with a maximum length of 1024, so I use BPF_MAP_TYPE_PERCPU_ARRAY to temporarily store the expected data structure, but when reading data through bpf_probe_read, I get an error from the verifier: load program: permission denied: 11: (63) *(u32 *) (r2 +0) = r1: R2 invalid mem access 'inv' (21 line(s) omitted).
kernel: 5.4.119
#include "vmlinux.h"
#include "common.h"
#include "bpf_tracing.h"
#include "bpf_helpers.h"
char __license[] SEC("license") = "Dual MIT/GPL";
struct {
__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
__uint(max_entries, 1);
__type(key, __u32);
__type(value, struct syscall_write_event_t);
} write_buffer_heap SEC(".maps");
struct {
__uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY);
} syscall_write_events SEC(".maps");
#define MAX_MSG_SIZE 1024
// This needs to match exactly with the Go version of the struct.
struct syscall_write_event_t {
struct attr_t {
int event_type;
int fd;
int bytes;
// Care needs to be taken as only msg_size bytes of msg are guaranteed
// to be valid.
int msg_size;
} attr;
char msg[MAX_MSG_SIZE];
};
struct sys_enter_read_write_ctx {
__u64 __unused_syscall_header;
__u32 __unused_syscall_nr;
__u64 fd;
const char * buf;
size_t count;
};
enum {
kEventTypeSyscallAddrEvent = 1,
kEventTypeSyscallWriteEvent = 2,
kEventTypeSyscallCloseEvent = 3,
};
SEC("tracepoint/syscalls/sys_enter_write")
int syscall__probe_write(struct sys_enter_read_write_ctx *ctx) {
int zero = 0;
struct syscall_write_event_t *event = bpf_map_lookup_elem(&write_buffer_heap, &zero);
if (!event) {
return 0;
}
__builtin_memset(&event, 0, sizeof(event));
event->attr.fd = ctx->fd;
event->attr.bytes = ctx->count;
// size_t buf_size = ctx->count < sizeof(event->msg) ? ctx->count : sizeof(event->msg);
// size_t buf_size = ctx->count < 0x400 ? ctx->count : 0x3ff;
size_t buf_size = ctx->count & 0x3ff;
// asm volatile("%[buf_size] &= 0xfff;\n" ::[buf_size] "+r"(buf_size) :);
bpf_probe_read(&event->msg, buf_size, ctx->buf);
event->attr.msg_size = buf_size;
event->attr.event_type = kEventTypeSyscallWriteEvent;
bpf_perf_event_output(ctx, &syscall_write_events, BPF_F_CURRENT_CPU, &event, sizeof(event->attr) + buf_size);
return 0;
}
llvm-objdump -d -S --no-show-raw-insn -l --symbolize-operands syscalls_bpfel_x86.o
sock_bpfel_x86.o: file format elf64-bpf
Disassembly of section tracepoint/syscalls/sys_enter_write:
0000000000000000 <syscall__probe_write>:
; syscall__probe_write():
0: r6 = r1
1: r1 = 0
2: *(u32 *)(r10 - 4) = r1
3: r2 = r10
; syscall_write_events():
4: r2 += -4
5: r1 = 0 ll
7: call 1
8: if r0 == 0 goto +10 <LBB0_2>
9: r1 = *(u64 *)(r6 + 16)
10: r2 = 4
11: *(u32 *)(r2 + 0) = r1
12: r2 = *(u64 *)(r6 + 32)
13: r1 = 8
14: *(u32 *)(r1 + 0) = r2
15: r3 = *(u64 *)(r6 + 24)
16: r2 &= 1023
17: r1 = 16
18: call 4
0000000000000098 <LBB0_2>:
; LBB0_2():
19: r0 = 0
20: exit
verifier log:
func#0 #0
0: R1=ctx(id=0,off=0,imm=0) R10=fp0
; int syscall__probe_write(struct sys_enter_read_write_ctx *ctx) {
0: (bf) r6 = r1
1: R1=ctx(id=0,off=0,imm=0) R6_w=ctx(id=0,off=0,imm=0) R10=fp0
1: (b7) r1 = 0
2: R1_w=inv0 R6_w=ctx(id=0,off=0,imm=0) R10=fp0
; int zero = 0;
2: (63) *(u32 *)(r10 -4) = r1
last_idx 2 first_idx 0
regs=2 stack=0 before 1: (b7) r1 = 0
3: R1_w=invP0 R6_w=ctx(id=0,off=0,imm=0) R10=fp0 fp-8=0000????
3: (bf) r2 = r10
4: R1_w=invP0 R2_w=fp0 R6_w=ctx(id=0,off=0,imm=0) R10=fp0 fp-8=0000????
;
4: (07) r2 += -4
5: R1_w=invP0 R2_w=fp-4 R6_w=ctx(id=0,off=0,imm=0) R10=fp0 fp-8=0000????
; struct syscall_write_event_t *event = bpf_map_lookup_elem(&write_buffer_heap, &zero);
5: (18) r1 = 0xffff888802a72000
7: R1_w=map_ptr(id=0,off=0,ks=4,vs=1040,imm=0) R2_w=fp-4 R6_w=ctx(id=0,off=0,imm=0) R10=fp0 fp-8=0000????
7: (85) call bpf_map_lookup_elem#1
8: R0_w=map_value_or_null(id=1,off=0,ks=4,vs=1040,imm=0) R6_w=ctx(id=0,off=0,imm=0) R10=fp0 fp-8=mmmm????
; if (!event) {
8: (15) if r0 == 0x0 goto pc+10
R0_w=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R6_w=ctx(id=0,off=0,imm=0) R10=fp0 fp-8=mmmm????
9: R0_w=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R6_w=ctx(id=0,off=0,imm=0) R10=fp0 fp-8=mmmm????
; event->attr.fd = ctx->fd;
9: (61) r1 = *(u32 *)(r6 +16)
10: R0_w=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R1_w=inv(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R6_w=ctx(id=0,off=0,imm=0) R10=fp0 fp-8=mmmm????
10: (b7) r2 = 4
11: R0_w=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R1_w=inv(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R2_w=inv4 R6_w=ctx(id=0,off=0,imm=0) R10=fp0 fp-8=mmmm????
; event->attr.fd = ctx->fd;
11: (63) *(u32 *)(r2 +0) = r1
R2 invalid mem access 'inv'
I removed __builtin_memset, then i got invalid stack type R4 off=-24 access_size=1039
SEC("tracepoint/syscalls/sys_enter_write")
int syscall__probe_write(struct sys_enter_read_write_ctx *ctx) {
int zero;
size_t buf_size = ctx->count < 0x400 ? ctx->count : 0x3ff;
asm volatile("%[buf_size] &= 0xfff;\n" ::[buf_size] "+r"(buf_size):);
char *buf;
bpf_probe_read(&buf, sizeof(buf), &ctx->buf);
zero = 0;
struct syscall_write_event_t *event = bpf_map_lookup_elem(&write_buffer_heap, &zero);
if (!event) {
return 0;
}
event->attr.fd = ctx->fd;
event->attr.bytes = ctx->count;
event->attr.msg_size = buf_size;
event->attr.event_type = kEventTypeSyscallWriteEvent;
int size = bpf_probe_read_str(&event->msg, buf_size, buf);
bpf_perf_event_output(ctx, &syscall_write_events, BPF_F_CURRENT_CPU, &event, sizeof(struct syscall_write_event_t)-MAX_MSG_SIZE+size);
return 0;
}
verifier log:
func#0 #0
0: R1=ctx(id=0,off=0,imm=0) R10=fp0
; int syscall__probe_write(struct sys_enter_read_write_ctx *ctx) {
0: (bf) r6 = r1
1: R1=ctx(id=0,off=0,imm=0) R6_w=ctx(id=0,off=0,imm=0) R10=fp0
; size_t buf_size = ctx->count & 0x3ff;
1: (79) r7 = *(u64 *)(r6 +24)
2: R1=ctx(id=0,off=0,imm=0) R6_w=ctx(id=0,off=0,imm=0) R7_w=inv(id=0) R10=fp0
; bpf_probe_read(&buf, sizeof(buf), &ctx->buf);
2: (bf) r3 = r6
3: R1=ctx(id=0,off=0,imm=0) R3_w=ctx(id=0,off=0,imm=0) R6_w=ctx(id=0,off=0,imm=0) R7_w=inv(id=0) R10=fp0
3: (07) r3 += 16
4: R1=ctx(id=0,off=0,imm=0) R3_w=ctx(id=0,off=16,imm=0) R6_w=ctx(id=0,off=0,imm=0) R7_w=inv(id=0) R10=fp0
4: (bf) r1 = r10
5: R1_w=fp0 R3_w=ctx(id=0,off=16,imm=0) R6_w=ctx(id=0,off=0,imm=0) R7_w=inv(id=0) R10=fp0
;
5: (07) r1 += -16
6: R1_w=fp-16 R3_w=ctx(id=0,off=16,imm=0) R6_w=ctx(id=0,off=0,imm=0) R7_w=inv(id=0) R10=fp0
; bpf_probe_read(&buf, sizeof(buf), &ctx->buf);
6: (b7) r2 = 8
7: R1_w=fp-16 R2_w=inv8 R3_w=ctx(id=0,off=16,imm=0) R6_w=ctx(id=0,off=0,imm=0) R7_w=inv(id=0) R10=fp0
7: (85) call bpf_probe_read#4
last_idx 7 first_idx 0
regs=4 stack=0 before 6: (b7) r2 = 8
8: R0_w=inv(id=0) R6_w=ctx(id=0,off=0,imm=0) R7_w=inv(id=0) R10=fp0 fp-16=mmmmmmmm
8: (b7) r1 = 0
9: R0_w=inv(id=0) R1_w=inv0 R6_w=ctx(id=0,off=0,imm=0) R7_w=inv(id=0) R10=fp0 fp-16=mmmmmmmm
; zero = 0;
9: (63) *(u32 *)(r10 -4) = r1
last_idx 9 first_idx 0
regs=2 stack=0 before 8: (b7) r1 = 0
10: R0_w=inv(id=0) R1_w=invP0 R6_w=ctx(id=0,off=0,imm=0) R7_w=inv(id=0) R10=fp0 fp-8=0000???? fp-16=mmmmmmmm
10: (bf) r2 = r10
11: R0_w=inv(id=0) R1_w=invP0 R2_w=fp0 R6_w=ctx(id=0,off=0,imm=0) R7_w=inv(id=0) R10=fp0 fp-8=0000???? fp-16=mmmmmmmm
;
11: (07) r2 += -4
12: R0_w=inv(id=0) R1_w=invP0 R2_w=fp-4 R6_w=ctx(id=0,off=0,imm=0) R7_w=inv(id=0) R10=fp0 fp-8=0000???? fp-16=mmmmmmmm
; struct syscall_write_event_t *event = bpf_map_lookup_elem(&write_buffer_heap, &zero);
12: (18) r1 = 0xffff88880710a200
14: R0_w=inv(id=0) R1_w=map_ptr(id=0,off=0,ks=4,vs=1040,imm=0) R2_w=fp-4 R6_w=ctx(id=0,off=0,imm=0) R7_w=inv(id=0) R10=fp0 fp-8=0000???? fp-16=mmmmmmmm
14: (85) call bpf_map_lookup_elem#1
15: R0=map_value_or_null(id=1,off=0,ks=4,vs=1040,imm=0) R6=ctx(id=0,off=0,imm=0) R7=inv(id=0) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm
; struct syscall_write_event_t *event = bpf_map_lookup_elem(&write_buffer_heap, &zero);
15: (7b) *(u64 *)(r10 -24) = r0
16: R0=map_value_or_null(id=1,off=0,ks=4,vs=1040,imm=0) R6=ctx(id=0,off=0,imm=0) R7=inv(id=0) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value_or_null
; if (!event) {
16: (15) if r0 == 0x0 goto pc+25
R0=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R6=ctx(id=0,off=0,imm=0) R7=inv(id=0) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
17: R0=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R6=ctx(id=0,off=0,imm=0) R7=inv(id=0) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
; event->attr.fd = ctx->fd;
17: (61) r1 = *(u32 *)(r6 +12)
18: R0=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R1_w=inv(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R6=ctx(id=0,off=0,imm=0) R7=inv(id=0) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
; event->attr.fd = ctx->fd;
18: (63) *(u32 *)(r0 +4) = r1
R0=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R1_w=inv(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R6=ctx(id=0,off=0,imm=0) R7=inv(id=0) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
19: R0=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R1_w=inv(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R6=ctx(id=0,off=0,imm=0) R7=inv(id=0) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
; event->attr.bytes = ctx->count;
19: (79) r1 = *(u64 *)(r6 +24)
20: R0=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R1_w=inv(id=0) R6=ctx(id=0,off=0,imm=0) R7=inv(id=0) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
; event->attr.bytes = ctx->count;
20: (63) *(u32 *)(r0 +8) = r1
R0=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R1_w=inv(id=0) R6=ctx(id=0,off=0,imm=0) R7=inv(id=0) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
21: R0=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R1_w=inv(id=0) R6=ctx(id=0,off=0,imm=0) R7=inv(id=0) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
21: (b7) r1 = 2
22: R0=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R1_w=inv2 R6=ctx(id=0,off=0,imm=0) R7=inv(id=0) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
; event->attr.event_type = kEventTypeSyscallWriteEvent;
22: (63) *(u32 *)(r0 +0) = r1
R0=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R1_w=inv2 R6=ctx(id=0,off=0,imm=0) R7=inv(id=0) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
23: R0=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R1_w=inv2 R6=ctx(id=0,off=0,imm=0) R7=inv(id=0) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
; event->attr.msg_size = buf_size;
23: (57) r7 &= 1023
24: R0=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R1_w=inv2 R6=ctx(id=0,off=0,imm=0) R7_w=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
; event->attr.msg_size = buf_size;
24: (63) *(u32 *)(r0 +12) = r7
R0=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R1_w=inv2 R6=ctx(id=0,off=0,imm=0) R7_w=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
25: R0=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R1_w=inv2 R6=ctx(id=0,off=0,imm=0) R7_w=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
; int size = bpf_probe_read_str(&event->msg, buf_size, buf);
25: (79) r3 = *(u64 *)(r10 -16)
26: R0=map_value(id=0,off=0,ks=4,vs=1040,imm=0) R1_w=inv2 R3_w=inv(id=0) R6=ctx(id=0,off=0,imm=0) R7_w=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
; int size = bpf_probe_read_str(&event->msg, buf_size, buf);
26: (07) r0 += 16
27: R0_w=map_value(id=0,off=16,ks=4,vs=1040,imm=0) R1_w=inv2 R3_w=inv(id=0) R6=ctx(id=0,off=0,imm=0) R7_w=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
; int size = bpf_probe_read_str(&event->msg, buf_size, buf);
27: (bf) r1 = r0
28: R0_w=map_value(id=0,off=16,ks=4,vs=1040,imm=0) R1_w=map_value(id=0,off=16,ks=4,vs=1040,imm=0) R3_w=inv(id=0) R6=ctx(id=0,off=0,imm=0) R7_w=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
28: (bf) r2 = r7
29: R0_w=map_value(id=0,off=16,ks=4,vs=1040,imm=0) R1_w=map_value(id=0,off=16,ks=4,vs=1040,imm=0) R2_w=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R3_w=inv(id=0) R6=ctx(id=0,off=0,imm=0) R7_w=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
29: (85) call bpf_probe_read_str#45
R0_w=map_value(id=0,off=16,ks=4,vs=1040,imm=0) R1_w=map_value(id=0,off=16,ks=4,vs=1040,imm=0) R2_w=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R3_w=inv(id=0) R6=ctx(id=0,off=0,imm=0) R7_w=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
R0_w=map_value(id=0,off=16,ks=4,vs=1040,imm=0) R1_w=map_value(id=0,off=16,ks=4,vs=1040,imm=0) R2_w=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R3_w=inv(id=0) R6=ctx(id=0,off=0,imm=0) R7_w=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24_w=map_value
last_idx 29 first_idx 15
regs=4 stack=0 before 28: (bf) r2 = r7
regs=80 stack=0 before 27: (bf) r1 = r0
regs=80 stack=0 before 26: (07) r0 += 16
regs=80 stack=0 before 25: (79) r3 = *(u64 *)(r10 -16)
regs=80 stack=0 before 24: (63) *(u32 *)(r0 +12) = r7
regs=80 stack=0 before 23: (57) r7 &= 1023
regs=80 stack=0 before 22: (63) *(u32 *)(r0 +0) = r1
regs=80 stack=0 before 21: (b7) r1 = 2
regs=80 stack=0 before 20: (63) *(u32 *)(r0 +8) = r1
regs=80 stack=0 before 19: (79) r1 = *(u64 *)(r6 +24)
regs=80 stack=0 before 18: (63) *(u32 *)(r0 +4) = r1
regs=80 stack=0 before 17: (61) r1 = *(u32 *)(r6 +12)
regs=80 stack=0 before 16: (15) if r0 == 0x0 goto pc+25
regs=80 stack=0 before 15: (7b) *(u64 *)(r10 -24) = r0
R0_rw=map_value_or_null(id=1,off=0,ks=4,vs=1040,imm=0) R6_rw=ctx(id=0,off=0,imm=0) R7_rw=invP(id=0) R10=fp0 fp-8=mmmm???? fp-16_r=mmmmmmmm
parent didn't have regs=80 stack=0 marks
last_idx 14 first_idx 0
regs=80 stack=0 before 14: (85) call bpf_map_lookup_elem#1
regs=80 stack=0 before 12: (18) r1 = 0xffff88880710a200
regs=80 stack=0 before 11: (07) r2 += -4
regs=80 stack=0 before 10: (bf) r2 = r10
regs=80 stack=0 before 9: (63) *(u32 *)(r10 -4) = r1
regs=80 stack=0 before 8: (b7) r1 = 0
regs=80 stack=0 before 7: (85) call bpf_probe_read#4
regs=80 stack=0 before 6: (b7) r2 = 8
regs=80 stack=0 before 5: (07) r1 += -16
regs=80 stack=0 before 4: (bf) r1 = r10
regs=80 stack=0 before 3: (07) r3 += 16
regs=80 stack=0 before 2: (bf) r3 = r6
regs=80 stack=0 before 1: (79) r7 = *(u64 *)(r6 +24)
30: R0=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R6=ctx(id=0,off=0,imm=0) R7=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24=map_value
; bpf_perf_event_output(ctx, &syscall_write_events, BPF_F_CURRENT_CPU, &event, sizeof(struct syscall_write_event_t)-MAX_MSG_SIZE+size);
30: (67) r0 <<= 32
31: R0_w=inv(id=0,umax_value=4393751543808,var_off=(0x0; 0x3ff00000000)) R6=ctx(id=0,off=0,imm=0) R7=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24=map_value
31: (c7) r0 s>>= 32
32: R0_w=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R6=ctx(id=0,off=0,imm=0) R7=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24=map_value
; bpf_perf_event_output(ctx, &syscall_write_events, BPF_F_CURRENT_CPU, &event, sizeof(struct syscall_write_event_t)-MAX_MSG_SIZE+size);
32: (07) r0 += 16
33: R0_w=inv(id=0,umin_value=16,umax_value=1039,var_off=(0x0; 0x7ff)) R6=ctx(id=0,off=0,imm=0) R7=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24=map_value
33: (bf) r4 = r10
34: R0_w=inv(id=0,umin_value=16,umax_value=1039,var_off=(0x0; 0x7ff)) R4_w=fp0 R6=ctx(id=0,off=0,imm=0) R7=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24=map_value
;
34: (07) r4 += -24
35: R0_w=inv(id=0,umin_value=16,umax_value=1039,var_off=(0x0; 0x7ff)) R4_w=fp-24 R6=ctx(id=0,off=0,imm=0) R7=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24=map_value
; bpf_perf_event_output(ctx, &syscall_write_events, BPF_F_CURRENT_CPU, &event, sizeof(struct syscall_write_event_t)-MAX_MSG_SIZE+size);
35: (bf) r1 = r6
36: R0_w=inv(id=0,umin_value=16,umax_value=1039,var_off=(0x0; 0x7ff)) R1_w=ctx(id=0,off=0,imm=0) R4_w=fp-24 R6=ctx(id=0,off=0,imm=0) R7=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24=map_value
36: (18) r2 = 0xffff888807109c00
38: R0_w=inv(id=0,umin_value=16,umax_value=1039,var_off=(0x0; 0x7ff)) R1_w=ctx(id=0,off=0,imm=0) R2_w=map_ptr(id=0,off=0,ks=4,vs=4,imm=0) R4_w=fp-24 R6=ctx(id=0,off=0,imm=0) R7=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24=map_value
38: (18) r3 = 0xffffffff
40: R0_w=inv(id=0,umin_value=16,umax_value=1039,var_off=(0x0; 0x7ff)) R1_w=ctx(id=0,off=0,imm=0) R2_w=map_ptr(id=0,off=0,ks=4,vs=4,imm=0) R3_w=inv4294967295 R4_w=fp-24 R6=ctx(id=0,off=0,imm=0) R7=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24=map_value
40: (bf) r5 = r0
41: R0_w=inv(id=0,umin_value=16,umax_value=1039,var_off=(0x0; 0x7ff)) R1_w=ctx(id=0,off=0,imm=0) R2_w=map_ptr(id=0,off=0,ks=4,vs=4,imm=0) R3_w=inv4294967295 R4_w=fp-24 R5_w=inv(id=0,umin_value=16,umax_value=1039,var_off=(0x0; 0x7ff)) R6=ctx(id=0,off=0,imm=0) R7=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24=map_value
41: (85) call bpf_perf_event_output#25
invalid stack type R4 off=-24 access_size=1039
i'm really confused, hope someone can help out, Thanks!
TL;DR. You want to pass a pointer to bpf_perf_event_output, not a pointer to a pointer.
Verifier Error Explanation
41: R0_w=inv(id=0,umin_value=16,umax_value=1039,var_off=(0x0; 0x7ff)) R1_w=ctx(id=0,off=0,imm=0) R2_w=map_ptr(id=0,off=0,ks=4,vs=4,imm=0) R3_w=inv4294967295 R4_w=fp-24 R5_w=inv(id=0,umin_value=16,umax_value=1039,var_off=(0x0; 0x7ff)) R6=ctx(id=0,off=0,imm=0) R7=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff)) R10=fp0 fp-8=mmmm???? fp-16=mmmmmmmm fp-24=map_value
41: (85) call bpf_perf_event_output#25
invalid stack type R4 off=-24 access_size=1039
Here the verifier complains that the fourth argument to bpf_perf_event_output is pointing to the stack with an access size that is way beyond the actual stack size. The fourth argument is &event.
Root Cause
The fourth argument to bpf_perf_event_output should be a pointer to the data to post on the ring buffer. Hence, you want to pass event as the argument, not &event.

Convert subnet mask to cidr notation (Scala)

Here's what I have so far:
//converts IP to a decimal or decimal to IP (working)
private def longToIPv4(ip:Long): String = (for(a<-3 to 0 by -1) yield ((ip>>(a*8))&0xff).toString).mkString(".")
private def IPv4ToLong(ip: String): Long = ip.split("\\.").reverse.zipWithIndex.map(a => a._1.toInt * math.pow(256, a._2).toLong).sum
//convert subnet to cidr (to do)
if(ip.matches("""(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\/(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})""")){
val pattern = """(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\/(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})""".r
val pattern(o1, o2, o3, o4, o5, o6, o7, o8) = ip
}
I'm able to parse the subnet into octets and convert IP to decimal and vice versa, now I just need to convert subnet to cidr notation.
According to your example in the comment, I assumed that the conversions is as elaborated here. I wouldn't do it with regex. You can try something like:
def cidrToSubnet(cidr: Int): String = {
require(cidr > 0, "CIDR is out of range! It must be between 1 (inclusive) to 32 (inclusive).")
require(cidr < 33, "CIDR is out of range! It must be between 1 (inclusive) to 32 (inclusive).")
val ipInInt = if (cidr == 32) (Int.MaxValue << 1) + 1 else Integer.MAX_VALUE << (32 - cidr)
ipInInt
.toBinaryString
.grouped(8)
.map(bitString => Integer.parseInt(bitString, 2))
.mkString(".")
}
def subnetToCidr(subnet: String): Int = {
32 - subnet.split('.')
.map(Integer.parseInt)
.reverse
.zipWithIndex
.map {
case (value, index) =>
value << index * 8
}
.sum
.toBinaryString
.count(_ == '0')
}
Then running:
1.to(32).foreach(i => {
println(i + ": cidrToSubnet(i): " + cidrToSubnet(i) + " subnetToCidr(cidrToSubnet(i): " + subnetToCidr(cidrToSubnet(i)))
})
outputs:
1: cidrToSubnet(i): 128.0.0.0 subnetToCidr(cidrToSubnet(i): 1
2: cidrToSubnet(i): 192.0.0.0 subnetToCidr(cidrToSubnet(i): 2
3: cidrToSubnet(i): 224.0.0.0 subnetToCidr(cidrToSubnet(i): 3
4: cidrToSubnet(i): 240.0.0.0 subnetToCidr(cidrToSubnet(i): 4
5: cidrToSubnet(i): 248.0.0.0 subnetToCidr(cidrToSubnet(i): 5
6: cidrToSubnet(i): 252.0.0.0 subnetToCidr(cidrToSubnet(i): 6
7: cidrToSubnet(i): 254.0.0.0 subnetToCidr(cidrToSubnet(i): 7
8: cidrToSubnet(i): 255.0.0.0 subnetToCidr(cidrToSubnet(i): 8
9: cidrToSubnet(i): 255.128.0.0 subnetToCidr(cidrToSubnet(i): 9
10: cidrToSubnet(i): 255.192.0.0 subnetToCidr(cidrToSubnet(i): 10
11: cidrToSubnet(i): 255.224.0.0 subnetToCidr(cidrToSubnet(i): 11
12: cidrToSubnet(i): 255.240.0.0 subnetToCidr(cidrToSubnet(i): 12
13: cidrToSubnet(i): 255.248.0.0 subnetToCidr(cidrToSubnet(i): 13
14: cidrToSubnet(i): 255.252.0.0 subnetToCidr(cidrToSubnet(i): 14
15: cidrToSubnet(i): 255.254.0.0 subnetToCidr(cidrToSubnet(i): 15
16: cidrToSubnet(i): 255.255.0.0 subnetToCidr(cidrToSubnet(i): 16
17: cidrToSubnet(i): 255.255.128.0 subnetToCidr(cidrToSubnet(i): 17
18: cidrToSubnet(i): 255.255.192.0 subnetToCidr(cidrToSubnet(i): 18
19: cidrToSubnet(i): 255.255.224.0 subnetToCidr(cidrToSubnet(i): 19
20: cidrToSubnet(i): 255.255.240.0 subnetToCidr(cidrToSubnet(i): 20
21: cidrToSubnet(i): 255.255.248.0 subnetToCidr(cidrToSubnet(i): 21
22: cidrToSubnet(i): 255.255.252.0 subnetToCidr(cidrToSubnet(i): 22
23: cidrToSubnet(i): 255.255.254.0 subnetToCidr(cidrToSubnet(i): 23
24: cidrToSubnet(i): 255.255.255.0 subnetToCidr(cidrToSubnet(i): 24
25: cidrToSubnet(i): 255.255.255.128 subnetToCidr(cidrToSubnet(i): 25
26: cidrToSubnet(i): 255.255.255.192 subnetToCidr(cidrToSubnet(i): 26
27: cidrToSubnet(i): 255.255.255.224 subnetToCidr(cidrToSubnet(i): 27
28: cidrToSubnet(i): 255.255.255.240 subnetToCidr(cidrToSubnet(i): 28
29: cidrToSubnet(i): 255.255.255.248 subnetToCidr(cidrToSubnet(i): 29
30: cidrToSubnet(i): 255.255.255.252 subnetToCidr(cidrToSubnet(i): 30
31: cidrToSubnet(i): 255.255.255.254 subnetToCidr(cidrToSubnet(i): 31
32: cidrToSubnet(i): 255.255.255.255 subnetToCidr(cidrToSubnet(i): 32
Code run at Scastie.
To me it looks like you want to convert something like 1.2.3.0/255.255.255.0 to 1.2.3.0/24
With the The IPAddress Java library, it is trivial because it parses address/mask notation and can print addresses in many formats, the default format being CIDR notation. Disclaimer: I am the project manager.
import inet.ipaddr.IPAddressString
def convert(arg: String) {
val ipaddStr = new IPAddressString(arg)
println(ipaddStr.getAddress)
}
convert("1.2.3.0/255.255.255.0")
Output:
1.2.3.0/24

Laravel 5.1 index.php throwing reflection error and could not locate the controller

I am trying to setup my laravel 5.1 project in one of our testing server (LAMP - debian linux, apache 2.4). Copied the entire laravel project from dev machine to testing machine. Did the necessary configuration. We have created a custom controller named loginController. When i try to reach out http://192.168.0.1/index.php i am getting the below error.
My controller looks like -
namespace App\myfolder\Controllers;
use App\Http\Controllers\Controller;
use App\User;
use Validator;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
class LoginController extends Controller
{
use AuthenticatesAndRegistersUsers;
protected $username = 'username';
public function __construct()
{
require app_path() . '/common/constants.php';
}
public function index()
{
return view('myfolder/themes/' . SELECT_THEME . '/login');
}
}
Please someone help.
ReflectionException in Container.php line 741:
Class \App\myfolder\controllers\loginController does not exist
in Container.php line 741
at ReflectionClass->__construct('\App\locumnet\controllers\loginController') in Container.php line 741
at Container->build('\App\locumnet\controllers\loginController', array()) in Container.php line 631
at Container->make('\App\locumnet\controllers\loginController', array()) in Application.php line 674
at Application->make('\App\locumnet\controllers\loginController') in ControllerDispatcher.php line 85
at ControllerDispatcher->makeController('\App\locumnet\controllers\loginController') in ControllerDispatcher.php line 57
at ControllerDispatcher->dispatch(object(Route), object(Request), '\App\locumnet\controllers\loginController', 'index') in Route.php line 203
at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134
at Route->run(object(Request)) in Router.php line 708
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Router.php line 710
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 675
at Router->dispatchToRoute(object(Request)) in Router.php line 635
at Router->dispatch(object(Request)) in Kernel.php line 236
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 50
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 44
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 122
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87
at Kernel->handle(object(Request)) in index.php line 54
I solved the problem. Reason was that my controller name was LoginController.php but routes.php was searching for loginController.php. After changing the first letter to small case it started working.

How to resolve Apple Mach-O Linker Error?

Here is a log
CompileC /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Objects-normal/armv7/iPadNewsbookViewController.o Classes/iPadNewsbookViewController.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/RAGOpoR/Desktop/trunk/src
setenv LANG en_US.US-ASCII
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch armv7 -fmessage-length=0 -std=c99 -fobjc-arc -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wmissing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -DDEBUG_MODE=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -Wprotocol -Wdeprecated-declarations -g -fvisibility=hidden -Wno-conversion -Wno-sign-conversion -mthumb "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -miphoneos-version-min=4.0 -iquote "/Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Hope Demo-generated-files.hmap" "-I/Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Hope Demo-own-target-headers.hmap" "-I/Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Hope Demo-all-target-headers.hmap" -iquote "/Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Hope Demo-project-headers.hmap" -iquote../src -I/Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Products/Debug-iphoneos/include -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/include/libxml2 -I/Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/DerivedSources/armv7 -I/Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/DerivedSources -F/Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Products/Debug-iphoneos -F/Users/RAGOpoR/Desktop/trunk/src -include /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/PrecompiledHeaders/iPortals_Prefix-gellvzrskltxesfcgpqcdmiyeqru/iPortals_Prefix.pch -MMD -MT dependencies -MF /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Objects-normal/armv7/iPadNewsbookViewController.d --serialize-diagnostics /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Objects-normal/armv7/iPadNewsbookViewController.dia -c /Users/RAGOpoR/Desktop/trunk/src/Classes/iPadNewsbookViewController.m -o /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Objects-normal/armv7/iPadNewsbookViewController.o
In file included from /Users/RAGOpoR/Desktop/trunk/src/Classes/iPadNewsbookViewController.m:9:
In file included from /Users/RAGOpoR/Desktop/trunk/src/Classes/iPadNewsbookViewController.h:10:
In file included from /Users/RAGOpoR/Desktop/trunk/src/Classes/WebViewerController.h:10:
In file included from /Users/RAGOpoR/Desktop/trunk/src/Classes/AppDelegate_iPhone.h:12:
/Users/RAGOpoR/Desktop/trunk/src/ShareKit/Reachability/Reachability.h:69:58: warning: declaration of 'struct sockaddr_in' will not be visible outside of this function
+ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress;
^
0 clang 0x000000010cadf6a2 PrintStackTrace(void*) + 34
1 clang 0x000000010cadfb29 SignalHandler(int) + 553
2 libsystem_c.dylib 0x00007fff83d827ea _sigtramp + 26
3 libsystem_c.dylib 0x00007fff6b7b6300 _sigtramp + 18446744073300818736
4 clang 0x000000010c428828 findRetainCycleOwner(clang::Expr*, (anonymous namespace)::RetainCycleOwner&) + 312
5 clang 0x000000010c428b02 clang::Sema::checkRetainCycles(clang::Expr*, clang::Expr*) + 50
6 clang 0x000000010c44d33a clang::Sema::checkPseudoObjectAssignment(clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) + 1242
7 clang 0x000000010bc85e86 clang::Sema::ActOnBinOp(clang::Scope*, clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) + 1606
8 clang 0x000000010bc8507a clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*, true>, clang::prec::Level) + 570
9 clang 0x000000010bc7e4cb clang::Parser::ParseAssignmentExpression() + 171
10 clang 0x000000010bc7e401 clang::Parser::ParseExpression() + 17
11 clang 0x000000010bcd3bde clang::Parser::ParseExprStatement(clang::ParsedAttributes&) + 46
12 clang 0x000000010bc7de9c clang::Parser::ParseStatementOrDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&, bool) + 1564
13 clang 0x000000010bc7d1b9 clang::Parser::ParseCompoundStatementBody(bool) + 409
14 clang 0x000000010c3fb1f0 clang::Parser::ParseLexedObjCMethodDefs(clang::Parser::LexedMethod&) + 272
15 clang 0x000000010bd1f6fe clang::Parser::ParseObjCAtEndDeclaration(clang::SourceRange) + 158
16 clang 0x000000010bcfd0d2 clang::Parser::ParseObjCAtDirectives() + 386
17 clang 0x000000010bc3e887 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::Parser::ParsingDeclSpec*) + 759
18 clang 0x000000010bc3e519 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 249
19 clang 0x000000010bc2128b clang::ParseAST(clang::Sema&, bool) + 299
20 clang 0x000000010bc1fd19 clang::CodeGenAction::ExecuteAction() + 857
21 clang 0x000000010bbf20af clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 879
22 clang 0x000000010bbf0d3b clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2683
23 clang 0x000000010bbe353e cc1_main(char const**, char const**, char const*, void*) + 5086
24 clang 0x000000010bbbdcd8 main + 648
25 clang 0x000000010bbbda44 start + 52
26 clang 0x0000000000000079 start + 18446744069217724009
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -cc1 -triple thumbv7-apple-ios4.0.0 -S -disable-free -disable-llvm-verifier -main-file-name iPadNewsbookViewController.m -pic-level 1 -mdisable-fp-elim -relaxed-aliasing -target-abi apcs-gnu -target-cpu cortex-a8 -mfloat-abi soft -target-feature +soft-float-abi -target-linker-version 131.3 -g -coverage-file /var/folders/2s/0vbgmlf914d3x7m4xjqwdfh80000gp/T/iPadNewsbookViewController-qXtlG9.s -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/4.0 -dependency-file /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Objects-normal/armv7/iPadNewsbookViewController.d -MT dependencies -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -iquote /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Hope Demo-generated-files.hmap -iquote /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Hope Demo-project-headers.hmap -iquote ../src -include-pch /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/PrecompiledHeaders/iPortals_Prefix-gellvzrskltxesfcgpqcdmiyeqru/iPortals_Prefix.pch.pth -D DEBUG_MODE=1 -D IBOutlet=__attribute__((iboutlet)) -D IBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName))) -D IBAction=void)__attribute__((ibaction) -I /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Hope Demo-own-target-headers.hmap -I /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Hope Demo-all-target-headers.hmap -I /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Products/Debug-iphoneos/include -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/include/libxml2 -I /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/DerivedSources/armv7 -I /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/DerivedSources -F/Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Products/Debug-iphoneos -F/Users/RAGOpoR/Desktop/trunk/src -fmodule-cache-path /var/folders/2s/0vbgmlf914d3x7m4xjqwdfh80000gp/T/clang-module-cache -O0 -Wno-trigraphs -Wno-missing-field-initializers -Wmissing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -Wprotocol -Wdeprecated-declarations -Wno-conversion -Wno-sign-conversion -std=c99 -fno-dwarf2-cfi-asm -fno-dwarf-directory-asm -ferror-limit 19 -fmessage-length 0 -fvisibility hidden -fblocks -fobjc-default-synthesize-properties -fobjc-arc -fobjc-exceptions -fexceptions -fsjlj-exceptions -fpascal-strings -fdiagnostics-show-option -serialize-diagnostic-file /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Objects-normal/armv7/iPadNewsbookViewController.dia -o /var/folders/2s/0vbgmlf914d3x7m4xjqwdfh80000gp/T/iPadNewsbookViewController-qXtlG9.s -x objective-c /Users/RAGOpoR/Desktop/trunk/src/Classes/iPadNewsbookViewController.m
1. /Users/RAGOpoR/Desktop/trunk/src/Classes/iPadNewsbookViewController.m:77:60: current parser token ';'
2. /Users/RAGOpoR/Desktop/trunk/src/Classes/iPadNewsbookViewController.m:57:20: in compound statement ('{}')
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
clang: note: diagnostic msg: Please submit a bug report to http://developer.apple.com/bugreporter/ and include command line arguments and all diagnostic information.
clang: note: diagnostic msg: Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/2s/0vbgmlf914d3x7m4xjqwdfh80000gp/T/iPadNewsbookViewController-Q4pbhm.mi
clang: note: diagnostic msg: /var/folders/2s/0vbgmlf914d3x7m4xjqwdfh80000gp/T/iPadNewsbookViewController-Q4pbhm.sh
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 254
If this happens consistently at roughly the same location in your code, then
you seem to have found an internal error in the compiler, i think best way to proceed is to first submit this as a bugreport to apple ( the URL is listed in the output you pasted ).
And then, if you would like to proceed, try to make changes to the code you are trying to compile, like comment out the first half, then retry, then comment out the second half, and retry. This should point to the code causing the internal compiler error.
Sometimes reordering some code will solve the problem for you. So at least you can continue developing.

iPhone/Objective-C - Strange error when passing string to method

I am using http://www.sudzc.com/ to access SOAP Web Services in my iPhone application. I have a method in ASP.NET that takes a string and returns a string (facebook access token to be exact).
This string is the following:
iOCCeM4WGIwBlDxECRFr4AfIEsW598Z4sYjk2uMxsyo.eyJpdiI6IkZPQlN1YWlGNXY0aWs3SmFMWFUwcVEifQ.ITh3ZBGrbgU8DsYWz6d-S4Q1iNlQ8DwKGZB6RZvOkTUpa0VmW7qFS6MO1tkauHoJMFrOlwSrvVuMEO_SQTh8xtR2d0219PPSshiYBHYkjsokSYTuyIaSclVIrL2vh7xH
Every now and then I get an error like the following in my application and I'm not quite sure why. The actual string is a nvarchar(255) field within my database.
This error does not happen all the time. But it has happened quite a few times.
Any help would be greatly appreciated as to how I can fix this issue.
Thanks in advance.
Entity: line 20: parser error : AttValue: " or ' expected
<span><H1>Server Error in '/' Application.<hr width=100% size=1 colo
^
Entity: line 20: parser error : attributes construct error
<span><H1>Server Error in '/' Application.<hr width=100% size=1 colo
^
Entity: line 20: parser error : Couldn't find end of Start Tag hr line 20
<span><H1>Server Error in '/' Application.<hr width=100% size=1 colo
^
Entity: line 31: parser error : AttValue: " or ' expected
<table width=100% bgcolor="#ffffcc">
^
Entity: line 31: parser error : attributes construct error
<table width=100% bgcolor="#ffffcc">
^
Entity: line 31: parser error : Couldn't find end of Start Tag table line 31
<table width=100% bgcolor="#ffffcc">
^
Entity: line 46: parser error : Opening and ending tag mismatch: br line 29 and table
</table>
^
Entity: line 52: parser error : AttValue: " or ' expected
<table width=100% bgcolor="#ffffcc">
^
Entity: line 52: parser error : attributes construct error
<table width=100% bgcolor="#ffffcc">
^
Entity: line 52: parser error : Couldn't find end of Start Tag table line 52
<table width=100% bgcolor="#ffffcc">
^
Entity: line 67: parser error : Opening and ending tag mismatch: br line 50 and table
</table>
^
Entity: line 71: parser error : Opening and ending tag mismatch: br line 69 and body
</body>
^
Entity: line 72: parser error : Opening and ending tag mismatch: br line 50 and html
</html>
^
Entity: line 73: parser error : Premature end of data in tag br line 48
^
Entity: line 73: parser error : Premature end of data in tag br line 29
^
Entity: line 73: parser error : Premature end of data in tag br line 27
^
Entity: line 73: parser error : Premature end of data in tag br line 27
^
Entity: line 73: parser error : Premature end of data in tag font line 24
^
Entity: line 73: parser error : Premature end of data in tag body line 18
^
Entity: line 73: parser error : Premature end of data in tag html line 1
^
2011-05-06 16:15:55.939 MyProject[9206:707] -[NSError AccessToken]: unrecognized selector sent to instance 0x4b87a10
2011-05-06 16:15:56.040 MyProject[9206:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSError AccessToken]: unrecognized selector sent to instance 0x4b87a10'
*** Call stack at first throw:
(
0 CoreFoundation 0x3237064f __exceptionPreprocess + 114
1 libobjc.A.dylib 0x365b3c5d objc_exception_throw + 24
2 CoreFoundation 0x323741bf -[NSObject(NSObject) doesNotRecognizeSelector:] + 102
3 CoreFoundation 0x32373649 ___forwarding___ + 508
4 CoreFoundation 0x322ea180 _CF_forwarding_prep_0 + 48
5 MyProject 0x000093ab -[MyAccountVC handlerGetUserByAccessToken:] + 46
6 CoreFoundation 0x322ddf03 -[NSObject(NSObject) performSelector:withObject:] + 22
7 MyProject 0x00026309 -[SoapRequest handleError:] + 148
8 MyProject 0x00026737 -[SoapRequest connectionDidFinishLoading:] + 254
9 Foundation 0x31f4a2f5 -[NSURLConnection(NSURLConnectionReallyInternal) sendDidFinishLoading] + 68
10 Foundation 0x31f4a277 _NSURLConnectionDidFinishLoading + 78
11 CFNetwork 0x35e71411 _ZN19URLConnectionClient23_clientDidFinishLoadingEPNS_26ClientConnectionEventQueueE + 136
12 CFNetwork 0x35e65f49 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 100
13 CFNetwork 0x35e65e3b _ZN19URLConnectionClient13processEventsEv + 70
14 CFNetwork 0x35e65ded _ZN13URLConnection24multiplexerClientPerformEP18RunLoopMultiplexer + 36
15 CFNetwork 0x35e65d5f _ZN17MultiplexerSource7performEv + 126
16 CFNetwork 0x35e65cdd _ZN17MultiplexerSource8_performEPv + 8
17 CoreFoundation 0x32347a79 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
18 CoreFoundation 0x3234975f __CFRunLoopDoSources0 + 382
19 CoreFoundation 0x3234a4eb __CFRunLoopRun + 230
20 CoreFoundation 0x322daec3 CFRunLoopRunSpecific + 230
21 CoreFoundation 0x322dadcb CFRunLoopRunInMode + 58
22 GraphicsServices 0x3058241f GSEventRunModal + 114
23 GraphicsServices 0x305824cb GSEventRun + 62
24 UIKit 0x35550d69 -[UIApplication _run] + 404
25 UIKit 0x3554e807 UIApplicationMain + 670
26 MyProject 0x00003f73 main + 70
27 MyProject 0x00003f28 start + 40
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
Looks like my web service is down and I'm simply not handling it properly in Objective-C. Hence why it's returning HTML (ASP.NET error page) instead of the string.