cmu462 / drawsvg Goto Github PK
View Code? Open in Web Editor NEWCMU 15-462/662: DrawSVG
CMU 15-462/662: DrawSVG
Hi, i found something unusual in this repo, is it some kind of new bug ?
id3_alloc-dealloc-mismatch.zip
command to reproduce : ./drawsvg [sample file]
The command will open a new window to display the svg file, close it and the crash info are as fellowed.
==41561==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs operator delete) on 0x7ff1d825f800
#0 0x536d40 in operator delete(void*) /home/bupt/Desktop/tools/llvm-12.0.1/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cpp:160
#1 0x5bc830 in CMU462::OSDText::~OSDText() /home/bupt/Desktop/DrawSVG/CMU462/src/osdtext.cpp:35:3
#2 0x591428 in CMU462::Viewer::~Viewer() /home/bupt/Desktop/DrawSVG/CMU462/src/viewer.cpp:56:3
#3 0x582515 in main /home/bupt/Desktop/DrawSVG/src/main.cpp:116:1
#4 0x7ff1e6f12c86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310
#5 0x45e1b9 in _start (/home/bupt/Desktop/DrawSVG/bu/drawsvg+0x45e1b9)
0x7ff1d825f800 is located 0 bytes inside of 264372-byte region [0x7ff1d825f800,0x7ff1d82a00b4)
allocated by thread T0 here:
#0 0x5364a8 in operator new[](unsigned long) /home/bupt/Desktop/tools/llvm-12.0.1/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cpp:102
#1 0x5bdb1e in CMU462::OSDText::init(bool) /home/bupt/Desktop/DrawSVG/CMU462/src/osdtext.cpp:58:10
#2 0x591c2b in CMU462::Viewer::init() /home/bupt/Desktop/DrawSVG/CMU462/src/viewer.cpp:124:17
#3 0x5824cb in main /home/bupt/Desktop/DrawSVG/src/main.cpp:110:10
#4 0x7ff1e6f12c86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310
SUMMARY: AddressSanitizer: alloc-dealloc-mismatch /home/bupt/Desktop/tools/llvm-12.0.1/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cpp:160 in operator delete(void*)
==41561==HINT: if you don't care about these errors you may set ASAN_OPTIONS=alloc_dealloc_mismatch=0
==41561==ABORTING
When I just finished Task 1, I might want to switch between Hardware render and Software renderer (ref mode) to check correctness. This switching is currently not smooth. When pressing H
and R
alternately, the program will switch in the sequence of HW, SW imp, HW, SW ref.
I have coded a patch and will open a pull request soon.
Platform: Windows 11 + Visual Studio Environment with updated version of DrawSVG.
Description:
I implement the view transformation and test it with casual zooming and dragging, given the reference implementation.
However, in the case of test2.svg
, when zooming into the central empty circle, certain lines are missing in the reference implementation, different from my implementation of rasterizing the lines.
Here are screenshots of my implementation (I haven't implemented the Xiaolin Wu's line algorithm):
Here are screenshots of the reference implementation (Notice that in the first image, certain lines in the left-bottom corner are missing):
I would like to know which one is correct? Or, are the missing lines intended?
I know that such a repository is left as it is and hasn't been updated, any feedback or discussion is welcomed. :)
All libraries are build. Managed to build Scotty3D
But DrawSVG fails to cmake ...
Getting an error:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
GLEW_LIBRARY
linked by target "CMU462" in directory /Users/rgorshkov/Documents/GitHub/DrawSVG/CMU462/src
GLEW was installed using brew
Not sure if this is open for outside feedback but just in case: I was unable to build this with the latest gcc 7.2 (ArchLinux) due to linker errors:
/usr/bin/ld: ../../src/reference/libdrawsvgref.a(viewport.cpp.o): relocation R_X86_64_32 against .bss' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: ../../src/reference/libdrawsvgref.a(texture.cpp.o): relocation R_X86_64_32 against symbol
_ZSt4cerr@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: ../../src/reference/libdrawsvgref.a(software_renderer.cpp.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
I guess the reference code for the libdrawsvgref would need to be recompiled with an -fPIC flag.
FWIW, I was able to build fine with gcc 5.4 (ubuntu 16.04)
Windows build instructions using CLion
(tested on CLion 2018.3)
Open CLion, then do File -> Import Project..
In the popped out window, find and select the project folder ...\DrawSVG, click OK, click Open Existing Project, then select New Window
Make sure the drop down menu on top right has drawsvg selected (it should say drawsvg | Debug). Then open the drop down menu again and go to Edit Configurations..
Fill in Program arguments, say, ./svg/basic, then click Apply and close the popup
Now you should be able to click on the green run button on top right to run the project.
version:
Clion 2021.2
VS2022 preview
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.