mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #361] lxw_strdup() acess violation in Debug Mode #286
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/libxlsxwriter#286
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @LeoPollock on GitHub (Nov 26, 2021).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/361
Originally assigned to: @jmcnamara on GitHub.
Hi. First, thanks for the amazing library. It really helped me a lot. I am having some trouble when generating a line chart in Debug Mode. The sheet I am building varies in size from the data I have. Basically, I have two columns, one with the date(dd/mm/yy) and the other with the hour(hh:mm:ss), which I use as the category axis. Then I have three columns of floats that I use which one as a series. I set the interval tick and unit by a factor of 17 because the number of lines can be large(let's say from 100 to 1000). When generating the sheet with the chart with no options(
worksheet_insert_chart(worksheet, CELL("A1"), chart);), the code works.The problem is: when I put a lxw_chart_options object to resize the chart in the sheet, the debug throws an exception because an access violation in
lxw_strdup()(instrlen(str)), called onobject_props->description = lxw_strdup(user_options->description);inlxw_error worksheet_insert_chart_opt(). In release mode, the code works just fine, the chart has the size that I want.I tried to add the description, dynamically allocate lxw_chart_options, with no success.
Obs.: In another part of the code, I use a similar function to generate a column chart(with less data, should I mention), and it works with
lxw_error worksheet_insert_chart_opt().Here is my code:
@jmcnamara commented on GitHub (Nov 26, 2021):
This is probably an issue:
The lxw_chart_options struct should be initialized or else it will contain a lot of junk data. Something like this should work depending on your compiler:
If that isn't the issue then please add some more of the stack trace/debug log and also what compiler and environment you are using.
@LeoPollock commented on GitHub (Nov 26, 2021):
Wow, thanks for the fast response. That was it, just had to initialize the struct. Thanks a lot. I will close the issue.