cboettig / eml2

:package: A list-based rewrite of higher-level functions from EML
5 stars 3 forks source link

Two common errors #7

Closed maier-m closed 6 years ago

maier-m commented 6 years ago

There are two common vague errors that appear often when working in eml2.

  1. Error: parse error: trailing garbage ...
  2. Error: C stack usage XXXXXXX is too close to the limit

The following code illustrates both.

f <- system.file("xsd/test", "eml-datasetWithUnits.xml", package = "EML")
eml <- eml2::read_eml(f)
eml2::eml_get(eml, "attributeName")
eml2::eml_get(eml$dataset$dataTable$attributeList$attribute[[1]], "attributeName")

I don't believe the behavior is isolated to eml_get this just serves as a minimal reproducible error.

cboettig commented 6 years ago

Thanks for the reproducible examples! I'll take a look.

cboettig commented 6 years ago

@maier-m Okay, I think this should be fixed in master (you'll have to reinstall emld from GitHub too, though I bumped the version requirement here so install_github("cboettig/eml2") should do that automatically...

This should fix the minimal examples above, but I suspect these errors may still appear elsewhere. Please continue to file reports for any reproducible errors like these you get, having an example to work from makes things much easier to debug.

The second error (C stack usage ...) occurs whenever I screw up a recursive function and permit an infinite loop for some edge case, and there's quite a lot of recursive functions. The first error is more specific to jq usage which only appears in two functions (eml_get and get_unitType, so I think should be squashed...