Stack traces for Rakudo issue 1785
This is a personal command-line app that uses web-scraping to find out if on specific web pages, a specific file download (forum attachment or similar) has been updated, and if so, automatically re-downloads it.
Different classes represent webpages of different types:
ModSync::Remote::DownloadPage::IPS
ModSync::Remote::DownloadPage::Custom
...
Each of them implements the releases
and latest-release
method, which return data about the attachment of interest, with the help of shared subroutines from local package ModSync::Remote::Net
:
curl
makes a HTTP request using theLibCurl::Easy
module.xpath-nodes
andxpath-value
are used to query the DOM of the downloaded web page (after parsing it). The DOM parsing and the XPath queries are both performed by the Perl 5 moduleXML::LibXML
.
I didn't useInline::Perl5
for this, because it does not support precompilation. Instead, I hacked together a custom solution that spawns aperl
process on demand as aProc
. The Perl 5 program executed by theperl
process knows how to parse a DOM withXML::LibXML
and perform method calls on it, and communicates with the main Perl 6 program by accepting commands on STDIN and writing serialized responses to STDOUT.
This whole process is a bit hairy, and I wouldn't be surprised if its the source of the error.
current-download
is just a subroutine in the main script that kicks off the process by calling latest-release
on the object representing the web page that's currently being processed.
When given many web pages to check in sequence, it usually processes the first few just fine, but at some point (not always the same point) crashes with "equal requires a concrete string, but got null".
The stack traces seem to always point to one of the subroutines curl
, xpath-nodes
, or xpath-value
- usually to the very top of the subroutine, even if harmless debug statements are added to the top of it.
Rarely, it just segfaults instead of throwing an exception.
Back when I wrote this code, it worked just fine on the then-current Rakudo, so either it's a regression in Rakudo or I somehow relied on something that was not in fact a feature.