« first day (2167 days earlier)      last day (1329 days later) » 

12:07 AM
error: process didn't exit successfully: `target\debug\column_mean.exe` (exit code: 0xc0000374, STATUS_HEAP_CORRUPTION)
 
12:37 AM
... seriously though, what is that? it breaks my build but persists after restart, recompile, renaming binary and recompile, cargo clean and recompile, trying other cargo debug targets. what could I possibly have corrupted that bad?
 
@FélixGagnon-Grenier the heap, obviously :-P
 
Interesting that it does the same thing in release and debug.
wait did you say that?
 
huh I didn't
 
I'm not sure how I got that from your comment. Well I'd try release then :)
/me wonders if Valgrind works as well on Rust targets as gdb does
 
1:11 AM
@trentcl it would seem that it is weird after all, as both release and debug show it
 
@FélixGagnon-Grenier Well, the usual suspects for heap corruption are: double free, use-after-free, and index-out-of-bounds
 
It happens during a sort operation
 
From recent experience, I can tell you that the point where the corruption occurs doesn't necessarily have any relation to the point where it's detected and the process aborts
But I don't program for Windows so I've never seen a message like the one you showed
 
I mean, if I remove the sort it works correctly
but it is noted :)
 
@FélixGagnon-Grenier this is what my coworker kept telling me
turned out the problem was in a totally unrelated function :-\
 
1:19 AM
huh
 
I found that one with Valgrind.
I don't know if there is an equivalent for Windows, or if there is whether it would work with Rust...
 
on a scale of 1 to Alice in wonderland, how deep is the rabbit hole for an Valgrind?
 
I'm going to say: for debugging C on Linux it's a 2, add 1 for Rust, add 2 for Windows... probably at least 5 ;-)
Auditing your uses of unsafe might be a better use of time, unless you have a lot of them.
 
 
2 hours later…
3:10 AM
@trentcl there's this program called Dr. Memory, but I've never used it
@trentcl I've had to debug multiple cases of memory corruption both at work (in IBM RPG and in Delphi), and indeed, the cause of a memory corruption is often unrelated to the symptoms
when the thing that gets corrupted is a global variable, I found that data breakpoints are very useful
 
3:49 AM
@FrancisGagné that was almost disappointingly straightforward to install and use
Error #2: LEAK 32 direct bytes 0x0000028f9b7907b0-0x0000028f9b7907d0 + 0 indirect bytes
# 0 replace_RtlAllocateHeap                    [d:\drmemory_package\common\alloc_replace.c:3771]
# 1 ntdll.dll!RtlpAddVectoredHandler
# 2 std::rt::lang_start_internal               [/rustc/bbc677480db8da85ea302e1e89d3df1f00e435bf\/library\std\src\rt.rs:38]
# 3 std::rt::lang_start<>                      [C:\Users\LeUser\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:65]
 
@FélixGagnon-Grenier well that's a memory leak; that's not what you're looking after, is it?
 
now to the less straightforward step
@FrancisGagné I don't know either to be honest
 
@FélixGagnon-Grenier if it's anything like Valgrind, there are multiple tools for different tasks
the thing is, if something writes out of bounds, I'm not sure tools like this will catch that
they operate at the machine code level, so they don't have enough type/semantic information to determine whether reads or writes are "in bounds" or "out of bounds"
if your program fits miri's limitations, then it might be a better tool
miri operates at the MIR level, so it has type information
 
 
3 hours later…
6:55 AM
I always struggle with anonymous lifetimes.
(I often end up with explicit ones because I'm not sure of how the implicit ones work)
 
 
1 hour later…
 
3 hours later…
11:28 AM
@Shepmaster Maybe one would expect you to be invited as a _Shep_herd.
(lame joke intended)
 
11:45 AM
@Shepmaster It's just I completely fail to understand what the fuss is all about when it comes to error handling. I don't understand the existence of the myriad error handling libraries, nor the vast amount of improvement ideas, which are in my book introduce zero improvements to the language.
I think Rust has an incredibly nice, convenient, consistent, and simple (!) way of dealing with errors, without magic and whatnot. It just works and it does an amazing job -- by far the best I've seen in the dozen or so languages I speak. I'm not against improvements in general, for example I like the idea of the try-blocks as it was discussed earlier this year. But to create a work-group around this and invest precious time into a non-existent problem.. I fail to see how that's useful.
 
12:43 PM
@E_net4thecloserasduplicate I was invited, but I didn’t think that I’d be able to allocate enough time to actually be a member of the group. I am watching some what closely from the sidelines.
@PeterVaro remember that it’s not necessarily a zero sum game; what time is that in the group members are spending on this is it necessarily time that they will be spending on something more important to rust.
@PeterVaro One thing I find unfortunate is that most of the libraries aren’t actually error handling libraries. SNAFU certainly isn’t. The problem is that there’s not a great understood term for library that creates error types from other error types and makes it easy to add data to errors.
 
 
2 hours later…
2:28 PM
For what it's worth, my blog post is a side effect of the state of things regarding error handling in Rust. Were they all perfect, i wouldn't have felt the need to write about it.
And the main pain points IMO are: it's too easy to make poor quality errors by just wrapping sum types without context; backtraces are not stable and therefore not talked much about in the book; and implementing Display could be easier and have stronger conventions (namely whether to print the source or not).
 

« first day (2167 days earlier)      last day (1329 days later) »