Animesh Sahu
04/06/2021, 4:29 AMBig Chungus
04/06/2021, 10:24 PMPeter Hsu
04/07/2021, 4:59 PMCrashed: com.apple.root.utility-qos
SIGABRT ABORT 0x00000001bfed5414
0
libsystem_kernel.dylib
__pthread_kill + 8
1
libsystem_pthread.dylib
pthread_kill + 272
2
libsystem_c.dylib
abort + 104
3
GaiaProgress
ObjHeader::createMetaObject(TypeInfo**) + 4344939580
4
GaiaProgress
TerminateWithUnhandledException + 4344970116
5
GaiaProgress
KonanTerminateHandler() + 4344969660
6
libc++abi.dylib
std::__terminate(void (*)()) + 20
7
libc++abi.dylib
std::terminate() + 44
8
libobjc.A.dylib
_objc_terminate() + 14
9
libdispatch.dylib
_dispatch_client_callout + 40
10
libdispatch.dylib
_dispatch_root_queue_drain + 656
11
libdispatch.dylib
_dispatch_worker_thread2 + 116
12
libsystem_pthread.dylib
_pthread_wqthread + 216
13
libsystem_pthread.dylib
start_wqthread + 8
napperley
04/08/2021, 2:37 AMinternal actual fun combineImageFiles(dirPath: String) {
val appendBinaryMode = "ab"
val readBinaryMode = "rb"
val arena = Arena()
val entries = listDirectory(dirPath).sortedWith(ImageNameComparator())
val videoFile = fopen("$dirPath/video.mjpg", appendBinaryMode)
entries.forEach { e ->
val dataSize = fileSize("$dirPath/$e")
val tmpFile = fopen("$dirPath/$e", readBinaryMode)
val data = arena.allocArray<ByteVar>(dataSize.toInt())
fread(__n = 1, __stream = tmpFile, __ptr = data, __size = dataSize)
fclose(tmpFile)
fwrite(__n = 1, __s = videoFile, __ptr = data, __size = dataSize)
}
arena.clear()
fclose(videoFile)
Unit
}
This snippet works however it is using multiple buffers which isn't ideal. If there are a lot of image files being handled then the memory usage would become excessive.Toby
04/08/2021, 1:27 PMlong ns;
struct timespec spec;
clock_gettime(CLOCK_REALTIME, &spec);
ns = spec.tv_nsec;
I came up with this Kotlin/Native syntax but I can't access the tv_nsec member of the timespec struct and this is the only working code so far:
val spec: CValuesRef<timespec>? = null
clock_gettime(CLOCK_REALTIME, spec)
to actually access the output, I would need the following code (right)?:
var ns: Long
val spec: CValuesRef<timespec>? = null
clock_gettime(CLOCK_REALTIME, spec)
ns = spec.tv_nsec
So, how do I correctly do this?Mohan Babu Malairaj
04/09/2021, 4:43 AMIvan Đorđević
04/09/2021, 8:47 AMGavin Ray
04/12/2021, 1:52 AM@cdecl("name")
or something similar I can use for controlling the name of an exported Kotlin function in a DLL?
I have to create a DLL with a particular entrypoint function name (loaded by name, by a third-party application) and currently the only solution I can think of is to create a wrapper C file like:
__declspec(dllexport) int Entrypoint(_args) {
kotlinmain(_args)
}
napperley
04/12/2021, 4:38 AMException in thread "main" java.lang.Error: /usr/include/jpeglib.h:792:3: error: unknown type name 'size_t'
Below are the contents of the def file:
headers = jpeglib.h
linkerOpts = -ljpeg
linkerOpts.linux_x64 = -L/usr/lib/x86_64-linux-gnu
The following include paths are used in the build file: "/usr/include", "/usr/include/x86_64-linux-gnu"
louiscad
04/12/2021, 9:32 PMnapperley
04/13/2021, 1:54 AMKamilH
04/13/2021, 5:56 AMunsupported call of reified inlined function
? Example in threadeirikb
04/13/2021, 7:20 PMGlen
04/13/2021, 7:22 PMClocks
04/14/2021, 3:28 PMe: /mnt/bulk/SourceCode/git/kotlinx-gtk/nativex/src/nativeMain/kotlin/nativex/glib/Variant.kt: (53, 4): Type mismatch: inferred type is va_list /* = CPointer<platform.posix.__va_list_tag> */ but va_list? /* = CPointer<platform.builtin.__va_list_tag>? */ was expected
Is the error I get, but platform.builtin
has no members I can seeserebit
04/14/2021, 4:56 PMserebit
04/14/2021, 7:13 PMlinux_x64
linker changed from ld.lld to ld.gold in Kotlin v1.5.0?uli
04/14/2021, 7:50 PMA
with an abstract property (a
) and a class B
which overrides property a
.
Now A
lives in the K/N world and I want B
to be @Published
.
I suppose there is no way to express the @Published
annotation in K/N so B
must be written in Swift.
Now Swift does not know about abstract classes and thinks a
was a stored property and complains:
Cannot override with a stored property 'counter'
Do you guys see any way to get a subclass of Kotlin cass A
with @published
property a
?Shabinder Singh
04/15/2021, 7:08 AMserebit
04/15/2021, 4:42 PMankushg
04/15/2021, 10:10 PM@Throws
?
Recently got burned because we forgot to add that annotation to a method and the crashes weren’t even getting sent up to Crashlytics 😅Daniele B
04/16/2021, 9:21 AMMilan Hruban
04/18/2021, 8:37 AMRuntime.getRuntime().addShutdownHook(Thread {
println("shutting down")
})
Victor ADĂSCĂLIȚEI
04/18/2021, 1:08 PMProject 'kotlin-native' not found in root project 'kotlin'
when trying to compile kotlin-native
via
./gradlew :kotlin-native:dist
Anyone also experiencing this? I’m using the latest master commit.Big Chungus
04/19/2021, 4:53 PMultraon
04/20/2021, 8:01 AMntherning
04/20/2021, 8:46 AMimport kotlin.test.Test
import kotlin.test.assertEquals
class Test {
@Test
fun stackOverflowOnRegexReplace() {
val regex = Regex("[a]+")
val input = "a".repeat(10_000)
val output = regex.replace(input, "")
assertEquals("", output)
}
}
The reason is a stack overflow. There is too much recursion in the Regex classes on Kotlin Native, see the condensed call stack below. The crash happens when the input string is about 6300 characters long. On my iPhone 12 it happens much earlier, the input only has to be about 620 characters. I guess it depends on the target arch, optimizations, etc, how deep the call stack is before the crash happens.
Is this a known issue? Or should I report it?
clock_gettime 0x00007fff20081334
std::__1::chrono::steady_clock::now() 0x00007fff202a0d72
konan::getTimeMicros() 0x000000010d2496d9
(anonymous namespace)::garbageCollect(MemoryState*, bool) 0x000000010d213acc
ObjHeader* (anonymous namespace)::allocInstance<true>(TypeInfo const*, ObjHeader**) 0x000000010d21f9aa
kotlin.native.BitSet.<get-asBitCoordinates>#internal BitSet.kt:61
BitSet#get BitSet.kt:344
kotlin.text.regex.CharClass.object-18.contains#internal CharClass.kt:497
AbstractCharClass#contains AbstractCharClass.kt:68
SupplementaryRangeSet#contains SupplementaryRangeSet.kt:127
SupplementaryRangeSet#matches SupplementaryRangeSet.kt:108
GroupQuantifierSet#matches GroupQuantifierSet.kt:75
SupplementaryRangeSet#matches SupplementaryRangeSet.kt:109
GroupQuantifierSet#matches GroupQuantifierSet.kt:75
SupplementaryRangeSet#matches SupplementaryRangeSet.kt:109
GroupQuantifierSet#matches GroupQuantifierSet.kt:75
... (about 10000 repeating lines)
SupplementaryRangeSet#matches SupplementaryRangeSet.kt:109
GroupQuantifierSet#matches GroupQuantifierSet.kt:75
SupplementaryRangeSet#matches SupplementaryRangeSet.kt:109
GroupQuantifierSet#matches GroupQuantifierSet.kt:75
SupplementaryRangeSet#matches SupplementaryRangeSet.kt:109
GroupQuantifierSet#matches GroupQuantifierSet.kt:75
AbstractSet#find AbstractSet.kt:95
AbstractSet#find _Collections.kt:256
AbstractSet#find AbstractSet.kt:95
SingleSet#find SingleSet.kt:46
Regex#find Regex.kt:167
Regex#find$default Regex.kt:160
Regex#replace Regex.kt:242
Regex#replace Regex.kt:234
Test#stackOverflowOnRegexReplace Test.kt:9
$Test$test$0.$stackOverflowOnRegexReplace$FUNCTION_REFERENCE$72.invoke#internal Test.kt:6
$<bridge-UNNN>invoke Test.kt:6
TestCase#run TestSuite.kt:85
kotlin.native.internal.test.TestRunner.run#internal TestRunner.kt:241
kotlin.native.internal.test.TestRunner.run#internal _Collections.kt:1819
kotlin.native.internal.test.TestRunner.run#internal TestRunner.kt:234
kotlin.native.internal.test.TestRunner.runIteration#internal TestRunner.kt:265
kotlin.native.internal.test.TestRunner.runIteration#internal Timing.kt:32
kotlin.native.internal.test.TestRunner.runIteration#internal TestRunner.kt:265
kotlin.native.internal.test.TestRunner.runIteration#internal _Collections.kt:1819
kotlin.native.internal.test.TestRunner.runIteration#internal TestRunner.kt:258
kotlin.native.internal.test.TestRunner.runIteration#internal Timing.kt:32
kotlin.native.internal.test.TestRunner.runIteration#internal TestRunner.kt:257
TestRunner#run TestRunner.kt:280
TestRunner#run Timing.kt:32
TestRunner#run TestRunner.kt:277
test#testLauncherEntryPoint Launcher.kt:22
test#main Launcher.kt:26
Konan_start Launcher.kt:25
Init_and_run_start 0x000000010d08836b
start 0x00007fff2025a3e9
start 0x00007fff2025a3e9
Nikolay Kasyanov
04/22/2021, 2:08 PMiosX64('iosX64').binaries.getByName('debugTest').linkerOpts('-framework Foundation')
but ld
doesn’t seem to like this option:
The difference is that the class is from Foundation (NSURLSessionTaskTransactionMetrics
) and is only available in iOS 10+. At the moment this class is only used in actual code but not in tests.
Btw, is there a way to see full ld
invocations?Deactivated User
04/25/2021, 11:26 AMapahl
04/25/2021, 4:11 PMapahl
04/25/2021, 4:11 PMnapperley
04/25/2021, 9:59 PMandylamax
04/26/2021, 1:58 AMsergey.bogolepov
04/26/2021, 5:03 AMapahl
04/26/2021, 6:51 AMnapperley
04/26/2021, 11:12 PMKamilH
04/27/2021, 4:52 PMBig Chungus
04/27/2021, 5:04 PMnapperley
04/27/2021, 9:35 PMBig Chungus
04/27/2021, 10:03 PM