[Fx2lib-devel] [ fx2lib-Issues-2909385 ] segmentation fault
Status: Beta
Brought to you by:
mulicheng
From: SourceForge.net <no...@so...> - 2013-01-25 10:17:54
|
Issues item #2909385, was opened at 2009-12-05 11:45 Message generated for change (Comment added) made by maartenbrock You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126193&aid=2909385&group_id=247216 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: segmentation fault Initial Comment: Receive segmentation fault from sdcclib due to a bad memory access when making fx2.lib. Using sdcclib v1.2 and sdcc v2.9.0 on Mac OS X i386 (Snow Leopard v10.6.2). Do not receive this error when using sdcclib for building other libraries, also for the FX2. ---------------------------------------------------------------------- Comment By: Maarten Brock (maartenbrock) Date: 2013-01-25 02:17 Message: Since the patch was applied and also a new release of SDCC (actually several by now) has been made, can't this be closed? ---------------------------------------------------------------------- Comment By: Chris Hiszpanski (chiszp) Date: 2009-12-05 12:37 Message: Correction on my last post, should be: sdcc fx2.lib build/serial.rel build/i2c.rel ... ---------------------------------------------------------------------- Comment By: Chris Hiszpanski (chiszp) Date: 2009-12-05 12:34 Message: This is a problem with sdcclib, not fx2lib. In particular, line 61 in version 1.2 of sdcclib is: for(; (path[i]!='\\')&&(path[i]!='/')&&(i>=0); i--); When i = -1, path[-1] will be accessed before the i>=0 check exits the loop. A work around is to generate a temporary build directory for your .rel files and call sdcclib as: sdcclib fx2.lib build/serial.rel i2c.rel ... The loop will terminate when it reaches the '/', before i == -1. However, to fix the bug in sdcclib, change the line to: for(; (i>=0)&&(path[i]!='\\')&&(path[i]!='/'); i--); This is patch #2788108 in the sdcc project: http://sourceforge.net/tracker/?func=detail&aid=2788108&group_id=599&atid=300599 We should see it in the next version. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126193&aid=2909385&group_id=247216 |