Skip to content
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

NullPointerException #55

Open
karlp opened this issue Aug 10, 2020 · 3 comments
Open

NullPointerException #55

karlp opened this issue Aug 10, 2020 · 3 comments
Assignees

Comments

@karlp
Copy link

karlp commented Aug 10, 2020

Unfortunately there's no stack trace, just...

Memory Map Plugin version 2.2.1 (53614)
ERROR: Build step failed with exception
java.lang.NullPointerException
Build step 'Memory Map Publisher' marked build as failure

I added a custom logger for net.praqma.jenkins and got nothing extra there either.

I suspect that the linker script parsing doesn't handle includes? The linker script is just

/* Define memory regions. */
MEMORY
{
	rom (rx) : ORIGIN = 0x08002000, LENGTH = 56K
	ram (rwx) : ORIGIN = 0x20000000, LENGTH = 32K
	eep (r) : ORIGIN = 0x08080000, LENGTH = 4K
}

INCLUDE ../common/cortex-m-generic.ld

However, I don't know how to debug this further

@praqma-thi praqma-thi self-assigned this Aug 12, 2020
@praqma-thi
Copy link

Can you share the Memory Map plugin's configuration of your job? I'll see if I can reproduce the issue.

@karlp
Copy link
Author

karlp commented Aug 12, 2020

Reconfigured it from scratch again, and got a stack trace thsi time too...

Memory Map Plugin version 2.2.1 (53614)
ERROR: Build step failed with exception
java.lang.NullPointerException
	at java.base/java.util.regex.Matcher.getTextLength(Matcher.java:1770)
	at java.base/java.util.regex.Matcher.reset(Matcher.java:416)
	at java.base/java.util.regex.Matcher.<init>(Matcher.java:253)
	at java.base/java.util.regex.Pattern.matcher(Pattern.java:1133)
	at net.praqma.jenkins.memorymap.parser.gcc.GccMemoryMapParser.getSections(GccMemoryMapParser.java:110)
	at net.praqma.jenkins.memorymap.parser.gcc.GccMemoryMapParser.parseConfigFile(GccMemoryMapParser.java:185)
	at net.praqma.jenkins.memorymap.parser.MemoryMapConfigFileParserDelegate.invoke(MemoryMapConfigFileParserDelegate.java:58)
	at net.praqma.jenkins.memorymap.parser.MemoryMapConfigFileParserDelegate.invoke(MemoryMapConfigFileParserDelegate.java:41)
	at hudson.FilePath.act(FilePath.java:1075)
	at hudson.FilePath.act(FilePath.java:1058)
	at net.praqma.jenkins.memorymap.MemoryMapRecorder.perform(MemoryMapRecorder.java:89)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
	at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
	at hudson.model.Build$BuildExecution.post2(Build.java:186)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
	at hudson.model.Run.execute(Run.java:1905)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:428)
Build step 'Memory Map Publisher' marked build as failure

COnfig is as per image, based on examples in https://github.com/Praqma/memory-map-examples/blob/master/examples/arm-none-eabi-gcc_4.8.4_hello_world/graphConfiguration.json
Screenshot from 2020-08-12 09-34-30

app.ld is (with comments stripped)

{
	rom (rx) : ORIGIN = 0x08002000, LENGTH = 56K
	ram (rwx) : ORIGIN = 0x20000000, LENGTH = 32K
	eep (r) : ORIGIN = 0x08080000, LENGTH = 4K
}
INCLUDE ../common/cortex-m-generic.ld

cortex-m-generic.ld is https://github.com/libopencm3/libopencm3/blob/master/lib/cortex-m-generic.ld

@praqma-thi
Copy link

The parser tries to find the SECTIONS block it assumes is in your app.ld. The following step then happily explodes trying to parse null. So indeed, it boils down to the plugin being unable to handle INCLUDE statements. In the end, it's just a humble jumble of regular expressions.

I'll make an issue about the missing INCLUDE support, though that might take a while to implement. Our Jenkins plugins are mostly on life support as our R&D has all but evaporated. In the mean time, you'll probably need find a workaround, such as appending the files together in an earlier step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants