question on connection between sctp & usrsctp sockets

Recently I'm working on replacing sctp-sockets with usrsctp-sockets.
Client adopts usrsctp-sockets while server remians sctp-sockets.
after bindx() & connectx(), tshark shows:

Capturing on 'eth0'
1   0.000000   <IP_ADDRESS> -> <IP_ADDRESS> SCTP 146 INIT
2   0.000171 <IP_ADDRESS> -> <IP_ADDRESS>   SCTP 370 INIT_ACK
3   0.000208   <IP_ADDRESS> -> <IP_ADDRESS> SCTP 50 ABORT
4   0.001330   <IP_ADDRESS> -> <IP_ADDRESS> SCTP 342 COOKIE_ECHO
5   0.001464 <IP_ADDRESS> -> <IP_ADDRESS>   SCTP 50 COOKIE_ACK

detailed information about the third frame

Frame 3: 50 bytes on wire (400 bits), 50 bytes captured (400 bits) on interface 0
Interface id: 0
Encapsulation type: Ethernet (1)
Arrival Time: Aug 18, 2017 07:00:35.719124000 UTC
[Time shift for this packet: 0.000000000 seconds]
Epoch Time:<PHONE_NUMBER>.719124000 seconds
[Time delta from previous captured frame: 0.000038000 seconds]
[Time delta from previous displayed frame: 0.000038000 seconds]
[Time since reference or first frame: 0.000186000 seconds]
Frame Number: 3
Frame Length: 50 bytes (400 bits)
Capture Length: 50 bytes (400 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ip:sctp]
Ethernet II, Src: 02:42:ac:13:01:02 (02:42:ac:13:01:02), Dst: 02:42:0d:77:65:51 (02:42:0d:77:65:51)
Destination: 02:42:0d:77:65:51 (02:42:0d:77:65:51)
Address: 02:42:0d:77:65:51 (02:42:0d:77:65:51)
.... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Source: 02:42:ac:13:01:02 (02:42:ac:13:01:02)
Address: 02:42:ac:13:01:02 (02:42:ac:13:01:02)
.... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Type: IP (0x0800)
Internet Protocol Version 4, Src: <IP_ADDRESS> (<IP_ADDRESS>), Dst: <IP_ADDRESS> (<IP_ADDRESS>)
Version: 4
Header length: 20 bytes
Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))
0000 00.. = Differentiated Services Codepoint: Default (0x00)
.... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)
Total Length: 36
Identification: 0x0000 (0)
Flags: 0x02 (Don't Fragment)
0... .... = Reserved bit: Not set
.1.. .... = Don't fragment: Set
..0. .... = More fragments: Not set
Fragment offset: 0
Time to live: 64
Protocol: SCTP (132)
Header checksum: 0xdf79 [validation disabled]
[Good: False]
[Bad: False]
Source: <IP_ADDRESS> (<IP_ADDRESS>)
Destination: <IP_ADDRESS> (<IP_ADDRESS>)
[Source GeoIP: Unknown]
[Destination GeoIP: Unknown]
Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)
Source port: 36412
Destination port: 36412
Verification tag: 0x2dcf22d2
Checksum: 0x6b16878e (not verified)
ABORT chunk
Chunk type: ABORT (6)
0... .... = Bit: Stop processing of the packet
.0.. .... = Bit: Do not report
Chunk flags: 0x01
.... ...1 = T-Bit: Tag reflected
Chunk length: 4

I'm wondering is the connection established? Should I use usrsctp-lib at both client & server?
I'm confused about the third frame.

Frame 3 show that you are running native SCTP over IP. The most likely explanation is that you are running multiple SCTP stack on the machine having the IP-address <IP_ADDRESS>. Could it be that you are running there multiple processes with the usrsctp stack or is there in addition to the application running the usrsctp stack also a kernel SCTP stack in the operating system?
The third frame is sent by an SCTP stack not knowing about the association the first frame belongs to, since the T bit is set in the ABORT chunk.

I'm not sure if the problem is at docker container.
To simplify the case, I wrote a simple test program based on the example programs in this project. Server is on bare-metal whose IP is <IP_ADDRESS> while client is in docker container on another host and its IP is <IP_ADDRESS>. Two hosts are connected by a physical switch. I find that the connection cannot be established. Is there something wrong with my code? Because I'm truly new to Internet protocol and socket programming. Also, I tried the programs in this project. I started daytime_server and client just like my test program, which also did not work for me.
When I directly use SCTP, whireshark output

1 0.000000000   <IP_ADDRESS> → <IP_ADDRESS> SCTP 146 INIT
2 0.000091601 <IP_ADDRESS> → <IP_ADDRESS>   SCTP 60 ABORT
3 0.000233056  <IP_ADDRESS> → <IP_ADDRESS>   SCTP 594 INIT_ACK
4 0.000291776   <IP_ADDRESS> → <IP_ADDRESS>  SCTP 50 ABORT

(<IP_ADDRESS> is a bridge on the host.)
When I use udp-encap, wireshark output

1 0.000000000   <IP_ADDRESS> → <IP_ADDRESS> UDP 154 9898 → 3923 Len=112
2 0.000107082 <IP_ADDRESS> → <IP_ADDRESS>   ICMP 182 Destination unreachable (Port unreachable)
3 3.016159299   <IP_ADDRESS> → <IP_ADDRESS> UDP 154 9898 → 3923 Len=112
4 3.016241327 <IP_ADDRESS> → <IP_ADDRESS>   ICMP 182 Destination unreachable (Port unreachable)

But I add -p 9000:9000 when creating docker container.(I have mapped the port)
Below is some key code of my simplified test program.
server

/* create socket */
usrsctp_init(0, NULL, NULL);
listen_sock = usrsctp_socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP, NULL, NULL, 0, NULL);
/* accept any connection from any interface */
bzero((void *)&servaddr, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr = htonl( INADDR_ANY );
servaddr.sin_port = htons("9000");
/* bind & listen & accept */
usrsctp_bind(listen_sock, (struct sockaddr *)&servaddr, sizeof(servaddr));
usrsctp_listen(listen_sock, 5);
while(1) {
printf("Awaiting a new connection\n");
addr_len = 0;
conn_sock = usrsctp_accept(listen_sock, NULL, &addr_len) ;
.........
}

client

usrsctp_init(0, NULL, NULL);
conn_sock = usrsctp_socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP, receive_cb, NULL, 0, NULL);
/* specify endpoint */
bzero((void *)&servaddr, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons("9000");
servaddr.sin_addr.s_addr = inet_addr("<IP_ADDRESS>");
bzero((void *)&cliaddr, sizeof(cliaddr));
cliaddr.sin_family = AF_INET;
cliaddr.sin_port = htons(MY_PORT_NUM);
cliaddr.sin_addr.s_addr = inet_addr("<IP_ADDRESS>");
/* bind & connect */
usrsctp_bind(conn_sock, (struct sockaddr *)&cliaddr, sizeof(struct sockaddr_in);
usrsctp_connect(conn_sock, (struct sockaddr *)&servaddr, sizeof(struct sockaddr_in));

So is there any problems with my code or is there something wrong with docker+usrsctp?
Thank you.

Your code looks correct.
I guess UDP encaps is not working since it is most likely not supported/enabled on the machine having <IP_ADDRESS> as its IP address, especially not on port number 3923.
I guess the system using the IP address <IP_ADDRESS> has a kernel stack. Just don't start your server program there and I guess you will still see the ABORTs being sent.

servaddr.sin_port = htons("9000");

Is your code snippet simplified or is this the real code?

@lgrahl Good catch... The detailed tshark output shows using 36412 as the source and destination port being used on the wire.

@sandylss Never ignore compiler warnings (at least for C and for your own code that is). :smiley_cat:

@lgrahl My fault. The code is servaddr.sin_port = htons(MY_PORT_NUM); Emmmm... Luckily there's no compile warnings.
@tuexen I checked the host having <IP_ADDRESS> as its IP address. Yes there's a kernel stack. My classmate forgot to close it...
Now I have closed the kernel stack and tried again.
tshark output without UDP encapsulation:

1 0.000000000   <IP_ADDRESS> → <IP_ADDRESS> SCTP 154 INIT
2 0.000088027 <IP_ADDRESS> → <IP_ADDRESS>   ICMP 182 Destination unreachable (Port unreachable)
3 3.016226904   <IP_ADDRESS> → <IP_ADDRESS> SCTP 154 INIT
4 3.016309259 <IP_ADDRESS> → <IP_ADDRESS>   ICMP 182 Destination unreachable (Port unreachable)

I can ping from <IP_ADDRESS> to <IP_ADDRESS>
I map the container port 19000 with host port 19000

CONTAINER ID        IMAGE                 COMMAND             CREATED             STATUS              PORTS                                  NAMES
c5be61ccea2d        oai-q7:4.1.0          "/bin/bash"         3 hours ago         Up 3 hours          1-9000/tcp, <IP_ADDRESS>:19000->19000/tcp   usr-oai3

Then I checked iptables.
container & br1

-A POSTROUTING -s <IP_ADDRESS>/32 -d <IP_ADDRESS>/32 -p tcp -m tcp --dport 19000 -j MASQUERADE
-A DOCKER ! -i br1 -p tcp -m tcp --dport 19000 -j DNAT --to-destination <IP_ADDRESS>:19000
-A DOCKER -d <IP_ADDRESS>/32 ! -i br1 -o br1 -p tcp -m tcp --dport 19000 -j ACCEPT

br1 & outside

-A FORWARD -o br1 -j DOCKER
-A FORWARD -o br1 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i br1 ! -o br1 -j ACCEPT
-A FORWARD -i br1 -o br1 -j ACCEPT

So I'm confused again. Why it says port is unreachable?
In usrsctp manual, I notice that UDP encaps may be necessary due to some NAT boxes are not able to process SCTP frame. But Before I replace kernel stack with userspace stack, it works well. So I think UDP-encaps is trivial.
Thank you.

In a .h file, I write #define MY_PORT_NUM 19000

Emmm... Finally I find UDP-encaps is necessary...
tshark output with UDP-encaps

1 0.000000000   <IP_ADDRESS> → <IP_ADDRESS> SCTP 154 INIT
2 0.000250813 <IP_ADDRESS> → <IP_ADDRESS>   SCTP 586 INIT_ACK
3 0.000342699   <IP_ADDRESS> → <IP_ADDRESS> SCTP 438 COOKIE_ECHO
4 0.000541645 <IP_ADDRESS> → <IP_ADDRESS>   SCTP 58 COOKIE_ACK
5 0.000602815   <IP_ADDRESS> → <IP_ADDRESS>  SCTP 98 HEARTBEAT
6 0.000634586 <IP_ADDRESS> → <IP_ADDRESS>   SCTP 98 DATA
7 0.000642574   <IP_ADDRESS> → <IP_ADDRESS>   SCTP 98 HEARTBEAT
8 0.000662959   <IP_ADDRESS> → <IP_ADDRESS>   ICMP 126 Destination unreachable (Port unreachable)
9 0.000682138   <IP_ADDRESS> → <IP_ADDRESS>   SCTP 98 HEARTBEAT

10 0.000704820   <IP_ADDRESS> → <IP_ADDRESS>   SCTP 98 HEARTBEAT
11 0.000716980   <IP_ADDRESS> → <IP_ADDRESS>   ICMP 126 Destination unreachable (Port unreachable)
12 0.000786473   <IP_ADDRESS> → <IP_ADDRESS> SCTP 78 DATA
13 0.000890565 <IP_ADDRESS> → <IP_ADDRESS>   SCTP 62 ABORT

But another segment fault occured. I'll see to it tomorrow... Thank you guys again for your help.

You are using ints as parameters of htons(), not strings, so that is fine.
I see you are using IP tables, but your rules seem to state TCP. I'm not using Linux, so I don't know if IP tables supports SCTP, but I guess if it does you would need to have SCTP specific rules,
An ICMP message Destination Unreachable (Port unreachable) is not a  valid response to an SCTP packet. Valid responses are:

ICMP Destination Unreachable (Protocol unreachable), if the peer does not support SCTP
INIT-ACK if the peer supports SCTP and has a listening port.
ABORT if the peer supports SCTP and has no listening port.

I would be interested in a more verbose trace showing the message exchange.
Regarding you last problem: It might be a problem with embedded addresses. So we would need to see a more verbose tshark dump...

When you map the ports of the container, you can specify the protocol which defaults to TCP, thus your iptables rules are TCP only at the moment. See the Docker manual for details. But I'd not be surprised if they don't support SCTP, so you may have to either fix the iptables rule on the fly or live with UDP encapsulation.

Got it. So I think I will be living with UDP encaps...
And I'm not able to fix the segmentation fault...
Now I'm putting server and client both on bare-metal. Server is on host A whose IP address is <IP_ADDRESS> and client is on host B whose IP address is <IP_ADDRESS>
I bind socket to a certain address and use UDP encaps. Client has a simple call-back function to handle data received from server. The code is almost the same as examples named server.c & daytime_server.c in this project.
server:

bzero((void *)&servaddr, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr = inet_addr("<IP_ADDRESS>");
servaddr.sin_port = htons(MY_PORT_NUM);
usrsctp_bind(listen_sock, (struct sockaddr *)&servaddr, sizeof(servaddr));

/*  a daytime server  /
while(1)
{
/ await a new connection */
printf("Awaiting a new connection\n");
addr_len = 0;
conn_sock = usrsctp_accept(listen_sock, NULL, &addr_len) ;
if(conn_sock  == NULL) {
continue;
}
time(&now);
snprintf(buffer, sizeof(buffer), "%s", ctime(&now));
printf("printf: %s",buffer);
sndinfo.snd_sid = 0;
sndinfo.snd_flags = 0;
sndinfo.snd_ppid = htonl(40);
sndinfo.snd_context = 0;
sndinfo.snd_assoc_id = 0;
usrsctp_sendv(conn_sock, buffer, strlen(buffer), NULL, 0, (void *)&sndinfo,
(socklen_t)sizeof(struct sctp_sndinfo), SCTP_SENDV_SNDINFO, 0);
usrsctp_close( conn_sock );
}

client

/* specify endpoint */

bzero((void *)&servaddr, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons(MY_PORT_NUM);
servaddr.sin_addr.s_addr = inet_addr("<IP_ADDRESS>");
bzero((void *)&cliaddr, sizeof(cliaddr));
cliaddr.sin_family = AF_INET;
cliaddr.sin_port = htons(MY_PORT_NUM);
cliaddr.sin_addr.s_addr = inet_addr("<IP_ADDRESS>");
usrsctp_bind(conn_sock, (struct sockaddr *)&cliaddr, sizeof(struct sockaddr_in))
/* here is call back function at client, just like the one in example programs */
static int receive_cb(struct socket *sock, union sctp_sockstore addr, void *data,
size_t datalen, struct sctp_rcvinfo rcv, int flags, void *ulp_info)
{
if (data == NULL){
done = 1;
usrsctp_close(sock);
} else {
if (write(fileno(stdout), data, datalen) < 0)
printf("write error\n");
free(data);
}
return 1;
}

I get a segmentation fault(core dumped), GDB core file information:

#0  __GI___libc_free (mem=0x80) at malloc.c:2949
#1  0x0000000000400d87 in receive_cb (sock=0x127a6f0,
addr=..., data=0x80, datalen=0, rcv=...,
flags=4197654, ulp_info=0x30000000000)
at sctpclnt.c:24
#2  0x00007f2fcfb8ec13 in sctp_invoke_recv_callback (
inp=0x127a940, stcb=0x127b910,
control=0x7f2fc0013410, inp_read_lock_held=0)
at netinet/sctputil.c:4892
#3  0x00007f2fcfb8f2ff in sctp_add_to_readq (
inp=0x127a940, stcb=0x127b910,
control=0x7f2fc0013410, sb=0x127a7a8, end=1,
inp_read_lock_held=0, so_locked=1)
at netinet/sctputil.c:5000
#4  0x00007f2fcfb0e963 in sctp_queue_data_to_stream (
stcb=0x127b910, asoc=0x127b968,
control=0x7f2fc0013410, abort_flag=0x7f2fce4f89a8,
need_reasm=0x7f2fce4f87d8)
at netinet/sctp_indata.c:583
#5  0x00007f2fcfb141b9 in sctp_process_a_data_chunk (
stcb=0x127b910, asoc=0x127b968, m=0x7f2fc00008c0,
offset=12, chk_length=42, net=0x127c380,
high_tsn=0x7f2fce4f8b18, abort_flag=0x7f2fce4f89a8,
break_flag=0x7f2fce4f89a4, last_chunk=1,
chk_type=0 '\000') at netinet/sctp_indata.c:2143
#6  0x00007f2fcfb159ac in sctp_process_data (
mm=0x7f2fc00008c0, iphlen=0, offset=0x7f2fce4f8b00,
length=56, inp=0x127a940, stcb=0x127b910,
net=0x127c380, high_tsn=0x7f2fce4f8b18)
at netinet/sctp_indata.c:2686
#7  0x00007f2fcfb2fbb2 in sctp_common_input_processing (
---Type  to continue, or q  to quit---
m=0x7f2fc00008c0, iphlen=0, offset=12, length=56, src=0x7f2fce4f8cf0,
dst=0x7f2fce4f8d00, sh=0x7f2fc00009d0, ch=0x7f2fc00009dc, compute_crc=1 '\001',
ecn_bits=0 '\000', vrf_id=0, port=43814) at netinet/sctp_input.c:6195
#8  0x00007f2fcfaf3c3b in recv_function_udp (arg=0x0) at user_recv_thread.c:829
#9  0x00007f2fcf5036ba in start_thread (arg=0x7f2fce4f9700) at pthread_create.c:333
#10 0x00007f2fcf81f82d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

tshark output( have ignored some useless SSDP message)

1 2.155888124  <IP_ADDRESS> → <IP_ADDRESS> SCTP 154 INIT
2 2.156041657 <IP_ADDRESS> → <IP_ADDRESS>  SCTP 474 INIT_ACK
3 2.156115726  <IP_ADDRESS> → <IP_ADDRESS> SCTP 382 COOKIE_ECHO
4 2.156256683 <IP_ADDRESS> → <IP_ADDRESS>  SCTP 60 COOKIE_ACK
5 2.156334799 <IP_ADDRESS> → <IP_ADDRESS>  SCTP 98 DATA
6 3.154875949 <IP_ADDRESS> → <IP_ADDRESS>  SCTP 98 DATA (retransmission)
7 5.165656697 <IP_ADDRESS> → <IP_ADDRESS>  SCTP 98 DATA (retransmission)

a more verbose output of frame DATA

Frame 5: 98 bytes on wire (784 bits), 98 bytes captured (784 bits) on interface 0
Interface id: 0 (eth0)
Encapsulation type: Ethernet (1)
Arrival Time: Aug 26, 2017 14:49:57.440276573 CST
[Time shift for this packet: 0.000000000 seconds]
Epoch Time:<PHONE_NUMBER>.440276573 seconds
[Time delta from previous captured frame: 0.000110311 seconds]
[Time delta from previous displayed frame: 0.000110311 seconds]
[Time since reference or first frame: 0.000573192 seconds]
Frame Number: 5
Frame Length: 98 bytes (784 bits)
Capture Length: 98 bytes (784 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ethertype:ip:udp:sctp:data]
Ethernet II, Src: SuperMic_f5:18:c6 (00:30:48:f5:18:c6), Dst: SuperMic_f2:28:9a (00:30:48:f2:28:9a)
Destination: SuperMic_f2:28:9a (00:30:48:f2:28:9a)
Address: SuperMic_f2:28:9a (00:30:48:f2:28:9a)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Source: SuperMic_f5:18:c6 (00:30:48:f5:18:c6)
Address: SuperMic_f5:18:c6 (00:30:48:f5:18:c6)
.... ..0. 1. = B-Bit: First segment
.... .0.. = U-Bit: Ordered delivery
.... 0... = I-Bit: Possibly delay SACK
Chunk length: 41
Transmission sequence number:<PHONE_NUMBER>
Stream identifier: 0x0000
Stream sequence number: 0
Payload protocol identifier: Daytime (40)
Chunk padding: 000000
Data (25 bytes)
0000  53 61 74 20 41 75 67 20 32 36 20 31 34 3a 34 39   Sat Aug 26 14:49
0010  3a 35 37 20 32 30 31 37 0a                        :57 2017.
Data:<PHONE_NUMBER>75672032362031343a34393a35372032303137...
[Length: 25]

frame DATA(retransmission)

Frame 6: 98 bytes on wire (784 bits), 98 bytes captured (784 bits) on interface 0
Interface id: 0 (eth0)
Encapsulation type: Ethernet (1)
Arrival Time: Aug 26, 2017 14:49:58.435674433 CST
[Time shift for this packet: 0.000000000 seconds]
Epoch Time:<PHONE_NUMBER>.435674433 seconds
[Time delta from previous captured frame: 0.995397860 seconds]
[Time delta from previous displayed frame: 0.995397860 seconds]
[Time since reference or first frame: 0.995971052 seconds]
Frame Number: 6
Frame Length: 98 bytes (784 bits)
Capture Length: 98 bytes (784 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ethertype:ip:udp:sctp]
Ethernet II, Src: SuperMic_f5:18:c6 (00:30:48:f5:18:c6), Dst: SuperMic_f2:28:9a (00:30:48:f2:28:9a)
Destination: SuperMic_f2:28:9a (00:30:48:f2:28:9a)
Address: SuperMic_f2:28:9a (00:30:48:f2:28:9a)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Source: SuperMic_f5:18:c6 (00:30:48:f5:18:c6)
Address: SuperMic_f5:18:c6 (00:30:48:f5:18:c6)
.... ..0. 1. = B-Bit: First segment
.... .0.. = U-Bit: Ordered delivery
.... 0... = I-Bit: Possibly delay SACK
Chunk length: 41
Transmission sequence number:<PHONE_NUMBER>
[This TSN is a retransmission of one in frame: 5]
[Expert Info (Note/Sequence): Retransmitted TSN]
[Retransmitted TSN]
[Severity level: Note]
[Group: Sequence]
[Retransmitted after: 0.995397860 seconds]
Stream identifier: 0x0000
Stream sequence number: 0
Payload protocol identifier: Daytime (40)
Chunk padding: 000000

I guess it's because data was not successfully transmitted? What should I do?

Besides, I tried daytime_server.c & client.c.
I command

./server 9899 9899
./client <IP_ADDRESS> 19000 19000 9899 9899

and get a segmentation fault as well.

Local addresses: <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>.
Peer addresses: <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>.
Segmentation fault

tshark output

3 3.601633591  <IP_ADDRESS> → <IP_ADDRESS> SCTP 210 INIT
4 3.601793692 <IP_ADDRESS> → <IP_ADDRESS>  SCTP 642 INIT_ACK
5 3.601882366  <IP_ADDRESS> → <IP_ADDRESS> SCTP 494 COOKIE_ECHO
6 3.602033783 <IP_ADDRESS> → <IP_ADDRESS>  SCTP 60 COOKIE_ACK
7 3.602081530 <IP_ADDRESS> → <IP_ADDRESS>   SCTP 98 HEARTBEAT
8 3.602100564  <IP_ADDRESS> → <IP_ADDRESS>  SCTP 98 HEARTBEAT
9 3.602135527  <IP_ADDRESS> → <IP_ADDRESS>   SCTP 98 HEARTBEAT

10 3.602180436  <IP_ADDRESS> → <IP_ADDRESS> SCTP 98 HEARTBEAT_ACK
11 3.602196018 <IP_ADDRESS> → <IP_ADDRESS>  SCTP 98 DATA
12 4.559794651 fe80::8c43:408:8e6b:9b23 → ff02::1:3    LLMNR 89 Standard query 0xff79 A npi411029
13 4.559908889  <IP_ADDRESS> → <IP_ADDRESS>  LLMNR 69 Standard query 0xff79 A npi411029
14 4.602928863 <IP_ADDRESS> → <IP_ADDRESS>   SCTP 98 DATA (retransmission)

Kernel problem, I guess?

Let's focus on the application before taking a look at the trace. Can you run the application that segfaults with gdb and take a look at the backtrace? If it doesn't help you, please provide the code (you can attach files here) and the output of backtrace. Information about the OS of client and server would help as well.

rtcweb doesn't call free but http_client does. So, I'm confused about this as well.

@lgrahl I commented free(data) and now it works. Thanks
@tuexen Why do client.c and http_client.c call free() in call-back function? There seems no malloc() before. Thank you

Besides, is it possible to establish connection between kernel stack and userspace stack?

I guess you are referring to https://github.com/sctplab/usrsctp/blob/master/programs/http_client.c#L79.
The usrsctp library allocates memory, copies the user data into it and passes it to the callback. The callback must free it. This allows to decouple the memory management for the library and the user program.
A kernel stack can talk to the userland stack as long as

they run on two different machines
or both stacks use UDP encapsulation and use different UDP encapsulation port numbers. Please note the the only kernel stack suppporting UDP encapsulation is the FreeBSD kernel stack or its derivative, the NKE for Mac OS X. Neither Linux nor Solaris support UDP encapsulation at this point, as far as I know.

The callback must free it.

I think this should be stated in the manual (along with an explanation for the return code).
But if it's required to free, then it doesn't explain the segfault unless @sandylss is double-freeing somewhere in the code.

@lgrahl PR welcome...

This is my code. When I add free() in call-back function, there's a segfault. I don't think I'm double-freeing the memory. It's weird...
And if I use usrsctp_recvv() instead of call-back function, there is continuous data re-transmitting from server to client. Are there any errors in my code?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <usrsctp.h>
#include "common.h"

#define use_cb
#define use_encaps

int done = 0;

static int receive_cb(struct socket *sock, union sctp_sockstore addr, void *data,
                      size_t datalen, struct sctp_rcvinfo rcv, int flags, void *ulp_info)
{
  if (data == NULL){
    done = 1;
    usrsctp_close(sock);
  } else {
	printf("hit\n");
    if (write(fileno(stdout), data, datalen) < 0)
		perror("write");
//  free(data);
  }
  return 1;
}

#define ENCAPS_PORT 9899

int main()
{
  struct socket * conn_sock;
  struct sockaddr_in servaddr,cliaddr;
  char buffer[100];
  int n,ret;
  struct sctp_initmsg initmsg;
  struct sctp_rcvinfo rcvinfo;
  struct sctp_udpencaps encaps;

#ifdef use_encaps
  /* create socket */
  usrsctp_init(9899, NULL, NULL);
#ifdef use_cb
  conn_sock = usrsctp_socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP, receive_cb, NULL, 0, NULL);
#else
  conn_sock = usrsctp_socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP, NULL, NULL, 0, NULL);
#endif
  memset(&encaps, 0, sizeof(struct sctp_udpencaps));
  encaps.sue_address.ss_family = AF_INET;
  encaps.sue_port = htons(ENCAPS_PORT);
  usrsctp_setsockopt(conn_sock, IPPROTO_SCTP, SCTP_REMOTE_UDP_ENCAPS_PORT, (const void *)&encaps, (socklen_t)sizeof(struct sctp_udpencaps));
#else
  usrsctp_init(0, NULL, NULL);
  conn_sock = usrsctp_socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP, receive_cb, NULL, 0, NULL);
#endif

  /* spceify initmsg */
  memset(&initmsg, 0, sizeof(initmsg));
  initmsg.sinit_num_ostreams = 5;
  initmsg.sinit_max_instreams = 5;
  initmsg.sinit_max_attempts = 4;
  ret = usrsctp_setsockopt(conn_sock, IPPROTO_SCTP, SCTP_INITMSG, &initmsg, sizeof(initmsg));

  /* specify endpoint */
  bzero((void *)&servaddr, sizeof(servaddr));
  servaddr.sin_family = AF_INET;
  servaddr.sin_port = htons(MY_PORT_NUM);
  servaddr.sin_addr.s_addr = inet_addr("<IP_ADDRESS>");
  //inet_pton(AF_INET, "<IP_ADDRESS>", &servaddr.sin_addr);

  bzero((void *)&cliaddr, sizeof(cliaddr));
  cliaddr.sin_family = AF_INET;
  cliaddr.sin_port = htons(MY_PORT_NUM);
  cliaddr.sin_addr.s_addr = inet_addr("<IP_ADDRESS>");
  //inet_pton(AF_INET, "<IP_ADDRESS>", &cliaddr.sin_addr);

  if ( usrsctp_bind(conn_sock, (struct sockaddr *)&cliaddr, sizeof(struct sockaddr_in)) < 0 )
  {
    printf("bind error\n");
    usrsctp_close(conn_sock);
    return 0;
  }
  if ( usrsctp_connect(conn_sock, (struct sockaddr *)&servaddr, sizeof(struct sockaddr_in)) < 0 )
  {
    printf("connect error\n");
    usrsctp_close(conn_sock);
    return 0;
  }
  printf("connected\n");

  /* TO DO: try recvv() */
#ifndef use_cb
  socklen_t infolen;
  infolen = (socklen_t)sizeof(struct sctp_rcvinfo);
  unsigned int infotype;
  int flags;
  flags = 0;
  n = usrsctp_recvv(conn_sock, (void *)buffer, (size_t)strlen(buffer), (struct sockaddr *)&servaddr, (socklen_t)sizeof(struct sockaddr_in), (void *)&rcvinfo, &infolen, &infotype, &flags);
  if (n > 0) {
    printf("msg of length %llu received: %s\n",(unsigned long long)n, (char *)buffer);
  }
  else if( n==0 ) printf("received NULL message\n");
  else {
    printf("recvv error\n");
	usrsctp_close(conn_sock);
	return 0;
  }
#endif

  while(!done){ sleep(1); }
  usrsctp_close(conn_sock);
  while (usrsctp_finish() != 0) {
    sleep(1);
  }
  return 0;
}

How did you build the usrsctp library? How do you compile the above example? I'm asking this because you need to specify -DINET and -DINET6 when compiling your example the same way you did when compiling the usrsctp library... If you are getting this wrong, you are not only freeing memory not being allocated, you are also not receiving the correct user data.

I see...
I command
$ ./bootstrap
$ ./configure
$ make
$ sudo make install

to buiild the usrsctp library.
and I command
CC = gcc
CFLAGS = -Wall -g
all:	sctpclnt sctpsrvr
sctpclnt: sctpclnt.o
	$(CC) $(CFLAGS) -o $@ sctpclnt.c -L/usr/lib -lusrsctp
sctpsrvr: sctpsrvr.o
	$(CC) $(CFLAGS) -o $@ sctpsrvr.c -L/usr/lib -lusrsctp

to build the examples...

Use in the examples
CFLAGS = -Wall -g -DINET -DINET6

and than do a clean build of your examples and retest. It might not fix your problem completely, but it fixes a problem you definitely have.

After adding the -DINET -DINET6 flags, I tried daytime_server & client on bare-metal again. It works with UDP encaps but failed without it. And I can't grab any package from tshark.
I noticed that you mentioned

Both programs can either send data over SCTP directly or use UDP encapsulation, thus encapsulating the SCTP packet in a UDP datagram. The first mode works on loopback or in a protected setup without any NAT boxes involved. In all other cases it is better to use UDP encapsulation.

The two hosts are connected by a switch. Does it meet the requirements?
In detail,
./daytime_server 9899 9899
./client <IP_ADDRESS> 18000 18000 9899 9899

works
But
./daytime_server 0
./client <IP_ADDRESS> 18000 18000 0

or
./daytime_server 0 0
./client <IP_ADDRESS> 18000 18000 0 0

fails.
Besides, do you have any examples of a kernel stack talking to an userland stack?

If you want to use SCTP/IP, you need to be root or run them with sudo. Once they are running, you can just use a program running on the kernel stack. That packets on the wire are the same.

hi, tuxen
Actually i'm also testing the SCTP/IP with usrsctp samples. Now i'm using tsctp.
We have two VMs (we tried also two PCs) connected directly by a switch.
In server VM (<IP_ADDRESS>), I typed:

sudo ./tsctp -E 0 -U 0 -n 1 -p 9000 -L <IP_ADDRESS>
In client VM (<IP_ADDRESS>), I typed:
sudo ./tsctp -E 0 -U 0 -n 1 -p 9000 -L <IP_ADDRESS> <IP_ADDRESS>

If I use tshark to capture the packets between these two IPs, the communcation procedure is shown in attached pictures, while the pcap file is also attached(could you help to check what's wrong?)

[sctp_dump.zip](https://github.com/sctplab/usrsctp/files/1273153/sctp_dump.zip)
The debug info in server is:

SCTP: add HMAC id 1 to list
SCTP: added chunk 193 (0xc1) to Auth list
SCTP: added chunk 128 (0x80) to Auth list
Bind called port: 9000
Addr: IPv4 address: <IP_ADDRESS>:9000
Main hash to bind at head:0x1dd2128, bound port:9000 - in tcp_pool=0
recv_function_raw: Received 140 bytes. - calling sctp_common_input_processing with off=32
Ok laddr->ifa:0x1dd6270 is possible, stcb:(nil) inp:0x1dd6d70
stcb is (nil)
Ok, Common input processing called, m:0x7f22080009d0 iphlen:20 offset:32 length:140 stcb:(nil)
sctp_process_control: iphlen=20, offset=32, length=140 stcb:(nil)
Its an INIT of len:106 vtag:0
sctp_process_control: processing a chunk type=1, len=106
SCTP_INIT
sctp_handle_init: handling INIT tcb:(nil)
sctp_handle_init: sending INIT-ACK
Check for unrecognized param's
Hit default param 8004
move on
Select source addr for:IPv4 address: <IP_ADDRESS>:49223
Is destination preferred:IPv4 address: <IP_ADDRESS>:0
src_loop:1 src_priv:0 src_glob:0
dest_loop:0 dest_priv:1 dest_glob:0
NO:4
Is destination preferred:IPv4 address: <IP_ADDRESS>:0
src_loop:0 src_priv:1 src_glob:0
dest_loop:0 dest_priv:1 dest_glob:0
YES
Calling ipv4 output routine from low level src addr:a001e06
Destination is a001e10
RTP route is 0x7f2208014060 through
IP output returns 0
recv_function_raw: Received 36 bytes. - calling sctp_common_input_processing with off=32
Ok laddr->ifa:0x1dd6270 is possible, stcb:(nil) inp:0x1dd6d70
stcb is (nil)
Ok, Common input processing called, m:0x7f2208013b10 iphlen:20 offset:32 length:36 stcb:(nil)
sctp_process_control: iphlen=20, offset=32, length=36 stcb:(nil)
^C

The debug info in client is:

SCTP: add HMAC id 1 to list
SCTP: added chunk 193 (0xc1) to Auth list
SCTP: added chunk 128 (0x80) to Auth list
Bind called port: 0
Addr: IPv4 address: <IP_ADDRESS>:0
Main hash to bind at head:0x55ba301a8e10, bound port:49223 - in tcp_pool=0
Allocate an association for peer:IPv4 address: <IP_ADDRESS>:9000
Port:9000
Adding an address (from:1) to the peer: IPv4 address: <IP_ADDRESS>:9000
Association 0x55ba301ad640 now allocated
Sending INIT
Sending INIT - calls lowlevel_output
Select source addr for:IPv4 address: <IP_ADDRESS>:9000
Is destination preferred:IPv4 address: <IP_ADDRESS>:0
src_loop:0 src_priv:1 src_glob:0
dest_loop:0 dest_priv:1 dest_glob:0
YES
Calling ipv4 output routine from low level src addr:a001e10
Destination is a001e06
RTP route is 0x55ba301ac310 through
IP output returns 0
recv_function_raw: Received 36 bytes. - calling sctp_common_input_processing with off=32
Ok, Common input processing called, m:0x7fc7880009d0 iphlen:20 offset:32 length:36 stcb:0x55ba301ad640
stcb:0x55ba301ad640 state:2
sctp_process_control: iphlen=20, offset=32, length=36 stcb:0x55ba301ad640
sctp_process_control: processing a chunk type=6, len=4
SCTP_ABORT, stcb 0x55ba301ad640
sctp_handle_abort: handling ABORT
usrsctp_connect: Connection refused

It seems the server send "INIT_ACK", while client receive "ABORT" before "INIT_ACK". So I doubt if "ABORT" is sent by tsctp/usrSCTP or other processes?
In the same VMs, we are also trying lksctp, so if I type:

lsmod|grep sctp
I got:
sctp                  258048  2
libcrc32c              16384  2 sctp,raid456
Although i don't think sctp module send 'ABORT', I try to remove it:
sudo rmmod sctp
I got
rmmod: ERROR: Module sctp is in use
While I use 'sudo netstat -l' to check, I got:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 <IP_ADDRESS>:ssh             <IP_ADDRESS>:*               LISTEN
tcp        0      0 localhost:6010          <IP_ADDRESS>:*               LISTEN
tcp        0      0 localhost:6011          <IP_ADDRESS>:*               LISTEN
tcp        0      0 localhost:mysql         <IP_ADDRESS>:*               LISTEN
tcp        0      0 <IP_ADDRESS>:hostmon         <IP_ADDRESS>:*               LISTEN
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN
tcp6       0      0 localhost:6010          [::]:*                  LISTEN
tcp6       0      0 localhost:6011          [::]:*                  LISTEN
tcp6       0      0 [::]:hostmon            [::]:*                  LISTEN
tcp6       0      0 [::]:http               [::]:*                  LISTEN
udp        0      0 localhost:domain        <IP_ADDRESS>:*
udp        0      0 <IP_ADDRESS>:hostmon         <IP_ADDRESS>:*
udp6       0      0 [::]:hostmon            [::]:*
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   Path
unix  2      [ ACC ]     STREAM     LISTENING     25169    /var/run/docker/libcontainerd/docker-containerd.sock
unix  2      [ ACC ]     STREAM     LISTENING     19295    /var/run/dbus/system_bus_socket
unix  2      [ ACC ]     STREAM     LISTENING     19302    /run/acpid.socket
unix  2      [ ACC ]     STREAM     LISTENING     19308    /run/uuidd/request
unix  2      [ ACC ]     STREAM     LISTENING     19311    /run/snapd.socket
unix  2      [ ACC ]     STREAM     LISTENING     19313    /run/snapd-snap.socket
unix  2      [ ACC ]     STREAM     LISTENING     19315    /var/run/docker.sock
unix  2      [ ACC ]     STREAM     LISTENING     16251    /run/systemd/fsck.progress
unix  2      [ ACC ]     STREAM     LISTENING     15743    /run/systemd/private
unix  2      [ ACC ]     STREAM     LISTENING     19317    /var/lib/lxd/unix.socket
unix  2      [ ACC ]     STREAM     LISTENING     15766    /run/lvm/lvmetad.socket
unix  2      [ ACC ]     STREAM     LISTENING     15769    /run/systemd/journal/stdout
unix  2      [ ACC ]     SEQPACKET  LISTENING     15773    /run/udev/control
unix  2      [ ACC ]     STREAM     LISTENING     15775    /run/lvm/lvmpolld.socket
unix  2      [ ACC ]     STREAM     LISTENING     23627    @ISCSIADM_ABSTRACT_NAMESPACE
unix  2      [ ACC ]     STREAM     LISTENING     25290    /var/run/mysqld/mysqld.sock
unix  2      [ ACC ]     STREAM     LISTENING     188384   /run/user/1000/systemd/private
unix  2      [ ACC ]     STREAM     LISTENING     26104    /run/docker/libnetwork/399c1aed5973ff0e287944b333c39ceb2f7a70029c5ea94e343909486fe0d441.sock

Above is all my analyzation, could you help us on that? Thanks!
ZG

The problem is that our machines have the sctp modules loaded. The kernel stacks sends the ABORTs. Ensure that the SCTP modules are NOT loaded. As far as I know, netstat on Linux does not support SCTP (netstat on FreeBSD and Solaris do...).

thanks @tuexen , we resolve the problem with unloading kernel SCTP module.


Sails generate controller with arguments 0.12

sails generate controller Users index create show..  creates new file with error inside
generate model with arg works without problem
module.exports = {
function (obj) {
obj || (obj = {});
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
with (obj) {
need change sails-generate-controller package.json file and set "lodash": "~2.4.0" with >=2.4.x not work
or rewrite module and update all to lodash 4.

Hi @udanpe, do you know what version of sails-generate-controller you have installed?  Also would you please include your version of NPM and node?

<EMAIL_ADDRESS>mac brew npm 3.3.12

= not current. x works. change to ~2.4.0 it's default and work always and also  works ">=2.4.x <2.5.x"
">=2.4.x" as npm install<EMAIL_ADDRESS>load many file with many functions

Thanks @udanpe.  Fixed and published sails-generate-controller v0.10.9.  Easiest way to get it is just to re-install Sails:
npm uninstall -g sails
npm cache clean
npm install -g sails

https://docs.npmjs.com/getting-started/semantic-versioning
Patch releases: 1.0 or 1.0.x or ~1.0.4
Minor releases: 1 or 1.x or ^1.0.4
Major releases: * or x
and else work ">=2.4.0 <2.4.2" (but docs nothing say about this)
">=2.4.x" - install latest version because don't understand syntax.
and when module will be change sails don't work because incorrect syntax
if you change "lodash": "~2.4.1" why not change  "merge-defaults": ">=0.1.0" in this file?)

merge-defaults is a package we maintain, so we know what we're doing ;)


phpPackages.phpinsights: fix build

The old lock was generated with php82, so the php81Packages version was broken. The build errors with the old lock: https://hydra.nixos.org/build/259472196/nixlog/2
Description of changes

Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)

[ ] sandbox = relaxed
[ ] sandbox = true

[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[x] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[x] Tested basic functionality of all binary files (usually in ./result/bin/)
24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[x] Fits CONTRIBUTING.md.

Add a :+1: reaction to pull requests you find important.

@ofborg build php81Packages.phpinsights php82Packages.phpinsights php83Packages.phpinsights


Docs: fix typo

Summary
Typo fix
Test plan

Codecov Report

Merging #3996 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #3996   +/-   ##
=======================================
  Coverage   60.26%   60.26%
=======================================
  Files         196      196
  Lines        6765     6765
  Branches        6        6
=======================================
  Hits         4077     4077
  Misses       2685     2685
  Partials        3        3

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d923293...969f98d. Read the comment docs.


Node2D.global_rotation affected by scale

Godot version: 3.1
OS/device including version: seen on web and Ubuntu 18.04.3 LTS
Issue description: Node2D
Steps to reproduce: Reading and write back to Node2D.global_rotation when a parent node is not evenly scaled (scale.x != scale.y)
Minimal reproduction project: https://gitlab.com/greenfox/global-rotation-vs-scale

https://greenfox.gitlab.io/global-rotation-vs-scale
This link should have a usable demo in about 30minutes

But what difference do you actually get?
I think it's because when using a matrix to do conversions, scale and rotation are overlapping the same cells. So rotation WILL affect cells that relate to scale, but the reason you obtain different scale is probably because of float precision error.

But what difference do you actually get?

The answer to that is in demo I posted.
It probably is a floating point error.

Yeah pretty annoying.
I use scale.x to flip my objects and sprites in my platform game. And I have to check if my rotation save data is round(abs(data["rotation"])) is 180, then hard set it to 0. Then set my scale to Vector2(-1, 1).
Otherwise it would set some crazy rotation and the scale.y to -1... It's gross.

This is a duplicate of  #17405

Closing as duplicate of #17405. I copied the reproduction project there.


Template Updates: DIY

Description
Edits in BOLD are new from April 6, 2021.

Page
Animations
Cosmetics

1
headline updated to fly in; remove background image animation. Issue No text to fly in
combine 'x' shape; change font colors.

2
headline updated to fly in; remove background animation.
change font colors.

3
avatar updated to scale in instead of move/zoom. Quote to fly in
N/A

4
headline updated to fly in; remove background animation.
change font colors.

5
all text updated to fly in. Image/Shape Fade in (3000ms)
combine arrow shape; change color of fonts and rectangle shapes; change background color.

6
Swap plus sign and circle to pulse; headline changed to fly in; remove animations on background image and left band.
combine + shape and change color.

7
text updated to fly in.  Image/Shape Fade in (3000ms)
Change colors of fonts and rectangle shapes; change background color.

8
Headline, text, and images should change to fly in. Tan shape Fade in (3000ms)
Combine arrow shapes; change background color; change font color; change rectangle shape color.

9
Headline change to fly in. Image/Shape Fade in (3000ms)
Combine dot shape; change font color; increate tappable spots.

10
Headline, Text, image change to fly in. Background Shape Fade in (3000ms)
combine social media shapes and change color; change background color; change font and rectangle shape color.

See Figma for specifications: https://www.figma.com/file/NHHMwIfxMnz39NxqkrFb7R/Stories-Post-Stable?node-id=7216%3A549493
If design requests have updated please make note in a comment here so that testing is aware of updated specs.
Acceptance

Template is updated
Relevant stickers are created
No more custom animations

@csossi - had design (@ivayloklissarov ) take a look for visual updates already - so you can focus on any regression/do your qa magic without worrying about figma!

Verified in QA

These were bug bashed by design so i feel like we can close them.


All json all the time

This PR removes the two db modes of normal go mode and json mode. The only mode now is what was called json mode, there is no "mode" nomenclature any more.
Also snuck in an update to better support creating Collections as part of db creation.
The Collection and jsonpatcher apis still take interface{} arguments event though all the data is string and *string. I plan on cleaning that up in the next PR where all methods will explicitly accept and return []byte for json data.

Thanks for the review @jsign. Yea, all that reflect stuff goes away with the removal of interface{} and use of []byte. I have that going on a branch now and it feels good, cleans up the code a lot.


CAMEL-14749: Camel-AWS2: Error configuring AWS2 endpoints behind prox…

…y server
Please review the PR for CAMEL-14749
Thanks,
Saravanakumar

Yes, you're right! :-)

Can you open a similar PR for 3.1.x? Some of the components are missing, because introduce in 3.2.x, but you can do the same for existing ones. Thanks.

Thank you Andrea. I raised PR for 3.1.x branch too.


proposal: testing: allow examples the use of testing.T/B/F for test framework examples

Proposal Details
Today, examples are tests presented alongside godoc as a "func main()" typically, as shown in https://go.dev/blog/examples, and is executable like that.
I'm trying to write examples for a test framework I created (https://github.com/hugelgupf/vmtest) that requires the use of testing.TB. To create an executable example in pkg.go.dev, examples have to be able to take testing.T or testing.B as an argument.
IMO, the existing Example "API" should remain as is. If an example is given a testing.T/B/F argument, though, it should be assumed to require it and be presented that way in the documentation as well, e.g.
func ExampleFunctionname(t *testing.T) {
  t.Logf("foobar")
  // Output: foobar
}

Should appear alongside Functionname in documentation as an executable snippet like this:
package main_test

import (
  "testing"

  "packagepath"
)

func TestExample(t *testing.T) {
    t.Logf("foobar")
}

I wrote a test framework and had this same problem. I usually use example driven development, so this was sort of hard to do for a test framework. I had to make a dummy testing.TB and didn't always work very well.

I think the proposal should be instead to make it easier to make a testing.T/B/F for test purposes. So the code would look like
func ExampleWhatever() {
    result := testing.RunTest(func(t *testing.T) {
        // do stuff with *testing.T
    })
    fmt.Println("Test failed was", result.Failed, "because", result.Output)
    // Output: Test failed was true because error: bad potatoes
}

This could also be used in a TestFunction to test a testing framework more easily.


WIP v4.0.x - Remove legacy python

As per PR #499, we are tracking the RC of v4.0.x on a separate branch.
This PR directs the same changes from PR #443 onto the RC branch.

Closing this as I have rebased the branch rm-2 with branch v4.0.x and pushed @hugovk changes into that branch.


0.19 Release

As discussed in https://github.com/PyO3/pyo3/pull/2593#issuecomment-1548327079 let's put out 0.19 release soon and then make MSRV bump breaking changes to ease the pain with CI.
As usual, list of a few things which I was hoping to round off before the release:

[x] I'd like to finish #2881, as I've had a few people ask me about performance of instance checking (e.g. #3104)
[x] In conversation with @adriangb it was reported that #[pyclass(extends = PyBaseException)] doesn't compile without the unsendable option, though I haven't investigated this (sounds like a bug).
[x] I think PyCell<T> and Py<T> for #[pyclass(frozen)] struct T should have a method to access &T without needing the GIL. I believe this is safe and will help us make progress to nogil / sub-interpreter support (by encouraging use of frozen pyclasses which can then use Rust synchronization mechanisms).
[x] I wanted to add PyNotImplemented, PyEllipsis and PyNone singleton types: https://github.com/PyO3/pyo3/pull/2911#discussion_r1087252466 Parked for now as #3162, see https://github.com/PyO3/pyo3/issues/3154#issuecomment-1553677796
[x] I suggested I would implement #3077, although it may be better to postpone this to 0.20 now (sorry!)
[x] Prevent dropping unsendable classes on other threads #3176
[x] Avoid acquiring the GIL during __traverse__ #3168 #3175

I think PyCell and Py for #[pyclass(frozen)] struct T should have a method to access &T without needing the GIL. I believe this is safe and will help us make progress to nogil / sub-interpreter support (by encouraging use of frozen pyclasses which can then use Rust synchronization mechanisms).

I think this would require an additional T: Send + Sync bound though, wouldn't it? Py<T> is unconditionally Send + Sync and even a #[pyclass(frozen)] could contain types like Rc or RefCell, couldn't it?

Sorry for giving you so many problems. Let me at least look into the PyBassException thing.

I think this would require an additional T: Send + Sync bound though, wouldn't it? Py is unconditionally Send + Sync and even a #[pyclass(frozen)] could contain types like Rc or RefCell, couldn't it?

Good point. I think Sync may be enough to allow &T from multiple threads? The drop requirements for Send are protected by unsendable.

Sorry for giving you so many problems. Let me at least look into the PyBaseException thing.

No problem; I think hopefully that one's not too hard once I see the compiler's full output!

For Ellipsis / None / NotImplemented I've decided I'd prefer not rush to add these now, because fixing #1056 might yet adjust our object model and in the meanwhile we can think about their API. I've left #3162 to remember this for later.

@datatriny I wonder if we think it's possible to release 0.19 with the new license, or whether the final few contributors will take long enough that we should hope to release that with 0.20?

@davidhewitt I would like to nominate including #3165 in this release if solution in #3168 turns out to be workable. Otherwise we might have to wait for another chance for a breaking change before fixing this.
If my understanding of the issue is correct, we should also definitely include #3169 to avoid releasing Py::get and PyCell::get with incorrect trait bounds.

@davidhewitt I've now contacted everyone and will wait two weeks before sending reminders. We'd be lucky if the relicensing is done before the end of June.
So not ready for 0.19 I guess.

If my understanding of the issue is correct, we should also definitely include https://github.com/PyO3/pyo3/pull/3169 to avoid releasing Py::get and PyCell::get with incorrect trait bounds.

So while that one was a dud, I think we should nevertheless include the fix for the unrelated issue #3176 discovered during the discussion.

I think that if tonight's remaining merge trains land, we are ready to create a 0.19 release before the purge the MSRV bump. 🤪

Agreed, I'm happy to cut this tomorrow evening unless you're particularly wanting to do it @adamreichold

Not particularly, I would like to focus on the follow-up NumPy release (admittedly a smaller endeavour, but it would like follow up in a timely manner).


fix: [AAP-23378] add PENDING w/ status text indicating non-runnable reason (i.e., no workers).

This provides the agreed upon usage of PENDING w/ status text containing the specific message:
The workers available to process request type {request_type} for
{process_parent_type} {process_parent_id} are failing liveness checks.
There may be an issue with the node; please contact the administrator.

as distinguishing a request that cannot be run due to complete lack of workers.
The message text above is slightly modified from that documented in AAP-23378 for consistency with other log messages from the processing code.
Orchestrator log messages were updated due to previous change that specifically set the request type if none was specified.

To me that message is contradictory - it implies there are workers available, when in fact they are not responding to liveliness checks, which in essence means they are unavailable.

@ttuffin Updated per our slack convo.

All outstanding issues and critiques have been addressed.

HI @jshimkus-rh I'm finally covered this with https://github.com/ansible/eda-server/pull/894

HI @jshimkus-rh I'm finally covered this with #894

True.  However, I saw that as a stopgap to fixing the regression from #880.

Converted to draft.  To be revisited post next release.


[text_splitter]: Added Semantic text splitter for better performance and more option of splitter to user

text_splitter: Added Semantic text splitter for better performance and more option of splitter to user
Adding SemanticCharacterTextSplitter, SemanticTiktokenTextSplitter
Additional guidelines:

Make sure optional dependencies are imported within a function.
Please do not add dependencies to pyproject.toml files (even optional ones) unless they are required for unit tests.
Most PRs should not touch more than one package.
Changes should be backwards compatible.
If you are adding something to community, do not re-import it in langchain.

If no one reviews your PR within a few days, please @-mention one of baskaryan, efriis, eyurtsev, hwchase17.

could we add some docs that show how these work?

@baskaryan Added helping docs to which explain how it works

lets add this to langchain-community or langchain-experimental. langchain-text-splitters is meant for text splitters we implement, while this is more of an integraiton

@hwchase17  agree . Moved this integration to langchain-community. please review

the notebook needs work. the title needs to reflect the fact that it combines both of them - right now you have two H1s
Theres also just basic stuff that seems wrong. [These notes](https://pypi.org/project/semantic-text-splitter/) from Pinecone provide some useful knowledge about this how it works - why is this linking to pypi package but mentioning Pinecone? Also sorry - does this whole package operate by splitting on \\n\\n\? how is this different from our internal character text splitter then?

Ok @hwchase17 , Sorry That was some copy paste mistake, i have added some more detail about this text splitter. Please review

@hwchase17  Cant able to fix some of the tests,, can you please share logic of these tests,
tests/unit_tests/test_sql_database_schema.py::test_table_info FAILED     [  1%]
tests/unit_tests/test_sql_database_schema.py::test_sql_database_run FAILED [  1%]
Not sure these are related to this..

@hwchase17  Please review if this can be merged?

@hwchase17 Can you please review if this can be merged? Resolved all the review comments.

@baskaryan  any suggestion on this? if this can be merged?

Hi @baskaryan  any suggestion on this? can you please review this, if this can be merged. all the review comments in incorporated and document also updated at correct place .
Thanks


CreateSnapshot command can not parse SnapshotSize parameter if greater than 2Gb

I'm trying to create a snapshot from a pre-signed bucket URL.
When running in verbose mode, if I set the SnapshotSize parameter to more than<PHONE_NUMBER> I get either negative sizes or no value at all.
It seems you are using a 16bits parsing while snapshot sizes should probably be encoded as 32bit int.
The old osc-cli and the cockpit interfaces do not have that restriction and happily parse bigger values. My target value was 8Gb =<PHONE_NUMBER> bytes.

Hello,
thanks for reporting the issue.
I'm using int, which are 32 bit, but signed, so they overflow after 2 GB.
Anyway, I'm changing them to long long int asap.

Indeed it was signed 32 bits and not 16 bits I was a bit confused.
I just tested the snapshot build and it works as expected. Thanks for the quick fix!


You can move bedrock with create

It is possible to move bedrock with the create mod.
I've only tested with rope pully and the create piston and both were able to move the block.
I hope it is a simple issue that we can just use the block modification kjs event to add the tag #forge:immovable

 engineersmith_4628 on Discord says

pending/contributors/code

How did we make the delivery table immovable? I don't see a tag or something

I see this
        event.modify("wares:delivery_table", block => {
            block.destroySpeed = -1;
            block.explosionResistance = 3600000;
        })

 engineersmith_4628 on Discord says

I think it doesn't move because it is a block entity that create doesn't understand

 yarden.zamir on Discord says

there must be a way to stop it though


Please update to FontAwesome 5.1.1

Please update the current version of FontAwesome (5.0.8) to 5.1.1

Duplicate of https://github.com/Semantic-Org/Semantic-UI/issues/6395


Better definition for locking strategy

As it said before, the lock prevents changes directly to the locked branch, and a pull request can change a branch locked, so the change made here is just to put things more clear.

@RobertoBorges : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@apawast Could you review this pull request? Thanks.


close all files keeps recreating "untitled"

File/close all does not work. It asks if you want to save "untitled4.py" as it has been modified. You say no and it automatically creates "untitled5.py" and asks if you want to save this.....and so on forever.

Please update to Spyder 2.3.7. This was fixed in version 2.3.6 :-)


feat(goreleaser): Add release version info for goreleaser

What this PR does / why we need it:
Add your description
Which issue(s) this PR is related to (optional, link to 3rd issue(s)):
Fixes https://github.com/kleveross/ormb/issues/82
Reference to #

Special notes for your reviewer:
/cc @gaocegege

Release note:

NONE

ping @gaocegege


Error in TSP solver

May I get some help?
I installed or-tools and source code of or-tools-master in accordance with https://developers.google.com/optimization/introduction/installing.
And I typed "make test" in or-tools-master directory.
I got error described below.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:        16.04
Python ver 3.5.2
..................
,,,,,
In Refute
sum([0, 2, 4, 6, 8]) = 20
sum([0, 2, 4, 6, 8]) = 20
cd dependencies/sources/protobuf-3.3.0/java &&
../../../install/bin/protoc --java_out=core/src/main/java -I../src
../src/google/protobuf/descriptor.proto
cd dependencies/sources/protobuf-3.3.0/java/core/src/main/java && jar cvf ../../../../../../../install/lib/protobuf.jar com/google/protobuf/*java
/bin/sh: 1: jar: not found
makefiles/Makefile.third_party.unix.mk:246: recipe for target 'dependencies/install/lib/protobuf.jar'
make: *** [dependencies/install/lib/protobuf.jar] error 127
..................
I can't understand what is shortage.
Please give me tips. Thanks.

can you print the result of 'make printport'
seems java is not correctly installed. It cannot find the jar executable.
Laurent Perron | Operations Research |<EMAIL_ADDRESS>| (33) 1 42 68 53
00
2017-09-23 18:24 GMT+02:00 zenrshon<EMAIL_ADDRESS>
May I get some help?
I installed or-tools and source code of or-tools-master in accordance with
https://developers.google.com/optimization/introduction/installing.
And I typed "make test" in or-tools-master directory.
I got error described below.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Python ver 3.5.2
..................
,,,,,
In Refute
sum([0, 2, 4, 6, 8]) = 20
sum([0, 2, 4, 6, 8]) = 20
cd dependencies/sources/protobuf-3.3.0/java &&
../../../install/bin/protoc --java_out=core/src/main/java -I../src
../src/google/protobuf/descriptor.proto
cd dependencies/sources/protobuf-3.3.0/java/core/src/main/java && jar cvf
../../../../../../../install/lib/protobuf.jar com/google/protobuf/*java
/bin/sh: 1: jar: not found
makefiles/Makefile.third_party.unix.mk:246: recipe for target
'dependencies/install/lib/protobuf.jar'
make: *** [dependencies/install/lib/protobuf.jar] error 127
..................
I can't understand what is shortage.
Please give me tips. Thanks.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/google/or-tools/issues/488, or mute the thread
https://github.com/notifications/unsubscribe-auth/AKj17QHsOF5wPW2o2fhn5uVKDG-ak-Ysks5slTDQgaJpZM4Phmjj
.

Thank you for answer.
I typed it and get below.

$ make print port
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
SHELL = /bin/sh
OR_TOOLS_TOP = /home/user/or-tools-master
SYSTEM = unix
PLATFORM = LINUX
PTRLENGTH = 64
GIT_REVISION = 0
GIT_HASH =
PORT = Ubuntu-16.04-64bit
OR_TOOLS_VERSION = 6.4.0
OR_TOOLS_SHORT_VERSION = 6.4
PATH_TO_CSHARP_COMPILER =
DETECTED_PYTHON_VERSION = 2.7
JDK_DIRECTORY = /usr/lib/jvm/java-8-openjdk-amd64
I want to use or-tools by C++ and Python.
Should I install java?
Thanks.

No, but don't run make test but make test_cc test_python
and instead of make all, run make cc python
Laurent Perron | Operations Research |<EMAIL_ADDRESS>| (33) 1 42 68 53
00
2017-09-24 8:10 GMT+02:00 zenrshon<EMAIL_ADDRESS>
Thank you for answer.
I typed it and get below.
$ make print port
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
SHELL = /bin/sh
OR_TOOLS_TOP = /home/user/or-tools-master
SYSTEM = unix
PLATFORM = LINUX
PTRLENGTH = 64
GIT_REVISION = 0
GIT_HASH =
PORT = Ubuntu-16.04-64bit
OR_TOOLS_VERSION = 6.4.0
OR_TOOLS_SHORT_VERSION = 6.4
PATH_TO_CSHARP_COMPILER =
DETECTED_PYTHON_VERSION = 2.7
JDK_DIRECTORY = /usr/lib/jvm/java-8-openjdk-amd64
I want to use or-tools by C++ and Python.
Should I install java?
Thanks.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/google/or-tools/issues/488#issuecomment-331689788,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKj17dwyWvUJgJi_hXO9_H5Uc0Oy-K3Vks5slfJagaJpZM4Phmjj
.

Thank you for reply.
I re-installed or-tools-master and typed "make cc python" after "make third-party".
But, I get same error when I typed "make test".
I can not use "make test" without "make all"?
In this case, how to use this solver?
Sorry for rudimentary questions.
Thanks.

make test test everything, type make test_cc test_python
Laurent Perron | Operations Research |<EMAIL_ADDRESS>| (33) 1 42 68 53
00
2017-09-25 6:39 GMT+02:00 zenrshon<EMAIL_ADDRESS>
Thank you for reply.
I re-installed or-tools-master and typed "make cc python" after "make
third-party".
But, I get same error when I typed "make test".
I can not use "make test" without "make all"?
In this case, how to use this solver?
Sorry for rudimentary questions.
Thanks.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/google/or-tools/issues/488#issuecomment-331775389,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKj17Q7JXu7L4it07InEPAXu3Y1Hu-iFks5sly56gaJpZM4Phmjj
.

Tried it.
And success!
Thank you very much!! :)


[commonjs--resolver] data URI with non-JavaScript mime type is not supported.

Don't know why...

Thanks for your feedback. I can't get enough information from the error message to identify the source of the exception. Can you provide a minimal reproducible version?

emmm...maybe i caught the error

This plugin didn't support base64 string to be embedded in style files.

And when I remove base64 and continue building, this error occurs

I still don't know why 😭

emmm...maybe i caught the error  This plugin didn't support base64 string to be embedded in style files.

@emosheeep I'll look into this issue soon.

emmm...maybe i caught the error  This plugin didn't support base64 string to be embedded in style files.

@emosheeep In the latest v0.5.7, the issue you encountered has been resolved.

Sounds wonderful. I'll try tomorrow.

And when I remove base64 and continue building, this error occurs

This is my config

I still don't know why 😭

Now the problem became this....

@emosheeep I'll try to reproduce the issue, identify its cause, and fix it if possible.

Thanks a lot！🫶

@emosheeep Sorry for the delayed response. I was failed to reproduce this issue. Can you provide a minimal reproducible version?

My project import katex css
import 'katex/dist/katex.min.css';

and include font assets:
export const KNOWN_ASSET_TYPES = [
  // fonts
  'woff2?',
  'eot',
  'ttf',
  'otf',
]

export const DEFAULT_ASSETS_RE = new RegExp(
  `\\.(` + KNOWN_ASSET_TYPES.join('|') + `)(\\?.*)?$`,
);

// config options
libAssets({
  name: '[name].[contenthash:8].[ext]?[query]',
  include: DEFAULT_ASSETS_RE
})

have same error:

seems some error occured in getAssetContent
content = fs.readFileSync(pureId);

when the pureId is a relative path，content will be null

@showonne Thanks for your feedback. With your guidance, I've successfully replicated the issue. Now, I'll try to find the cause and resolving it.

@emosheeep After testing, I found that vite-plugin-svelte also has a similar issue. The reason is that when using preprocessCSS (internally using postcss) to concatenate files, the URL addresses in the imported files are not updated to the relative path of the entry file.
There is also an issue in the Vite repository similar to the mentioned problem.
I plan to use sourcemaps to complete this update and will soon create a demo to confirm its effectiveness.

@emosheeep I just released version v0.5.13-beta.0, hoping it can solve the issues you encountered.

I got this error

@emosheeep It seems that we have overcome the most difficult part, and now this issue appears to be a omission from the previous PR fix.

@emosheeep I just released version v0.5.13-beta.1, I think it will solve the problem shown in picture you encountered.

Cool, the plugin works finally!


Unable to Install

Unable to Install React Page using npm i @react-page/react-page
throwing the following error :
npm ERR! code E404
npm ERR! 404 Not Found<EMAIL_ADDRESS>npm ERR!      /Users/ksborra/.npm/_logs/2020-01-31T09_55_32_597Z-debug.log

Nope, Seeing the same issue,
npm WARN<EMAIL_ADDRESS>requires a peer of<EMAIL_ADDRESS>but none is installed. You must install peer dependencies yourself.
npm WARN<EMAIL_ADDRESS>requires a peer of<EMAIL_ADDRESS>but none is installed. You must install peer dependencies yourself.
npm WARN<EMAIL_ADDRESS>requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm ERR! code E404
npm ERR! 404 Not Found<EMAIL_ADDRESS>npm ERR!      /Users/ksborra/.npm/_logs/2020-02-03T09_36_25_269Z-debug.log

@macrozone Now I am getting Following error
npm ERR! code E403
npm ERR! 403 Requested item is quarantined<EMAIL_ADDRESS>

@Hellboyksr2 it seems you using a proxy in your npmrc.
https://stackoverflow.com/questions/48270514/facing-requested-item-is-quarantined-sockjs0-3-18-while-doing-npm-install

@Hellboyksr2 could you solve this problem?

@macrozone Yup seems it was a proxy issue. Thanks for your quick help.


Extension doesn't work properly in this site

https://elchapuzasinformatico.com/
Slow down my browser and I must deactivate it

Yes, looks like this website it too heavy to be processed.
You can disable Midnight Lizard just on this website by pressing Alt+Shift+L
You can also try to change processing mode. Simplified mode works much better there:


[Request]add language  houdini VEX

I need highlightjs to highlighting those languages.

Please see our policy on language requests:
https://highlightjs.readthedocs.io/en/latest/language-requests.html


Update NodeJS runtimes and packages to latest

Updates NodeJS6 to LTS for 6.x (today 6.9.1)
Updates NodeJS0.12 to <IP_ADDRESS> to pick up a security fix
Updates NPM Packages to latest versions (for nodejs6)
Add some popular NPM packages (for nodejs6)

winston (MIT)
underscore (MIT)
uuid (MIT)
validator (MIT)
redis (MIT)
marked (MIT)
glob (ISC)

Pinned the versions of npm packages for that the proxy server since it was using "^x.x.x"

log4js needs to remain 0.x since 1.x doesn't support nodejs 0.12 and our proxy is share for now

PG1 911 running...

@matthewmccullough PG2 637 blue

@markusthoemmes PG2 637 blue


cx_sy_itab_line_not_found

I'm trying to implement Advent of Code in ABAP and use also the transpiler to run it in Node.JS. But already with part 2 of day 1 I run into an issue. My implementation zcl_advent2020_day01_gw.clas.abap#L69 runs fine on a ABAP AS but results in the following error when using npm test:
ZCL_ADVENT2020_DAY01_GW: running ltcl_test->part2

<ref *1> cx_sy_itab_line_not_found [Error]
    at zcl_advent2020_day01_gw.part2 (file:///Users/gwolf/Documents/projects/abap/abap-advent-2021/output/zcl_advent2020_day01_gw.clas.mjs:107:22)
    at async ltcl_test.part2 (file:///Users/gwolf/Documents/projects/abap/abap-advent-2021/output/zcl_advent2020_day01_gw.clas.testclasses.mjs:22:19)
    at async run (file:///Users/gwolf/Documents/projects/abap/abap-advent-2021/output/index.mjs:36:3) {
  me: ABAPObject { value: [Circular *1] },
  previous: ABAPObject { value: undefined },
  textid: Character { value: '', length: 32, qualifiedName: 'undefined' },
  get_longtext: [AsyncFunction: if_message$get_longtext],
  get_text: [AsyncFunction: if_message$get_text]
}

when debugging the generated JavaScript code i see the value of abap.builtin.sy.get().tabix changing during the for loop. I think the error is somewhere there.

probably the read table, ints[ sy-tabix + 1 ] which changes tabix
workaround: try moving sy-tabix to a temporary variable

That helped: https://github.com/gregorwolf/abap-advent-2021/runs/4423582159?check_suite_focus=true

also, there is a folder with the downported code, can you paste it here?

Before the change:
CLASS zcl_advent2020_day01_gw DEFINITION
  PUBLIC
  FINAL
  CREATE PUBLIC .

  PUBLIC SECTION.

    INTERFACES zif_advent2020_gw.
    METHODS:
      part1
        IMPORTING
          !input        TYPE string
        RETURNING
          VALUE(output) TYPE string,
      part2
        IMPORTING
          !input        TYPE string
        RETURNING
          VALUE(output) TYPE string.
  PROTECTED SECTION.
  PRIVATE SECTION.
    METHODS:
      input_to_ints
        IMPORTING
          !input      TYPE string
        RETURNING
          VALUE(ints) TYPE ty_ints.
ENDCLASS.

CLASS zcl_advent2020_day01_gw IMPLEMENTATION.

  METHOD zif_advent2020_gw~solve.

    output = part2( input ).

  ENDMETHOD.

  METHOD input_to_ints.
    DATA lt_strings TYPE STANDARD TABLE OF string WITH DEFAULT KEY.
    FIELD-SYMBOLS <string> LIKE LINE OF lt_strings.
    FIELD-SYMBOLS <int> TYPE int4.
    SPLIT input AT |\n| INTO TABLE lt_strings.

    LOOP AT lt_strings ASSIGNING <string>.

      APPEND INITIAL LINE TO ints ASSIGNING <int>.
      <int> = <string>.
    ENDLOOP.

  ENDMETHOD.

  METHOD part1.
    DATA out_int TYPE int4.

    DATA ints TYPE ty_ints.
    FIELD-SYMBOLS <int> LIKE LINE OF ints.
    DATA temp1 LIKE LINE OF ints.
    ints = input_to_ints( input ).

    LOOP AT ints ASSIGNING <int>.
      IF sy-tabix > 1.

        READ TABLE ints INDEX sy-tabix - 1 INTO temp1.
        IF sy-subrc <> 0.
          RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
        ENDIF.
        IF <int> > temp1.
          out_int = out_int + 1.
        ENDIF.
      ENDIF.
    ENDLOOP.

    output = out_int.
    CONDENSE output.

  ENDMETHOD.

  METHOD part2.
    DATA: out_int            TYPE int4.

    DATA ints TYPE ty_ints.
    DATA number_of_ints TYPE i.
    FIELD-SYMBOLS <int> LIKE LINE OF ints.
    DATA sum_first_window TYPE int4.
    DATA temp1 LIKE LINE OF ints.
    DATA temp3 LIKE LINE OF ints.
    DATA sum_second_window TYPE int4.
    DATA temp2 LIKE LINE OF ints.
    DATA temp4 LIKE LINE OF ints.
    DATA temp5 LIKE LINE OF ints.
    ints = input_to_ints( input ).

    number_of_ints = lines( ints ).
    IF number_of_ints < 4.
      WRITE / 'input does contain less than 4 lines so there is nothing to compare'.
      RETURN.
    ENDIF.

    LOOP AT ints ASSIGNING <int>.
      IF sy-tabix + 3 > number_of_ints.
        EXIT.
      ENDIF.

      READ TABLE ints INDEX sy-tabix + 1 INTO temp1.
      IF sy-subrc <> 0.
        RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
      ENDIF.

      READ TABLE ints INDEX sy-tabix + 2 INTO temp3.
      IF sy-subrc <> 0.
        RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
      ENDIF.
      sum_first_window = <int> + temp1 + temp3.

      READ TABLE ints INDEX sy-tabix + 1 INTO temp2.
      IF sy-subrc <> 0.
        RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
      ENDIF.

      READ TABLE ints INDEX sy-tabix + 2 INTO temp4.
      IF sy-subrc <> 0.
        RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
      ENDIF.

      READ TABLE ints INDEX sy-tabix + 3 INTO temp5.
      IF sy-subrc <> 0.
        RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
      ENDIF.
      sum_second_window = temp2 + temp4 + temp5.
      IF sum_first_window < sum_second_window.
        out_int = out_int + 1.
      ENDIF.
    ENDLOOP.

    output = out_int.
    CONDENSE output.

  ENDMETHOD.

ENDCLASS.

After:
CLASS zcl_advent2020_day01_gw DEFINITION
  PUBLIC
  FINAL
  CREATE PUBLIC .

  PUBLIC SECTION.

    INTERFACES zif_advent2020_gw.
    METHODS:
      part1
        IMPORTING
          !input        TYPE string
        RETURNING
          VALUE(output) TYPE string,
      part2
        IMPORTING
          !input        TYPE string
        RETURNING
          VALUE(output) TYPE string.
  PROTECTED SECTION.
  PRIVATE SECTION.
    METHODS:
      input_to_ints
        IMPORTING
          !input      TYPE string
        RETURNING
          VALUE(ints) TYPE ty_ints.
ENDCLASS.

CLASS zcl_advent2020_day01_gw IMPLEMENTATION.

  METHOD zif_advent2020_gw~solve.

    output = part2( input ).

  ENDMETHOD.

  METHOD input_to_ints.
    DATA lt_strings TYPE STANDARD TABLE OF string WITH DEFAULT KEY.
    FIELD-SYMBOLS <string> LIKE LINE OF lt_strings.
    FIELD-SYMBOLS <int> TYPE int4.
    SPLIT input AT |\n| INTO TABLE lt_strings.

    LOOP AT lt_strings ASSIGNING <string>.

      APPEND INITIAL LINE TO ints ASSIGNING <int>.
      <int> = <string>.
    ENDLOOP.

  ENDMETHOD.

  METHOD part1.
    DATA out_int TYPE int4.

    DATA ints TYPE ty_ints.
    FIELD-SYMBOLS <int> LIKE LINE OF ints.
    DATA temp1 LIKE LINE OF ints.
    ints = input_to_ints( input ).

    LOOP AT ints ASSIGNING <int>.
      IF sy-tabix > 1.

        READ TABLE ints INDEX sy-tabix - 1 INTO temp1.
        IF sy-subrc <> 0.
          RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
        ENDIF.
        IF <int> > temp1.
          out_int = out_int + 1.
        ENDIF.
      ENDIF.
    ENDLOOP.

    output = out_int.
    CONDENSE output.

  ENDMETHOD.

  METHOD part2.
    DATA: out_int            TYPE int4.

    DATA ints TYPE ty_ints.
    DATA number_of_ints TYPE i.
    FIELD-SYMBOLS <int> LIKE LINE OF ints.
    DATA tabix LIKE sy-tabix.
    DATA sum_first_window TYPE int4.
    DATA temp1 LIKE LINE OF ints.
    DATA temp3 LIKE LINE OF ints.
    DATA sum_second_window TYPE int4.
    DATA temp2 LIKE LINE OF ints.
    DATA temp4 LIKE LINE OF ints.
    DATA temp5 LIKE LINE OF ints.
    ints = input_to_ints( input ).

    number_of_ints = lines( ints ).
    IF number_of_ints < 4.
      WRITE / 'input does contain less than 4 lines so there is nothing to compare'.
      RETURN.
    ENDIF.

    LOOP AT ints ASSIGNING <int>.

      tabix = sy-tabix.
      IF sy-tabix + 3 > number_of_ints.
        EXIT.
      ENDIF.

      READ TABLE ints INDEX tabix + 1 INTO temp1.
      IF sy-subrc <> 0.
        RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
      ENDIF.

      READ TABLE ints INDEX tabix + 2 INTO temp3.
      IF sy-subrc <> 0.
        RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
      ENDIF.
      sum_first_window = <int> + temp1 + temp3.

      READ TABLE ints INDEX tabix + 1 INTO temp2.
      IF sy-subrc <> 0.
        RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
      ENDIF.

      READ TABLE ints INDEX tabix + 2 INTO temp4.
      IF sy-subrc <> 0.
        RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
      ENDIF.

      READ TABLE ints INDEX tabix + 3 INTO temp5.
      IF sy-subrc <> 0.
        RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
      ENDIF.
      sum_second_window = temp2 + temp4 + temp5.
      IF sum_first_window < sum_second_window.
        out_int = out_int + 1.
      ENDIF.
    ENDLOOP.

    output = out_int.
    CONDENSE output.

  ENDMETHOD.

ENDCLASS.


[Event Request] Report 297 "Batch Post Sales Invoices" - OnBeforeSalesBatchPostMgt

Hi Microsoft AL Development Team,
Could you please add an integration event for OnBeforeSalesBatchPostMgt to the OnPreDataItem trigger of report 297 "Batch Post Sales Invoices"?

Thank you!
Kind regards,
Tuan Nguyen

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.


Rendering problem with nested Apps in Component Containers

OpenUI5 version: all
Browser/version (+device/version): all
Any other tested browsers/devices(OK/FAIL):
URL (minimal example if possible):
Running Application Example:
https://0emilgasanov.github.io/nested_apps/webapp/index.html
Source Code:
https://github.com/0EmilGasanov/nested_apps
Steps to reproduce the problem:

Using Object Page Sections / Subsection / Blocks
Main App calling Nested Apps to display content
Nested Apps loaded in Blocks each

What is the expected result?
Proper display of Sections/Subsections/Blocks
What happens instead?
Each Block is taking 100% height space and overlapping / pushing out the following contents.
Any other information? (attach screenshot if possible)

@0EmilGasanov The issue is in the used structure.
sap.m.App should be used only once without nested sap.m.App, because it is a container that adjusts the content. If you replace it, just for the test, with sap.m.VBox (items collection), blocks will follow each other without overlapping and sizing individually based on the view port

Thank you for the response.
I understand that it comes from nested sap.m.App's. Is there any other solution for having a main App containing nested, fully functional standalone Apps?

@0EmilGasanov There was a similar issue to which <NavContainer> was suggested as an alternative for the child <App>. Would that help?

We haven't tested the . The Solution we found was to refer directly to the Main.view  instead of the App and also setting Main as root view.


SIT mods incompatible with latest release

hello, just wanted to inform that to get mods such as SAIN to work, you have to downgrade to StayInTarkov.Client-1.10.8854.18454
https://github.com/stayintarkov/SIT.Manager.Avalonia/releases/tag/2.2.2404.2719

We are aware, mods are just in a bit of an odd place at the moment. You'll find up to date versions of the currently ported mods in the discord while things get sorted out.


Restore assumes "1.0.0" version for P2P that calculates its version by build

Repro steps

Create two .netstandard libraries: A and B with a common solution directory.
Add the solution to git source control and commit.
Add reference from B to A
Install Nerdbank.GitVersioning package to both
Add a version.json file to the solution folder with content: { "version": "0.1-beta" }
Commit all changes to git.
Run a package restore on the solution and pack both projects.

Expected
The B nuget package references A package by its version (e.g. 0.1.2-beta)
Actual
The B nuget package references A package by a non-existent version 1.0.0
d15rtwsvc 26228.4
Blocked by NuGet/Home#4790

Hacky workaround: add this to the referenced project:
  <Target Name="FixUpVersion" BeforeTargets="_GenerateRestoreProjectSpec"
      DependsOnTargets="GetBuildVersion" />
  <ImportGroup Condition=" '$(ExcludeRestorePackageImports)' == 'true' ">
    <Import Project="$(UserProfile)\.nuget\packages\nerdbank.gitversioning\1.6.19-beta\buildCrossTargeting\Nerdbank.GitVersioning.targets"
            Condition="Exists('$(UserProfile)\.nuget\packages\nerdbank.gitversioning\1.6.19-beta\buildCrossTargeting\Nerdbank.GitVersioning.targets')" />
  </ImportGroup>

That's nasty, bit I'll give it a shot

Just applied the hack here: https://github.com/Reactive-Extensions/Rx.NET/blob/14287b166479f770408b6f760b71b942a7fb99ef/Rx.NET/Source/Directory.build.props#L38-L50
Soooo gross.

Note, MSBuild 15.6 broke the workaround. It interestingly enough works again if you update to the latest version of NB.GV (2.1.23). I'm not sure what changed between 1.6.25 and 2.1.23 to make the workaround effective on 15.6 agents, but everyone should update!

@AArnott I believe 15.6 includes the new functionality added in https://github.com/NuGet/NuGet.Client/pull/1915 and https://github.com/AArnott/Nerdbank.GitVersioning/pull/161, so you shouldn't need the workaround any more.

Oh ya, good point. That is probably why the upgrade fixes it. By leaving the workaround in place in the referencing project, it should work properly in 15.5 and 15.6 (Appveyor still has 15.5 from what I can tell).
It's too bad that in the fix in 15.6, they broke the workaround.

No workaround is required with VS 2017 Update 6 (Dev15.6) as they've fixed the issue and NB.GV has adapted to leverage the new feature.
Just make sure you're on NB.GV 2.1.23 or later.


Bug of Skill api "move_to"

Hi~
Thanks for amazing work!
And I got a bug (maybe not) when using the "move_to" api like:
Skill `move_to 45 5` failed: No valid path found to reach position (45, 5)

Is this a bug or not? Will adding the search operation to move_to fix this bug?

Hey,
Happy to hear that you like my work!
The move_to skill does not explore the level. It is mainly intended for more fine-grained movement. If there is no known path to a location, the skill will fail and report this with the message you've seen. If you want to explore, I would recommend using the explore_level skill.
Note that a skill failing is not an error unless it tells you that an exception occurred. A failed skill usually means what you want to do is not possible with that skill, and the resulting messages are used as feedback for the LLM agent.
The search skill is just a thin wrapper around the search command in NetHack. So, it is used to find hidden walls/doors/traps, etc.

Hey, Happy to hear that you like my work!
The move_to skill does not explore the level. It is mainly intended for more fine-grained movement. If there is no known path to a location, the skill will fail and report this with the message you've seen. If you want to explore, I would recommend using the explore_level skill.
Note that a skill failing is not an error unless it tells you that an exception occurred. A failed skill usually means what you want to do is not possible with that skill, and the resulting messages are used as feedback for the LLM agent.
The search skill is just a thin wrapper around the search command in NetHack. So, it is used to find hidden walls/doors/traps, etc.

I see. Thank you for your answer~


autopause for local media

I remember, that MediaElement.js for example has this built in. Is there a specific reason, why this is just supported for Vimeo videos?
I would love to see autopause for local / self hosted media, too.

I have been using the above code by @Hrishikesh-K to stop other active audio players when the next one is started.
It works fine still 3 years later, but for some reason it does not work for Video (whether local, Youtube, Vimeo or anything else).
Is there some method that will work to stop all other video players when another is started?

I'm currently not actively using Plyr (or any video players for that matter), but that piece of code should still work (even though I had written in back in my days as a beginner). Do you have a reproduction where it doesn't? Happy to debug a bit.

Thank you @Hrishikesh-K (or anyone else who can explain how to do this by any method)
Here is a small self contained example with two videos and with your code. They do not stop each other from running. What am I doing wrong?
<!DOCTYPE html>

  <title>Tester</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link<EMAIL_ADDRESS>rel="stylesheet">

The problem is because, you're query selecting audio and video tags:
Array.prototype.slice.apply(document.querySelectorAll('audio,video'))

However, you're adding the video using iframe tag:

I don't think the contents of iframe would get selected in the top-level document's querySelector. If you instead use a standard video tag, it should work. Or you might have to select the video tag from the iframe's body.

Thank you for reorienting my stupidity @Hrishikesh-K. Yes.


How to return error from onAfterUpload method to client

Hello!
I am using your package.
On client side, after I start upload I have handlers:
            uploadInstance.on('end', function (error, fileObj)
            uploadInstance.on('error', function (error, fileObj)

And on server side I have method onAfterUpload - inside this method there is a case, when I wan't to return error to client and see it in parameter ERROR in its handles, but I don't know how to do this ans didn't found solution on your wiki

I tried to return false
I tried to return some text

Nothing of it I see on the client.
Thanks

Hello @koblents ,
Not possible, as onAfterUpload is triggered asynchronously after upload is successfully finished.
Please describe your case in details, what are you trying to accomplish?

@koblents you can update file doc in onAfterUpload with status/error of the file processing.
On the client you can subscribe to file doc and observe changes to monitor after upload progress.
I used that approach to notify client when file processing (thumb creation + anti virus scanning) is completed.

+1 for method suggested by @vbelolapotkov
We use the same approach in our demo app, listening for generated thumbs availability, see code here, you can use any other property in the same way.

Hello @koblents ,
Have you solved it?

No, I didn't, because in my logic, if I have some error inside onAfterUpload - I immediately delete file and mongoDB row - and with it I don't know how to tell client about it.

@koblents inside onAfterUpload hook add deleted or error property, if any of those props exists on the file's record show error message and hide them. Then set Mongo's TTL Index, file's record will be automatically removed upon expiration. See this tutorial.
See similar approach used in our demo app and very important comment here
Let me know if it helped you.

thanks @dr-dimitru I don't really like this solution, because it seems to complicated, can confuse users and also can reflect more issues.
But anyway I think we can close this issue - you gave me few solutions and if it will become critical for me, I will use one of them.
Thanks

Feel free to reopen it in case if the issue still persists on your end.
Please, support this project by:

Star on GitHub
Star on Atmosphere
Check other packages we have made


Set specific version for DinD image

We define a specific version to our DinD base image. We currently avoid the latest version of DinD beceause there are currently some issue with on GitLab Shared Runners.

issue on GitLab shared runners: https://gitlab.com/gitlab-com/gl-infra/production/-/issues/17283


[azeventhubs] Last of the renames (for now!)

Making the last few name changes that came out of arch board reviews + discussions with Jeff
Fixing bug where you couldn't cancel the timeout associated with retries.

Fixes #19217

/azp run go - azeventhubs