2024-03-30
00:05linuxgemini9 has quit []
00:34CME_ has quit [Ping timeout: 480 seconds]
00:36CME has joined #asahi-dev
00:37psykose has joined #asahi-dev
00:44glem7 has joined #asahi-dev
00:46timokrgr has joined #asahi-dev
00:47glem has quit [Ping timeout: 480 seconds]
00:47glem7 is now known as glem
01:31chadmed_ has quit [Remote host closed the connection]
01:35zzywysm has joined #asahi-dev
01:40jeisom has joined #asahi-dev
01:41jeisom has quit [Remote host closed the connection]
01:43jeisom has joined #asahi-dev
01:44Bertrand___ has quit [Ping timeout: 480 seconds]
01:45Bertrand___ has joined #asahi-dev
01:45xal has joined #asahi-dev
01:54jeisom has quit [Remote host closed the connection]
01:55jeisom has joined #asahi-dev
01:56linuxgemini9 has joined #asahi-dev
01:56linuxgemini9 has quit []
01:59linuxgemini9 has joined #asahi-dev
02:00KxCORP5 has quit [Quit: Bye!]
02:00KxCORP5 has joined #asahi-dev
02:11jeisom has quit [Remote host closed the connection]
02:13jeisom has joined #asahi-dev
02:20Emantor has quit [Quit: ZNC - http://znc.in]
02:21Emantor has joined #asahi-dev
02:35jeisom has quit [Remote host closed the connection]
02:36jeisom has joined #asahi-dev
02:38jeisom has quit [Remote host closed the connection]
03:02Bertrand___ has quit [Ping timeout: 480 seconds]
03:03Bertrand___ has joined #asahi-dev
03:04chadmed_ has joined #asahi-dev
03:10capta1nt0ad has quit [Remote host closed the connection]
03:11capta1nt0ad has joined #asahi-dev
03:44capta1nt0ad has quit [Ping timeout: 480 seconds]
04:13capta1nt0ad has joined #asahi-dev
04:15capta1nt0ad has quit [Remote host closed the connection]
04:17capta1nt0ad has joined #asahi-dev
04:17JayBeeFOSS has quit [Remote host closed the connection]
04:18JayBeeFOSS has joined #asahi-dev
04:29VeeBop has quit [Quit: buh bye]
04:31VeeBop has joined #asahi-dev
04:48capta1nt0ad has quit [Ping timeout: 480 seconds]
05:02tristan2_ has joined #asahi-dev
05:04tristan2 has quit [Ping timeout: 480 seconds]
05:08Bertrand___ has quit [Ping timeout: 480 seconds]
05:14psykose has quit [Remote host closed the connection]
05:44wyes has joined #asahi-dev
06:10wyes has quit [Remote host closed the connection]
06:17Bertrand___ has joined #asahi-dev
07:19hspak416327 has quit []
07:20hspak416327 has joined #asahi-dev
07:35chadmed_ugh i have the flu and my brain has stopped working. can someone look at https://gitlab.freedesktop.org/chadmed/wireplumber/-/tree/sw-dsp/from-disk?ref_type=heads and tell me why the call to wp_properties_get() in e179d136 specifically causes a segfault
07:36chadmed_for context upstream want the disk loading api implemented in a very specific (and imo silly) way and this is necessary based on suggestions made in MR 628
07:36chadmed_and if we dont have this fixed by approximately now then its not going to make it into a release before fedora 40 drops
07:37chadmed_its just this one call, the commits above it make their calls to wp_properties_get() just fine
07:44i509vcb has quit [Quit: Connection closed for inactivity]
08:11mixichadmed_: not sure about why the 5db7a43a one segfaults, but you are not assigning to as_section in 02786b712d02
08:40aleasto has quit [Quit: ZNC 1.8.2 - https://znc.in]
08:41aleasto has joined #asahi-dev
10:31chaos_princess has quit [Quit: chaos_princess]
10:32chaos_princess has joined #asahi-dev
10:46leiodoesn't as_section leak now in some cases? Though only if wp_properties_get returns something that needs freeing and I don't know which it is
10:49leioif that is true, you could make it a g_autoptr and then go through g_steal_pointer when passing it on to section.name
10:51PaulFertser has quit [Ping timeout: 480 seconds]
10:53leiothough some no_frags case in the same file that's used the same doesn't concern itself about it either, so I guess it might be fine in your case too?
10:56jeisom has joined #asahi-dev
10:57leiowp_spa_json_parse_string is (transfer full), so that path does own it; so if section gets deallocated, it frees the strict that the underlying hashmap in wp_properties stuff owns
10:57jeisom has quit [Remote host closed the connection]
11:01jeisom has joined #asahi-dev
11:06chadmedthe original function also just assigns a string to section.name via wp_spa_json_parse_string(tmp)
11:16leiochadmed: the thing is that wpa_spa_json_parse_string gives you a char* that the caller will own (transfer full), while wp_properties_get gives you a string that you do not own (transfer none)
11:17leiootherwise you'll have a UAF (use after free) down the line when the section you made gets deleted and the wp_properties stuff accesses it, or e.g. properties get reloaded and the section is accessed
11:17leiotl;dr: I think you need `section.name = as_section ? g_strdup (as_section) : wp_spa_json_parse_string (tmp);`
11:24chadmedthe issue there is that without guarding behind if (as_section) it will try to parse the first token as a key then look for a value off that key
11:25chadmedthe idea is to not do that, and parse the entire file as a value with a specified key name in WpProperties
11:25leioand I assume it crashed before because you g_autoptr as_section while wp_properties_get doesn't hand a string that you own
11:27leiosad thing that "(transfer full)", "(transfer none)" and so on doc markup doesn't really help with anything much in C side beyond being able to see it as a documentation to know what to do with it in C, but they are used to make bindings memory safe at least
11:34jeisom has quit [Remote host closed the connection]
12:10jeisom has joined #asahi-dev
12:19jeisom_ has joined #asahi-dev
12:20nyaomixyz has joined #asahi-dev
12:26jeisom has quit [Ping timeout: 480 seconds]
12:28jlco has quit []
12:29jlco has joined #asahi-dev
12:31opticron has quit [Ping timeout: 480 seconds]
12:53nyaomixyz has quit [Ping timeout: 480 seconds]
12:56chadmedhttps://gitlab.freedesktop.org/chadmed/wireplumber/-/tree/sw-dsp/from-disk?ref_type=heads okay this branch works
12:57chadmedthe one thing left is wrangling the lua api: https://gitlab.freedesktop.org/chadmed/wireplumber/-/blob/sw-dsp/from-disk/modules/module-lua-scripting/api/api.c?ref_type=heads#L1640
12:58chadmedfor some reason we can retrieve the named section as a parsed string value successfully, but trying to return it via push_luajson() causes it to misbehave
12:59chadmedwhile this doesnt matter for our use case since we need it to be a string anyway, it's not a very good general use API
13:02nyaomixyz has joined #asahi-dev
13:11mixi has quit [Quit: quit]
13:13mixi has joined #asahi-dev
13:23Tramtrist has quit [Remote host closed the connection]
13:25Tramtrist has joined #asahi-dev
13:37opticron has joined #asahi-dev
14:00Tramtrist has quit [Remote host closed the connection]
14:37Leo3418 has quit [Quit: Applying updates]
14:37Leo3418 has joined #asahi-dev
17:34Bertrand___ has quit [Read error: Connection reset by peer]
17:34Bertrand___ has joined #asahi-dev
17:44Mary has quit [Quit: The Lounge - https://thelounge.chat]
17:45Mary has joined #asahi-dev
17:53nyaomixyz has quit [Quit: Konversation terminated!]
18:16Bertrand___ has quit [Ping timeout: 480 seconds]
18:16___nick___ has joined #asahi-dev
18:17Bertrand___ has joined #asahi-dev
18:21flom84 has joined #asahi-dev
18:21flom84 has quit [Remote host closed the connection]
18:22Mary has quit [Quit: The Lounge - https://thelounge.chat]
18:24Mary has joined #asahi-dev
18:37___nick___ has quit [Ping timeout: 480 seconds]
18:51ellyq has quit []
19:43lena6 has quit [Remote host closed the connection]
19:47psykose has joined #asahi-dev
20:04al3xtjames has joined #asahi-dev
20:06linuxgemini9 has quit []
20:15al3xtjames has quit [Quit: al3xtjames]
20:19ellyq has joined #asahi-dev
20:20Bertrand___ has quit [Ping timeout: 480 seconds]
20:20Bertrand___ has joined #asahi-dev
20:42linuxgemini9 has joined #asahi-dev
20:49___nick___ has joined #asahi-dev
20:49___nick___ has quit []
20:51___nick___ has joined #asahi-dev
21:04___nick___ has quit [Ping timeout: 480 seconds]
21:09Bertrand___ has quit [Ping timeout: 480 seconds]
21:17Bertrand___ has joined #asahi-dev
21:30darkapex1 has quit [Remote host closed the connection]
21:31darkapex1 has joined #asahi-dev
21:37jeisom__ has joined #asahi-dev
21:37jeisom_ has quit [Remote host closed the connection]
22:04kofi has joined #asahi-dev
22:36kofi has quit [Quit: Page closed]
22:36Bertrand___ has quit [Read error: Connection reset by peer]
22:38Bertrand___ has joined #asahi-dev
22:48kofi has joined #asahi-dev
22:54CME_ has joined #asahi-dev
22:55CME has quit [Ping timeout: 480 seconds]
22:58kofi has quit [Ping timeout: 480 seconds]
23:39ellyq has quit [Remote host closed the connection]
23:46glem has quit [Quit: bye.]
23:46glem has joined #asahi-dev
23:49glem has quit []
23:49glem has joined #asahi-dev