←back to thread

180 points beryilma | 1 comments | | HN request time: 0s | source
Show context
ctz ◴[] No.41908126[source]

  Runtime errors surface when a program
  runs into an unexpected condition or situation
  such as dividing by zero, memory overflow, or
  addressing a wrong or unauthorized memory
  location or device, or when a program tries to
  perform an illegitimate or unauthorized operation
  or tries to access a library, for example.
  The programs must be thoroughly tested for
  various types of inputs (valid data sets, invalid
  data sets and boundary value data sets) and
  conditions to identify these errors. Once identified,
  runtime errors are easy to fix.
Embarrassing horseshit.
replies(4): >>41908241 #>>41909426 #>>41909473 #>>41910499 #
dustfinger ◴[] No.41908241[source]
> or tries to access a library

I had to open the PDF and find this line to confirm. It really says that. It reads as if claiming that any program that accesses a library will then have a runtime error. That is obviously not what they intended, but I have read it over a few times now and cannot see another interpretation.

replies(1): >>41908484 #
TrueDuality ◴[] No.41908484[source]
That line is referring to shared libraries linked to a dynamic executable. If a shared library isn't installed or available you will receive an error similar to the following:

    $ ./main
    ./main: error while loading shared libraries: librandom.so: cannot open shared object file: No such file or directory 
Which is indeed a runtime error.

There is also the common use case of hot-reloading compiled code which dynamically loads and unloads shared libraries without restarting the entire application. It needs to be done carefully but you've likely used an application that does this. Failure to load a library, or loading an incompatible one will also create a runtime error.

Looks like there is a lot of bad generalizations in here, but they are technically correct on this one.

replies(2): >>41908584 #>>41908831 #
1. stonemetal12 ◴[] No.41908831[source]
Perhaps if they said "tries and fails to access a library". Merely attempting to access (possibly successfully) a library is not an error.