-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
realloc(): invalid pointer
#22
Comments
Seems likely to have been introduced by #20, based on the backtrace. |
I just ran all the CSV.jl tests and didn't see any issues; is there a way you could share the file, even if only privately? (quinn.jacobd@gmail.com) |
I'll try to pull the data tomorrow |
@simonbyrne, do you have any ideas on what might be happening here? My two thoughts are
|
The second one could be the case. Tough to say without a reproducible example. |
It appears that the issue has to do with using PackageCompiler. I can reproduce the problem by running the tests for Parsers. The issue can be reproduced using this Dockerfile: FROM julia:1.0.3-stretch
RUN apt-get update && apt-get install -y gcc && \
julia -e 'using Pkg; Pkg.add("PackageCompiler"); using PackageCompiler; compile_package(force=true)'
RUN julia -e 'using Pkg, PackageCompiler; Pkg.add(PackageSpec(name="Parsers", version="0.2.20"))'
# Fails with "Task cannot be serialized"
# RUN julia -e 'using PackageCompiler; compile_package("Parsers", force=true)'
RUN echo "using Parsers" > userimg.jl && \
julia -e 'using PackageCompiler: build_sysimg, default_sysimg_path; build_sysimg(default_sysimg_path(), "userimg.jl")'
CMD ["julia", "-e", "using Pkg; Pkg.test(\"Parsers\")"] $ docker build -t parsers .
...
$ docker run --rm parsers
...
*** Error in `/usr/local/julia/bin/julia': realloc(): invalid next size: 0x00007f0cb087c4d0 ***
...
signal (6): Aborted
in expression starting at /root/.julia/packages/Parsers/v5u2B/test/floats.jl:1
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7f0cb58d8bff)
unknown function (ip: 0x7f0cb58defc5)
unknown function (ip: 0x7f0cb58e213b)
realloc at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
jl_gc_counted_realloc_with_old_size at /buildworker/worker/package_linux64/build/src/gc.c:2777
__gmpz_realloc at /usr/local/julia/bin/../lib/julia/libgmp.so (unknown line)
__gmpz_mul at /usr/local/julia/bin/../lib/julia/libgmp.so (unknown line)
mul! at ./gmp.jl:132 [inlined]
mul! at ./gmp.jl:134 [inlined]
scale at /root/.julia/packages/Parsers/v5u2B/src/floats.jl:80 [inlined]
scale at /root/.julia/packages/Parsers/v5u2B/src/floats.jl:114 [inlined]
#_defaultparser#46 at /root/.julia/packages/Parsers/v5u2B/src/floats.jl:239 [inlined]
_defaultparser at /root/.julia/packages/Parsers/v5u2B/src/floats.jl:126 [inlined]
#defaultparser#45 at /root/.julia/packages/Parsers/v5u2B/src/floats.jl:123 [inlined]
defaultparser at /root/.julia/packages/Parsers/v5u2B/src/floats.jl:123
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2184
... Using Parsers 0.2.18 does not have this issue. |
@omus So if you enable the commented-out line, it fails to compile, but with sysimg it succeeds compilation but gives the realloc error at runtime? |
Using the following to include Parsers.jl in a system image will fail on 0.2.20 or 0.2.18:
Like you said, the alternative |
So if I'm understanding correctly, when Parsers.jl is included in the sysimg, the pre-allocated BigInts are somehow borked, but normal precompilation is fine. Right? |
That is also my understanding |
You can't mutate BigInts in the system image. Since this use case needs |
…unction. This caused issues when Parsers.jl was included in the sysimg compilation (via PackageCompiler).
Fix #22 by reinitializing our pre-allocated BigInts in the __init__ f…
When updating from Parsers 0.2.18 to 0.2.20 I get the following when parsing a CSV file:
I'll note that this error is occurring in a fairly deep application. I can try to make a minimal reproducible test if requested.
The text was updated successfully, but these errors were encountered: