[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] p.a.n:
The ril subsystem is much more complicated than just rild and some libraries. The daemon itself is pretty simple, just loads the library and calls some functions from it. There is not much space for changes. There are also some daemons which names start with qm (qmuxd, qmux_proxy, some qm client) and kickstart. I managed to start the rild and hopefully all of the qm stuff. There ware some libraries missing among my proprietary files and a complaint about /dev/ttySAC2 being a console, so I removed it from kernel cmdline. Now I have a problem with kickstart, specifically /system/bin/ks. This one is (as I understand it) responsible for loading the modem firmware using protocol called sahara. The problem is that ks segfauls after loading all the images:

12-18 09:31:56.047 4604 4604 I kickstart: EVENT: STATE <-- SAHARA_WAIT_DONE_RESP
12-18 09:31:56.047 4604 4604 I kickstart: EVENT:
12-18 09:31:56.047 4604 4604 I kickstart:
12-18 09:31:56.047 4604 4604 I kickstart: Successfully uploaded all images
12-18 09:31:56.047 4604 4604 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x16 in tid 4604 (ks)
12-18 09:31:56.047 2108 2108 I DEBUG : property debug.db.uid not set; NOT waiting for gdb.
12-18 09:31:56.047 2108 2108 I DEBUG : HINT: adb shell setprop debug.db.uid 100000
12-18 09:31:56.047 2108 2108 I DEBUG : HINT: adb forward tcp:5039 tcp:5039
12-18 09:31:56.152 2108 2108 I SELinux : SELinux: Loaded file_contexts contexts from /file_contexts.
12-18 09:31:56.157 3013 3159 W NativeCrashListener: Couldn't find ProcessRecord for pid 4604
12-18 09:31:56.157 2108 2108 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-18 09:31:56.157 2108 2108 E DEBUG : AM write failed: Broken pipe
12-18 09:31:56.157 2108 2108 F DEBUG : Build fingerprint: 'samsung/m3xx/m3:4.1.2/JZO54K/I9305XXBMA6:user/release-keys'
12-18 09:31:56.157 2108 2108 F DEBUG : Revision: '0'
12-18 09:31:56.157 2108 2108 F DEBUG : ABI: 'arm'
12-18 09:31:56.157 2108 2108 F DEBUG : pid: 4604, tid: 4604, name: ks >>> /system/bin/ks <<<
12-18 09:31:56.157 2108 2108 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x16
12-18 09:31:56.162 2108 2108 F DEBUG : r0 00000016 r1 40242ec0 r2 b1886992 r3 ffffffa8
12-18 09:31:56.162 2108 2108 F DEBUG : r4 be8753f4 r5 00000016 r6 400abf3c r7 40242ec0
12-18 09:31:56.162 2108 2108 F DEBUG : r8 be875464 r9 400a8e61 sl 00000001 fp ffffffff
12-18 09:31:56.162 2108 2108 F DEBUG : ip 4023eac0 sp be8753a0 lr 401e5e4b pc 400a45f8 cpsr 20000030
12-18 09:31:56.167 2108 2108 F DEBUG :
12-18 09:31:56.167 2108 2108 F DEBUG : backtrace:
12-18 09:31:56.167 2108 2108 F DEBUG : #00 pc 000015f8 /system/bin/ks (connect+27)
12-18 09:31:56.167 2108 2108 F DEBUG : #01 pc 0001de47 /system/lib/libc.so (__system_property_set+142)
12-18 09:31:56.167 2108 2108 F DEBUG : #02 pc 000045af /system/bin/ks
12-18 09:31:56.167 2108 2108 F DEBUG : #03 pc 000012f7 /system/bin/ks
12-18 09:31:56.167 2108 2108 F DEBUG : #04 pc 00017399 /system/lib/libc.so (__libc_init+44)
12-18 09:31:56.167 2108 2108 F DEBUG : #05 pc 00000ea0 /system/bin/ks
12-18 09:31:56.252 2108 2108 F DEBUG :
12-18 09:31:56.252 2108 2108 F DEBUG : Tombstone written to: /data/tombstones/tombstone_05

This causes loop in which is the firmware load attempt repeated and the initialization doesn`t proceed. The ks binary is the same as in CM 12.1, where it works, so something external changed. Maybe something in libc or some other library.

In radio logcat I see this message repeating:

12-18 08:12:58.520 2142 2142 D ATD : try to connect RIL
12-18 08:12:58.520 2142 2142 E RILClient: Connect_RILD: Connecting failed. Connection refused(111)
12-18 08:12:58.520 2142 2142 E ATD : connection fail & retry connect(30)
12-18 08:12:58.790 2110 2296 E RIL-QMI : qmi_client [2110]: unable to connect to server, errno=[2:No such file or directory], attempt=34

Another difference which may be related to this is that in CM 12.1 I have /dev/ttyUSB0 and /dev/ttyUSB1, but in CM 13 only /dev/ttyUSB0. Also lsusb gives different results - CM 12.1

Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0001
Bus 001 Device 002: ID 05c6:904c

and CM 13:

Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0001
Bus 001 Device 002: ID 05c6:9008

Notice the last line 904c vs. 9008. But this may not be important, I didn`t dig into this.

Does anyone have this problem? Did anyone solve this?