2026-05-16 05:28:42 sox -n -d synth 2 sine remix 0 1 : 3 sine remix 1 0 (didn't work) 2026-05-16 06:01:02 no, in fact it segfaults! you want `sox -n -d synth 2 sine remix 0 1 : synth 3 sine remix 1 0` 2026-05-16 07:45:24 Curiously, the musician who wrote http://modarchive.org/?request=search&submit=Find&search_type=filename&query=pathfind.s3m back in the day is apparently still active, even if it's all code and no music: http://playspoon.com/ . 2026-05-16 15:55:31 ACTION listens to My Way (cover) by Luciano Pavarotti  2026-05-16 16:44:57 xentrac, if it segfaults shouldn't it be reported as bug? 2026-05-16 16:47:53 Last I've checked, sox seemed to lack a maintainer to act on bug reports. 2026-05-16 17:12:19 Stalevar: it should be fixed 2026-05-16 17:13:38 the Debian sox package has a maintainer 2026-05-16 17:17:44 also though other Debian developers can fix it (in Debian) even if the maintainer (the Debian Multimedia Maintainers team actually) doesn't 2026-05-16 17:22:28 specifically the bug is that create_user_effects calls sox_create_effect(NULL) at line 1025: effp = sox_create_effect(sox_find_effect(user_effargs[current_eff_chain][i].name)); 2026-05-16 17:22:36 I guess sox_find_effect is returning NULL 2026-05-16 17:24:05 in fact it does that a lot, like, every time it can't find an effect maybe 2026-05-16 17:29:24 xentrac, it's mainstream bug because it segfaults in Slackware too 2026-05-16 17:30:10 the shallowest possible fix would be maybe to check on that line whether sox_find_effect returned NULL, but maybe it shouldn't be getting to that point in the first place? like maybe we should get an error message that "3" isn't the name of an effect? because it's sox_find_effect("3") that's returning NULL 2026-05-16 17:30:36 sure, Slackware can totally apply Debian's patches though if Patrick finds out about them 2026-05-16 17:31:32 Crazy how many bugs are caused by unexpected NULL's 2026-05-16 17:31:47 cue Tony Hoare 2026-05-16 17:32:09 What's really crazy is the number of libraries that update from returning non-NULL to NULL on a particular edge case 2026-05-16 17:33:05 I doubt there's anything special about null pointers when coding sloppily. 2026-05-16 17:33:43 Is it sloppy to expect a library won't change from returning non-NULL to NULL on a specific use? 2026-05-16 17:33:53 I guess so according to libXML (no I won't let it go) 2026-05-16 17:35:14 an ML or Haskell programmer would say that it's a type error: sox_create_effect is returning a `sox_effect_handler option` or a `Maybe Sox_effect_handler` rather than a plain `sox_effect_handler` 2026-05-16 17:36:27 And Iron Oxide too 2026-05-16 17:36:32 ? 2026-05-16 17:36:37 oh right 2026-05-16 17:37:03 from that point of view, the specific thing that makes it so error-prone is that, in C, as in machine code, the conversion from a `sox_effect_handler option` to a `sox_effect_handler` is just "" 2026-05-16 17:37:16 that is, it requires no code at all to convert from one to the other 2026-05-16 17:37:43 so if you forget to do the conversion your program works most of the time anyway 2026-05-16 17:39:24 from a certain point of view, this is the same thing that makes textual macro systems so error-prone 2026-05-16 17:39:46 I'd say that Forth is no different to C in this particular respect. 2026-05-16 17:40:04 Maybe more things should use a sentinel instead of NULL 2026-05-16 17:40:28 it doesn't really matter if you use a sentinel instead of NULL 2026-05-16 17:40:31 Can return a pointer to something that won't nuke your computer from orbit if you access it even though it was the error result 2026-05-16 17:41:06 You're thinking if they code sloppy then it's sloppy, doesn't matter if you try to hold their hands? 2026-05-16 17:41:11 no 2026-05-16 17:42:18 I mean there may be some truth to that but it's not the angle I'm thinking of it from. I'm thinking about how you can change the system to make it less error-prone 2026-05-16 17:42:52 a thing that *would* help would be if you represented your nullable pointers by XORing them with a nonzero sentinel value, for example 2026-05-16 17:43:33 well, it wouldn't have to be the sentinel value. it could be some other arbitrary value 2026-05-16 17:44:44 because then to dereference the pointer you would have to explicitly do the conversion (by XORing with the value), at which point you would be less likely to forget to handle the NULL case 2026-05-16 17:46:25 and if you forgot to do the conversion your code would *never* work, instead of apparently working in testing until it hits some edge case 2026-05-16 17:47:14 ACTION listens to http://he3.magnatune.com/all/07-See%20what%20we%27re%20made%20of-Tonethief.mp3  2026-05-16 17:49:10 and, if a library changed from returning a non-nullable pointer to a nullable pointer, that would require all the code that invoked it to be changed in order to *ever* work, rather than being changed to work in some edge case 2026-05-16 17:49:45 Yeah what sick psycho would do that 2026-05-16 17:50:47 I really liked the SDL3 upgrade where I had to convert every call from `if (SDL_CanFail` to `if (!SDL_CanFail`, what a wonderful change 2026-05-16 17:52:26 well, it's annoying to have to change all your calls, but it's less annoying than having your code work in testing and failing in production 2026-05-16 17:56:38 Backwards-compatibility is underrated 2026-05-16 17:57:08 right, but there's no way to be backwards-compatible if you're changing a call that previously returned no error into a call that returns an error 2026-05-16 17:57:24 so the best you can do is be *obviously* backwards-incompatible 2026-05-16 17:57:29 And here I'm reminded of this Martin Richards quote: "The philosophy of BCPL is not one of the tyrant who thinks he knows best and lays down the law on what is and what is not allowed; rather, BCPL acts more as a servant offering his services to the best of his ability without complaint, even when confronted with apparent nonsense. 2026-05-16 17:57:29 The programmer is always assumed to know what he is doing and is not hemmed in by petty restrictions." Different programmers introduce different bugs; and eliminating a given class of bugs often results in some other class filling the count. 2026-05-16 17:57:52 I had this confabulated memory that qmail was especially good about this kind of thing, specifically having the idea that lines in .qmail that represented email addresses to forward mail to were necessarily different from the email addresses they represented. if you wanted to forward email to me@new.job.com, I thought you had to put the line "&me@new.job.com" into .qmail 2026-05-16 17:58:55 that way the qmail code would never treat a string as an email address that was actually a .qmail line or vice versa, because the mapping between the two domains had an empty intersection with the identity transformation 2026-05-16 17:59:50 but, in fact, dot-qmail(5) or dot-qmail(9) explains, "If the address begins with a letter or number, you may leave out the ampersand" 2026-05-16 18:01:09 (not that it would be impossible for a programmer to make the mistake of treating a string as an email address that was actually a .qmail line or vice versa, but that the bug would be immediately obvious) 2026-05-16 18:03:01 qmail's stralloc code does do something similar with null-terminated strings; in stralloc_catb, where it concatenates two non-null-terminated strings, there is this line: 2026-05-16 18:03:05 sa->s[sa->len] = 'Z'; /* ``offensive programming'' */ 2026-05-16 18:05:18 which ensures that if you accidentally treat the string as null-terminated, you will have an extra 'Z' at the end, so you will reliably notice the bug. Except that that isn't really true because stralloc_append will append a byte to your non-null-terminated string without adding the extra 'Z' 2026-05-16 18:06:15 in Forth the thing to do is probably to return two separate values: one indicating success or failure, and another one that is the actual value being returned, where applicable 2026-05-16 18:09:16 (specifically for the case of returning a failure) 2026-05-16 18:20:56 another example of such type conflation, which I'm reminded of reading https://cr.yp.to/qmail/qmailsec-20071101.pdf, is C format-string vulnerabilities. When a string `s` doesn't contain any `%` characters, you can print it out with `printf(s);` or send it to syslog with `syslog(priority, s);`, but that fails (in, as it turns out, a dangerous way!) if the string *does* contain a `%` 2026-05-16 18:22:43 if you, for example, required the format string to have an extra `%` at the beginning (which was omitted from the output), then you would notice immediately every time you created that bug, and avoid it, instead writing `syslog(priority, "%%s", s);` 2026-05-16 18:23:33 This specific issue, I believe, is addressed by the GCC -Wformat-nonliteral option. 2026-05-16 18:26:06 Somewhat, but it's not actually invalid or always a bad idea to get your format string from a variable or data structure. If you're willing to deploy static compile-time checking against the problem, though, you can do a lot better than -Wformat-nonliteral; you can define a static format-string data type, perhaps with explicit coercions to and from strings 2026-05-16 18:27:49 Neither that nor my suggested dynamic leading-% check is backwards-compatible, of course. 2026-05-16 19:50:46 When and why did all my old thinkpads become worth so damn much on ebay 2026-05-16 19:51:18 I used to buy these things because they'd cost £20, who is buying these now 2026-05-16 19:51:43 Like £200 for a working one, that's a typical price I'm seeing 2026-05-16 20:27:04 well, they fairly reliably *continue* working 2026-05-16 23:08:28 Is Chuck Moore still around in Forth scene? 2026-05-16 23:09:54 I was reading https://dl.acm.org/doi/10.1145/234286.1057832 2026-05-16 23:10:01 "The evolution of Forth" 2026-05-16 23:11:09 kind of. his Fireside Chat this Christmas he talked more about the virtues of hiking with a metal cane than he did about Forth 2026-05-16 23:28:09 Ah, interesting. I'm glad he's still enjoying the simple pleasures of life (Forth included) 2026-05-16 23:29:10 Meanwhile, I've just watched Elizabeth Rather for the first time in this Computer Chronicles episode from 1984: https://youtu.be/z8njwqZ0kGc?t=761 2026-05-16 23:33:51 Block editing is cool 2026-05-16 23:55:31 I wonder what she's up to these days